1 45 package org.openejb.test.stateless; 46 47 import org.openejb.test.entity.bmp.EncBmpHome; 48 import org.openejb.test.entity.bmp.EncBmpObject; 49 import org.openejb.test.entity.cmp.EncCmpHome; 50 import org.openejb.test.entity.cmp.EncCmpObject; 51 import org.openejb.test.stateful.EncStatefulHome; 52 import org.openejb.test.stateful.EncStatefulObject; 53 54 58 public class MiscEjbTests extends BasicStatelessTestClient{ 59 60 public MiscEjbTests(){ 61 super("EJBObject."); 62 } 63 64 protected void setUp() throws Exception { 65 super.setUp(); 66 Object obj = initialContext.lookup("client/tests/stateless/BasicStatelessHome"); 67 ejbHome = (BasicStatelessHome)javax.rmi.PortableRemoteObject.narrow( obj, BasicStatelessHome.class); 68 ejbObject = ejbHome.create(); 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_isIdentical_stateless(){ 85 try{ 86 String jndiName = "client/tests/stateless/EncBean"; 87 EncStatelessHome ejbHome2 = null; 88 EncStatelessObject ejbObject2 = null; 89 90 Object obj = initialContext.lookup(jndiName); 91 ejbHome2 = (EncStatelessHome)javax.rmi.PortableRemoteObject.narrow( obj, EncStatelessHome.class); 92 ejbObject2 = ejbHome2.create(); 93 94 assertTrue( "The EJBObjects should not be identical", !ejbObject.isIdentical(ejbObject2) ); 98 } catch (Exception e){ 100 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 102 } 103 } 104 105 public void test02_isIdentical_stateful(){ 106 try{ 107 String jndiName = "client/tests/stateful/EncBean"; 108 EncStatefulHome ejbHome2 = null; 109 EncStatefulObject ejbObject2 = null; 110 111 Object obj = initialContext.lookup(jndiName); 112 ejbHome2 = (EncStatefulHome)javax.rmi.PortableRemoteObject.narrow( obj, EncStatefulHome.class); 113 ejbObject2 = ejbHome2.create("isIdentical test"); 114 115 assertTrue( "The EJBObjects should not be identical", !ejbObject.isIdentical(ejbObject2) ); 119 } catch (Exception e){ 121 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 123 } 124 } 125 126 public void test03_isIdentical_bmp(){ 127 try{ 128 String jndiName = "client/tests/entity/bmp/EncBean"; 129 EncBmpHome ejbHome2 = null; 130 EncBmpObject ejbObject2 = null; 131 132 Object obj = initialContext.lookup(jndiName); 133 ejbHome2 = (EncBmpHome)javax.rmi.PortableRemoteObject.narrow( obj, EncBmpHome.class); 134 ejbObject2 = ejbHome2.create("isIdentical test"); 135 136 assertTrue( "The EJBObjects should not be identical", !ejbObject.isIdentical(ejbObject2) ); 138 } catch (Exception e){ 142 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 143 } 144 } 145 146 149 public void _test04_isIdentical_cmp(){ 150 try{ 151 String jndiName = "client/tests/entity/cmp/EncBean"; 152 EncCmpHome ejbHome2 = null; 153 EncCmpObject ejbObject2 = null; 154 155 Object obj = initialContext.lookup(jndiName); 156 ejbHome2 = (EncCmpHome)javax.rmi.PortableRemoteObject.narrow( obj, EncCmpHome.class); 157 ejbObject2 = ejbHome2.create("isIdentical test"); 158 159 assertTrue( "The EJBObjects should not be identical", !ejbObject.isIdentical(ejbObject2) ); 163 } catch (Exception e){ 165 fail("Received Exception "+e.getClass()+ " : "+e.getMessage()); 166 } 167 } 168 169 } 173 | Popular Tags |