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.JDBCStatementTestsConnectionSession; 27 import org.jboss.test.jca.interfaces.JDBCStatementTestsConnectionSessionHome; 28 29 38 39 public class JDBCStatementTestsConnectionUnitTestCase extends JBossTestCase { 40 public JDBCStatementTestsConnectionUnitTestCase(String name) 41 { 42 super(name); 43 } 44 45 public static Test suite() throws Exception 46 { 47 Test t1 = getDeploySetup(JDBCStatementTestsConnectionUnitTestCase.class, "jcatest.jar"); 48 Test t2 = getDeploySetup(t1, "testadapter-ds.xml"); 49 Test t3 = getDeploySetup(t2, "testdriver-ds.xml"); 50 Test t4 = getDeploySetup(t3, "jbosstestdriver.jar"); 51 return getDeploySetup(t4, "jbosstestadapter.rar"); 52 } 53 54 60 public void testJDBCStatementTestsConnection() throws Exception 61 { 62 JDBCStatementTestsConnectionSessionHome home = 63 (JDBCStatementTestsConnectionSessionHome)getInitialContext().lookup("JDBCStatementTestsConnectionSession"); 64 JDBCStatementTestsConnectionSession s = home.create(); 65 s.testConnectionObtainable(); 66 } 67 68 public void testConfiguredQueryTimeout() throws Exception 69 { 70 JDBCStatementTestsConnectionSessionHome home = 71 (JDBCStatementTestsConnectionSessionHome)getInitialContext().lookup("JDBCStatementTestsConnectionSession"); 72 JDBCStatementTestsConnectionSession s = home.create(); 73 s.testConfiguredQueryTimeout(); 74 } 75 76 public void testTransactionQueryTimeout() throws Exception 77 { 78 JDBCStatementTestsConnectionSessionHome home = 79 (JDBCStatementTestsConnectionSessionHome)getInitialContext().lookup("JDBCStatementTestsConnectionSession"); 80 JDBCStatementTestsConnectionSession s = home.create(); 81 s.testTransactionQueryTimeout(); 82 } 83 84 public void testTransactionQueryTimeoutMarkedRollback() throws Exception 85 { 86 JDBCStatementTestsConnectionSessionHome home = 87 (JDBCStatementTestsConnectionSessionHome)getInitialContext().lookup("JDBCStatementTestsConnectionSession"); 88 JDBCStatementTestsConnectionSession s = home.create(); 89 s.testTransactionQueryTimeoutMarkedRollback(); 90 } 91 92 public void testLazyAutoCommit() throws Exception 93 { 94 JDBCStatementTestsConnectionSessionHome home = 95 (JDBCStatementTestsConnectionSessionHome)getInitialContext().lookup("JDBCStatementTestsConnectionSession"); 96 JDBCStatementTestsConnectionSession s = home.create(); 97 s.testLazyAutoCommit(); 98 } 99 100 } 101 | Popular Tags |