1 17 18 package org.apache.geronimo.itest.client; 19 20 import javax.naming.InitialContext ; 21 22 import junit.framework.TestCase; 23 import org.openejb.test.entity.bmp.BasicBmpHome; 24 import org.openejb.test.entity.bmp.BasicBmpObject; 25 import org.openejb.test.stateful.BasicStatefulHome; 26 import org.openejb.test.stateful.BasicStatefulObject; 27 import org.openejb.test.stateless.BasicStatelessHome; 28 import org.openejb.test.stateless.BasicStatelessObject; 29 30 public class JndiEjbRefTest extends TestCase { 31 32 33 public void testLookupEntityBean() throws Exception { 34 InitialContext ctx = new InitialContext (); 35 assertNotNull("The InitialContext is null", ctx); 36 37 BasicBmpHome home = (BasicBmpHome) ctx.lookup("java:comp/env/ejb/bmp_entity"); 38 assertNotNull("The EJBHome looked up is null", home); 39 40 BasicBmpObject object = home.create("Enc Bean"); 41 assertNotNull("The EJBObject is null", object); 42 } 43 44 public void testLookupStatefulBean() throws Exception { 45 46 InitialContext ctx = new InitialContext (); 47 assertNotNull("The InitialContext is null", ctx); 48 49 BasicStatefulHome home = (BasicStatefulHome) ctx.lookup("java:comp/env/ejb/stateful"); 50 assertNotNull("The EJBHome looked up is null", home); 51 52 BasicStatefulObject object = home.create("Enc Bean"); 53 assertNotNull("The EJBObject is null", object); 54 55 } 56 57 public void testLookupStatelessBean() throws Exception { 58 59 InitialContext ctx = new InitialContext (); 60 assertNotNull("The InitialContext is null", ctx); 61 62 BasicStatelessHome home = (BasicStatelessHome) ctx.lookup("java:comp/env/ejb/stateless"); 63 assertNotNull("The EJBHome looked up is null", home); 64 65 BasicStatelessObject object = home.create(); 66 assertNotNull("The EJBObject is null", object); 67 68 } 69 70 } 71 | Popular Tags |