1 22 package org.jboss.test.jca.test; 23 24 import org.jboss.test.JBossTestCase; 25 import junit.framework.Test; 26 import org.jboss.test.jca.interfaces.LocalWrapperCleanupTestSessionHome; 27 import org.jboss.test.jca.interfaces.LocalWrapperCleanupTestSession; 28 import javax.transaction.UserTransaction ; 29 30 39 40 public class LocalWrapperCleanupUnitTestCase extends JBossTestCase 41 { 42 LocalWrapperCleanupTestSessionHome sh; 43 LocalWrapperCleanupTestSession s; 44 45 46 public LocalWrapperCleanupUnitTestCase (String name) 47 { 48 super(name); 49 } 50 51 protected void setUp() throws Exception 52 { 53 sh = (LocalWrapperCleanupTestSessionHome)getInitialContext().lookup("LocalWrapperCleanupTestSession"); 54 s = sh.create(); 55 } 56 57 protected void tearDown() throws Exception 58 { 59 } 60 61 public static Test suite() throws Exception 62 { 63 Test t1 = getDeploySetup(LocalWrapperCleanupUnitTestCase.class, "jcatest.jar"); 64 Test t2 = getDeploySetup(t1, "hsqldb-singleconnection-ds.xml"); 65 Test t3 = getDeploySetup(t2, "testadapter-ds.xml"); 66 return getDeploySetup(t3, "jbosstestadapter.rar"); 67 } 68 69 70 77 public void testAutoCommitInReturnedConnection() throws Exception 78 { 79 s.testAutoCommitInReturnedConnection(); 80 } 81 82 public void testReadOnly() throws Exception 83 { 84 s.testReadOnly(); 85 } 86 87 93 public void testAutoCommit() throws Exception 94 { 95 s.testAutoCommit(); 96 } 97 98 99 107 public void testAutoCommitOffInUserTx() throws Exception 108 { 109 s.testAutoCommitOffInUserTx(); 110 } 111 112 120 public void testAutoCommitOffInUserTx2() throws Exception 121 { 122 s.testAutoCommitOffInUserTx2(); 123 } 124 125 132 public void testAutoCommitOffInRemoteUserTx() throws Exception 133 { 134 try 135 { 136 s.createTable(); 137 UserTransaction ut = (UserTransaction )getInitialContext().lookup("UserTransaction"); 138 ut.begin(); 139 s.insertAndCheckAutoCommit(); 140 ut.rollback(); 141 } 142 finally 143 { 144 s.checkRowAndDropTable(); 145 } 147 } 148 149 155 156 public void testManualNoCommitRollback() throws Exception 157 { 158 try 159 { 160 s.createTable(); 161 s.testManualNoCommitRollback(); 162 } 163 finally 164 { 165 s.addRowCheckAndDropTable(); 166 } 167 } 168 169 public void testManualSecondNoCommitRollback() throws Exception 170 { 171 try 172 { 173 s.createTable(); 174 s.testManualSecondNoCommitRollback(); 175 } 176 finally 177 { 178 s.addRowCheckAndDropTable(); 179 } 180 } 181 182 } 183 | Popular Tags |