1 22 package org.jboss.ejb3.test.hbm.unit; 23 24 import java.util.List ; 25 import org.jboss.ejb3.test.hbm.Annotated; 26 import org.jboss.ejb3.test.hbm.EntityTest; 27 import org.jboss.ejb3.test.hbm.HBM; 28 import org.jboss.test.JBossTestCase; 29 import junit.framework.Test; 30 31 37 38 public class EntityUnitTestCase 39 extends JBossTestCase 40 { 41 org.jboss.logging.Logger log = getLog(); 42 43 static boolean deployed = false; 44 static int test = 0; 45 46 public EntityUnitTestCase(String name) 47 { 48 49 super(name); 50 51 } 52 53 public void testAll() throws Exception 54 { 55 EntityTest tester = (EntityTest) getInitialContext().lookup("EntityTestBean/remote"); 56 tester.createBoth(); 57 List annotated = tester.findAnnotated(); 58 assertEquals(annotated.size(), 1); 59 Annotated an = (Annotated)annotated.get(0); 60 HBM hbm = an.getHbm(); 61 assertEquals(hbm.getName(), "Gavin"); 62 assertEquals(tester.findHBM().size(), 1); 63 } 64 65 public static Test suite() throws Exception 66 { 67 return getDeploySetup(EntityUnitTestCase.class, "hbm2-test.par, hbm-test.jar"); 68 } 69 70 } 71 | Popular Tags |