1 22 package org.jboss.test.readahead.test; 23 24 import javax.naming.Context ; 25 import javax.naming.InitialContext ; 26 27 import junit.framework.TestCase; 28 import junit.framework.Test; 29 import junit.framework.TestSuite; 30 31 import org.jboss.test.readahead.interfaces.CMPFindTestSessionHome; 32 import org.jboss.test.readahead.interfaces.CMPFindTestSessionRemote; 33 34 import org.jboss.test.JBossTestCase; 35 36 44 public class ReadAheadUnitTestCase extends JBossTestCase { 45 46 CMPFindTestSessionRemote rem = null; 47 48 public ReadAheadUnitTestCase(String name) { 49 super(name); 50 } 51 52 protected void tearDown() throws Exception { 53 if (rem != null) { 54 getLog().debug("Removing test data"); 55 rem.removeTestData(); 56 57 rem.remove(); 58 59 rem = null; 60 } 61 } 62 63 protected void setUp() 64 throws Exception 65 { 66 CMPFindTestSessionHome home = 67 (CMPFindTestSessionHome)getInitialContext().lookup("CMPFindTestSession"); 68 rem = home.create(); 69 70 rem.createTestData(); 71 } 72 73 public void testFindAll() throws Exception { 74 rem.testFinder(); 75 } 76 77 public void testFindByCity() throws Exception { 78 rem.testByCity(); 79 } 80 81 public void testAddressByCity() throws Exception { 82 rem.addressByCity(); 83 } 84 85 public static Test suite() throws Exception 86 { 87 return getDeploySetup(ReadAheadUnitTestCase.class, "readahead.jar"); 88 } 89 90 } 91 | Popular Tags |