use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class SURijTest method suite.
/**
* Return the suite that runs the script.
*/
public static Test suite() {
BaseTestSuite suite = new BaseTestSuite("SURijTest");
suite.addTest(TestConfiguration.clientServerDecorator(new CleanDatabaseTestSetup(new SURijTest(TESTS[0]))));
suite.addTest(new CleanDatabaseTestSetup(new SURijTest(TESTS[0])));
return suite;
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class SavepointJdbc30Test method suite.
/**
* Set up the test suite for embedded mode, client mode, and embedded mode
* with XADataSources
*
* @return A suite containing embedded, client and embedded with XA suites
*/
public static Test suite() {
BaseTestSuite suite = new BaseTestSuite("SavepointJdbc30_JSR169Test suite");
// Get the tests for embedded
BaseTestSuite embedded = new BaseTestSuite("SavepointJdbc30_JSR169Test:embedded");
embedded.addTestSuite(SavepointJdbc30Test.class);
embedded.addTest(getEmbeddedSuite("SavepointJdbc30_JSR169Test:" + "embedded only"));
suite.addTest(embedded);
// Get the tests for client.
BaseTestSuite client = new BaseTestSuite("SavepointJdbc30_JSR169Test:client");
client.addTestSuite(SavepointJdbc30Test.class);
suite.addTest(TestConfiguration.clientServerDecorator(client));
// under JSR169.
if (JDBC.vmSupportsJDBC3()) {
embedded = new BaseTestSuite("SavepointJdbc30_JSR169Test:embedded XADataSource");
embedded.addTestSuite(SavepointJdbc30Test.class);
embedded.addTest(getEmbeddedSuite("SavepointJdbc30_JSR169Test:" + "embedded only XADataSource"));
suite.addTest(TestConfiguration.connectionXADecorator(embedded));
// Repeat the client tests obtaining a connection from
// an XA data source if it is supported. This is not supported
// under JSR169.
client = new BaseTestSuite("SavepointJdbc30_JSR169Test:client XADatasource");
client.addTestSuite(SavepointJdbc30Test.class);
suite.addTest(TestConfiguration.clientServerDecorator(TestConfiguration.connectionXADecorator(client)));
}
return new CleanDatabaseTestSetup(DatabasePropertyTestSetup.setLockTimeouts(suite, 1, 2)) {
/**
* Creates the database objects used in the test cases.
*
* @throws SQLException
*/
protected void decorateSQL(Statement s) throws SQLException {
/* Create a table */
s.execute("create table t1 (c11 int, c12 smallint)");
s.execute("create table t2 (c11 int)");
getConnection().commit();
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class StatementJdbc30Test method baseSuite.
private static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(name);
suite.addTestSuite(StatementJdbc30Test.class);
if (name.equals(CLIENT_SUITE_NAME)) {
// These test CAN be run in embedded mode as well, but
// they're only meaningful in c/s mode and also take quite
// a bit of time to run.
suite.addTest(new StatementJdbc30Test("xtestMultiExecWithQueryTimeout"));
suite.addTest(new StatementJdbc30Test("xtestMaxOpenStatementsWithQueryTimeout"));
}
return new CleanDatabaseTestSetup(suite) {
/**
* Creates the tables used in the test cases.
*
* @exception SQLException
* if a database error occurs
*/
protected void decorateSQL(Statement stmt) throws SQLException {
/**
* Creates the table used in the test cases.
*/
stmt.execute("create table tab1 (i int, s smallint, r real)");
stmt.executeUpdate("insert into tab1 values(1, 2, 3.1)");
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class ResultSetStreamTest method basesuite.
public static Test basesuite(String name) {
BaseTestSuite suite = new BaseTestSuite(ResultSetStreamTest.class, name);
Test test = new SupportFilesSetup(suite, new String[] { "functionTests/testData/ResultSetStream/littleclob.utf", "functionTests/testData/ResultSetStream/short.utf", "functionTests/testData/ResultSetStream/resultsetStream.gif" });
return new CleanDatabaseTestSetup(test) {
protected void decorateSQL(Statement s) throws SQLException {
s.execute("create table t2 (len int, data LONG VARCHAR FOR BIT DATA)");
s.execute("create table t3(text_data clob)");
s.execute("create table setMaxFieldSize(id int unique, " + "dVarchar VARCHAR(32672), dClob clob)");
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class DataSourcePropertiesTest method suite.
// SETUP
/**
* Creates a test suite with all test cases
* only running in embedded at the moment.
*/
public static Test suite() {
BaseTestSuite suite = new BaseTestSuite("DataSourcePropertiesTest");
// XA support (which is supported in JDBC 2 with extensions).
if (JDBC.vmSupportsJDBC3()) {
// Add all methods starting with 'test'.
// suite.addTestSuite(DataSourcePropertiesTest.class);
Method[] methods = DataSourcePropertiesTest.class.getMethods();
for (int i = 0; i < methods.length; i++) {
Method m = methods[i];
if (m.getParameterTypes().length > 0 || !m.getReturnType().equals(Void.TYPE)) {
continue;
}
String name = m.getName();
if (name.startsWith("embedded")) {
suite.addTest(new DataSourcePropertiesTest(name));
}
}
}
return new CleanDatabaseTestSetup(suite);
}
Aggregations