1 22 package org.jboss.ejb3.test.reference21_30.unit; 23 24 import javax.naming.*; 25 26 import org.jboss.ejb3.test.reference21_30.*; 27 import org.jboss.logging.Logger; 28 29 import org.jboss.ejb3.test.reference21_30.Test3; 30 31 import junit.framework.Test; 32 33 import org.jboss.test.JBossTestCase; 34 35 41 public class EarTestCase 42 extends JBossTestCase { 43 44 private static final Logger log = Logger 45 .getLogger(EarTestCase.class); 46 47 public EarTestCase(String name) 48 { 49 super(name); 50 } 51 52 public void testEjbInjection() throws Exception 53 { 54 InitialContext jndiContext = new InitialContext(); 55 56 Test3 test3 = (Test3)jndiContext.lookup("Test3"); 57 assertNotNull(test3); 58 test3.testAccess(); 59 60 Test2Home home = (Test2Home)jndiContext.lookup("Test2"); 61 assertNotNull(home); 62 Test2 test2 = home.create(); 63 assertNotNull(test2); 64 test2.testAccess(); 65 } 66 67 public static Test suite() throws Exception 68 { 69 return getDeploySetup(EarTestCase.class, "multideploy.ear"); 70 } 71 } 72 | Popular Tags |