1 45 package org.openejb.test.entity.cmp; 46 47 import org.openejb.test.TestFailureException; 48 49 55 public class CmpJndiEncTests extends CmpTestClient{ 56 57 protected EncCmpHome ejbHome; 58 protected EncCmpObject ejbObject; 59 60 public CmpJndiEncTests(){ 61 super("JNDI_ENC."); 62 } 63 64 protected void setUp() throws Exception { 65 super.setUp(); 66 Object obj = initialContext.lookup("client/tests/entity/cmp/EncBean"); 67 ejbHome = (EncCmpHome)javax.rmi.PortableRemoteObject.narrow( obj, EncCmpHome.class); 68 ejbObject = ejbHome.create("Enc Bean"); 69 } 70 71 protected void tearDown() throws Exception { 72 try { 73 } catch (Exception e){ 75 throw e; 76 } finally { 77 super.tearDown(); 78 } 79 } 80 81 public void test01_lookupStringEntry() { 82 try{ 83 ejbObject.lookupStringEntry(); 84 } catch (TestFailureException e){ 85 throw e.error; 86 } catch (Exception e){ 87 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 88 } 89 } 90 91 public void test02_lookupDoubleEntry() { 92 try{ 93 ejbObject.lookupDoubleEntry(); 94 } catch (TestFailureException e){ 95 throw e.error; 96 } catch (Exception e){ 97 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 98 } 99 } 100 101 public void test03_lookupLongEntry() { 102 try{ 103 ejbObject.lookupLongEntry(); 104 } catch (TestFailureException e){ 105 throw e.error; 106 } catch (Exception e){ 107 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 108 } 109 } 110 111 public void test04_lookupFloatEntry() { 112 try{ 113 ejbObject.lookupFloatEntry(); 114 } catch (TestFailureException e){ 115 throw e.error; 116 } catch (Exception e){ 117 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 118 } 119 } 120 121 public void test05_lookupIntegerEntry() { 122 try{ 123 ejbObject.lookupIntegerEntry(); 124 } catch (TestFailureException e){ 125 throw e.error; 126 } catch (Exception e){ 127 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 128 } 129 } 130 131 public void test06_lookupShortEntry() { 132 try{ 133 ejbObject.lookupShortEntry(); 134 } catch (TestFailureException e){ 135 throw e.error; 136 } catch (Exception e){ 137 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 138 } 139 } 140 141 public void test07_lookupBooleanEntry() { 142 try{ 143 ejbObject.lookupBooleanEntry(); 144 } catch (TestFailureException e){ 145 throw e.error; 146 } catch (Exception e){ 147 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 148 } 149 } 150 151 public void test08_lookupByteEntry() { 152 try{ 153 ejbObject.lookupByteEntry(); 154 } catch (TestFailureException e){ 155 throw e.error; 156 } catch (Exception e){ 157 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 158 } 159 } 160 161 public void test09_lookupEntityBean() { 162 try{ 163 ejbObject.lookupEntityBean(); 164 } catch (TestFailureException e){ 165 throw e.error; 166 } catch (Exception e){ 167 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 168 } 169 } 170 171 public void test10_lookupStatefulBean() { 172 try{ 173 ejbObject.lookupStatefulBean(); 174 } catch (TestFailureException e){ 175 throw e.error; 176 } catch (Exception e){ 177 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 178 } 179 } 180 181 public void test11_lookupStatelessBean() { 182 try{ 183 ejbObject.lookupStatelessBean(); 184 } catch (TestFailureException e){ 185 throw e.error; 186 } catch (Exception e){ 187 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 188 } 189 } 190 191 public void test12_lookupResource() { 192 try{ 193 ejbObject.lookupResource(); 194 } catch (TestFailureException e){ 195 throw e.error; 196 } catch (Exception e){ 197 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 198 } 199 } 200 201 } 202 | Popular Tags |