1 22 package org.jboss.test.jca.test; 23 24 import junit.framework.*; 25 import org.jboss.test.JBossTestCase; 26 import org.jboss.test.jca.interfaces.RollbackOnlyReleaseConnectionSessionHome ; 27 import org.jboss.test.jca.interfaces.RollbackOnlyReleaseConnectionSession ; 28 29 38 39 public class RollbackOnlyReleaseConnectionUnitTestCase extends JBossTestCase 40 { 41 private RollbackOnlyReleaseConnectionSessionHome sh; 42 private RollbackOnlyReleaseConnectionSession s; 43 44 45 public RollbackOnlyReleaseConnectionUnitTestCase(String name) 46 { 47 super(name); 48 } 49 50 public static Test suite() throws Exception 51 { 52 Test t1 = getDeploySetup(RollbackOnlyReleaseConnectionUnitTestCase.class, "jcatest.jar"); 53 Test t2 = getDeploySetup(t1, "testadapter-ds.xml"); 54 return getDeploySetup(t2, "jbosstestadapter.rar"); 55 } 56 57 protected void setUp() throws Exception 58 { 59 log.debug("================> Start " + getName()); 60 sh = (RollbackOnlyReleaseConnectionSessionHome)getInitialContext().lookup("RollbackOnlyReleaseConnectionSession"); 61 s = sh.create(); 62 } 63 64 65 protected void tearDown() throws Exception 66 { 67 log.debug("================> End " + getName()); 68 } 69 70 71 73 public void testConnectionRelease() throws Exception 74 { 75 assertTrue("Connections should be released when not enrolled in Tx marked rollback only", s.testConnectionRelease() == true); 76 } 77 78 79 } | Popular Tags |