use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class PreparedStatementTest method statementCachingSuite.
/**
* Returns a suite for tests that need JDBC statement caching to be enabled.
*/
private static Test statementCachingSuite() {
BaseTestSuite suite = new BaseTestSuite("JDBC statement caching suite");
suite.addTest(new PreparedStatementTest("cpTestIsPoolableHintFalse"));
suite.addTest(new PreparedStatementTest("cpTestIsPoolableHintTrue"));
return TestConfiguration.connectionCPDecorator(new CleanDatabaseTestSetup(suite) {
protected void decorateSQL(Statement stmt) throws SQLException {
stmt.execute("create table " + BLOBTBL + " (sno int, dBlob BLOB(1M))");
stmt.execute("create table " + CLOBTBL + " (sno int, dClob CLOB(1M))");
stmt.execute("create table " + LONGVARCHAR + " (sno int, dLongVarchar LONG VARCHAR)");
}
});
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class PreparedStatementTest method baseSuite.
private static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(name);
suite.addTestSuite(PreparedStatementTest.class);
return new CleanDatabaseTestSetup(suite) {
protected void decorateSQL(Statement stmt) throws SQLException {
stmt.execute("create table " + BLOBTBL + " (sno int, dBlob BLOB(1M))");
stmt.execute("create table " + CLOBTBL + " (sno int, dClob CLOB(1M))");
stmt.execute("create table " + LONGVARCHAR + " (sno int, dLongVarchar LONG VARCHAR)");
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class AutoGenJDBC30Test method baseSuite.
/**
* Tests are only run if JDBC 3.0 available, and database objects get
* created only once for the suite run.
*
* @param name name of the test
*/
private static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(name);
if (!JDBC.vmSupportsJDBC3()) {
// empty suite
return suite;
}
suite.addTestSuite(AutoGenJDBC30Test.class);
// Create database objects only once for entire test run
return new CleanDatabaseTestSetup(suite) {
/**
* Creates the database objects used in the test cases.
* @throws SQLException
*/
protected void decorateSQL(Statement s) throws SQLException {
for (int i = 0; i < ROUTINES.length; i++) {
s.execute(ROUTINES[i]);
}
for (int i = 0; i < TABLES.length; i++) {
s.execute(TABLES[i][1]);
}
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class TestDbMetaData method baseSuite.
private static Test baseSuite(String name) {
BaseTestSuite testSuite = new BaseTestSuite(name);
testSuite.addTestSuite(TestDbMetaData.class);
return new CleanDatabaseTestSetup(testSuite) {
protected void decorateSQL(Statement s) throws SQLException {
createFunctions(s);
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class DataSourceTest method suite.
/**
* Return suite with all tests of the class.
*/
public static Test suite() {
// Use explicit ordering of fixtures until fix of DERBY-5988
BaseTestSuite s = new BaseTestSuite("datasourcetestsuite-embedded");
s.addTest(new DataSourceTest("testIsNotWrapperForPoolDataSource"));
s.addTest(new DataSourceTest("testIsNotWrapperForXADataSource"));
s.addTest(new DataSourceTest("testUnwrapConnectionPoolDataSource"));
s.addTest(new DataSourceTest("testIsWrapperForDataSource"));
s.addTest(new DataSourceTest("testIsNotWrapperForResultSet"));
s.addTest(new DataSourceTest("testUnwrapXADataSource"));
s.addTest(new DataSourceTest("testConnectionErrorEvent"));
s.addTest(new DataSourceTest("testUnwrapResultSet"));
s.addTest(new DataSourceTest("testUnwrapDataSource"));
s.addTest(new DataSourceTest("test_jdbc4_1"));
BaseTestSuite ns = new BaseTestSuite("datasourcetestsuite-net");
ns.addTest(new DataSourceTest("testIsNotWrapperForPoolDataSource"));
ns.addTest(new DataSourceTest("testIsNotWrapperForXADataSource"));
ns.addTest(new DataSourceTest("testUnwrapConnectionPoolDataSource"));
ns.addTest(new DataSourceTest("testIsWrapperForDataSource"));
ns.addTest(new DataSourceTest("testIsNotWrapperForResultSet"));
ns.addTest(new DataSourceTest("testUnwrapXADataSource"));
ns.addTest(new DataSourceTest("testConnectionErrorEvent"));
ns.addTest(new DataSourceTest("testUnwrapResultSet"));
ns.addTest(new DataSourceTest("testUnwrapDataSource"));
ns.addTest(new DataSourceTest("test_jdbc4_1"));
BaseTestSuite totalsuite = new BaseTestSuite("datasourcetest");
totalsuite.addTest(new CleanDatabaseTestSetup(s));
totalsuite.addTest(TestConfiguration.clientServerDecorator(new CleanDatabaseTestSetup(ns)));
return totalsuite;
}
Aggregations