1 22 package org.jboss.test.cmp2.jbas3717; 23 24 import javax.naming.InitialContext ; 25 import javax.naming.NamingException ; 26 import org.jboss.test.JBossTestCase; 27 import org.jboss.test.util.ejb.EJBTestCase; 28 import junit.framework.Test; 29 30 34 public class JBAS3717UnitTestCase 35 extends EJBTestCase 36 { 37 public static Test suite() throws Exception 38 { 39 return JBossTestCase.getDeploySetup(JBAS3717UnitTestCase.class, "cmp2-jbas3717.ear"); 40 } 41 42 public JBAS3717UnitTestCase(String methodName) 43 { 44 super(methodName); 45 } 46 47 protected void setUp() throws Exception 48 { 49 getALocalHome().create(new Long (1)); 50 } 51 52 protected void tearDown() throws Exception 53 { 54 getALocalHome().remove(new Long (1)); 55 } 56 57 59 public void testJBAS3541() throws Throwable 60 { 61 getALocalHome().findByPrimaryKey(new Long (1)); 62 } 63 64 66 private ALocalHome getALocalHome() 67 throws NamingException 68 { 69 return (ALocalHome)lookup("ALocal"); 70 } 71 72 private Object lookup(String name) throws NamingException 73 { 74 InitialContext ic = new InitialContext (); 75 return ic.lookup(name); 76 } 77 } 78 | Popular Tags |