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