use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class ReleaseCompileLocksTest method baseSuite.
protected static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(name);
suite.addTestSuite(ReleaseCompileLocksTest.class);
return new CleanDatabaseTestSetup(suite) {
protected void decorateSQL(Statement s) throws SQLException {
s.execute("create table t1 (s int)");
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class RestrictedVTITest method suite.
// /////////////////////////////////////////////////////////////////////////////////
//
// JUnit BEHAVIOR
//
// /////////////////////////////////////////////////////////////////////////////////
/**
* Construct top level suite in this JUnit test
*/
public static Test suite() {
BaseTestSuite suite = (BaseTestSuite) TestConfiguration.embeddedSuite(RestrictedVTITest.class);
Test result = new CleanDatabaseTestSetup(suite);
return result;
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class SpillHashTest method suite.
/**
* Returns the implemented tests.
*
* @return An instance of <code>Test</code> with the implemented tests to
* run.
*/
public static Test suite() {
// suite of tests with light load on the tables
BaseTestSuite light = new BaseTestSuite();
// suite of tests with heavy load on the tables
BaseTestSuite heavy = new BaseTestSuite();
light.addTest(new SpillHashTest("testJoinLight"));
light.addTest(new SpillHashTest("testDistinctLight"));
light.addTest(new SpillHashTest("testCursorLight"));
heavy.addTest(new SpillHashTest("testJoinHeavy"));
heavy.addTest(new SpillHashTest("testDistinctHeavy"));
heavy.addTest(new SpillHashTest("testCursorHeavy"));
Test lightSetup = new BaseJDBCTestSetup(light) {
protected void setUp() throws Exception {
super.setUp();
Statement stmt = getConnection().createStatement();
PreparedStatement insA = stmt.getConnection().prepareStatement("insert into ta(ca1,ca2) values(?,?)");
PreparedStatement insB = stmt.getConnection().prepareStatement("insert into tb(cb1,cb2) values(?,?)");
insertDups(insA, insB, initDupVals);
getConnection().commit();
stmt.close();
// System.out.println("2");
}
};
Test heavySetup = new BaseJDBCTestSetup(heavy) {
protected void setUp() throws Exception {
super.setUp();
Statement stmt = getConnection().createStatement();
PreparedStatement insA = stmt.getConnection().prepareStatement("insert into ta(ca1,ca2) values(?,?)");
PreparedStatement insB = stmt.getConnection().prepareStatement("insert into tb(cb1,cb2) values(?,?)");
for (int i = 1; i <= LOTS_OF_ROWS; i++) {
insA.setInt(1, i);
insA.setString(2, ca2Val(i));
insA.executeUpdate();
insB.setInt(1, i);
insB.setString(2, cb2Val(i));
insB.executeUpdate();
if ((i & 0xff) == 0)
stmt.getConnection().commit();
}
insertDups(insA, insB, spillDupVals);
getConnection().commit();
stmt.close();
// System.out.println("3");
}
};
BaseTestSuite mainSuite = new BaseTestSuite();
mainSuite.addTest(lightSetup);
mainSuite.addTest(heavySetup);
return new CleanDatabaseTestSetup(mainSuite) {
protected void decorateSQL(Statement stmt) throws SQLException {
for (int i = 0; i < prep.length; i++) {
stmt.executeUpdate(prep[i]);
}
// System.out.println("1");
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class StalePlansTest method suite.
/**
* Create the test suite. This test is not run in client/server mode since
* it only tests the query plans generated by the embedded driver.
*/
public static Test suite() {
Properties props = new Properties();
// Check for stale plans on every 10th execution (default 100) to
// reduce the number of times we need to execute each statement.
props.setProperty("derby.language.stalePlanCheckInterval", String.valueOf(STALE_PLAN_CHECK_INTERVAL));
// Disable the index statistics daemon so that it doesn't cause
// recompilation of statements at random times.
props.setProperty("derby.storage.indexStats.auto", "false");
Test suite = new DatabasePropertyTestSetup(new BaseTestSuite(StalePlansTest.class), props, true);
return new CleanDatabaseTestSetup(suite);
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class StatementPlanCacheTest method suite.
/**
* Runs in embedded only since it's testing the server side cache.
*/
public static Test suite() {
BaseTestSuite suite = new BaseTestSuite("StatementPlanCacheTest");
// default cache size
CACHE_SIZE = 100;
suite.addTest(baseSuite("default"));
suite.addTest(suiteWithSizeSet(5));
suite.addTest(suiteWithSizeSet(140));
// no caching
suite.addTest(DatabasePropertyTestSetup.singleProperty(new StatementPlanCacheTest("noCachingTest"), "derby.language.statementCacheSize", "0", true));
return new CleanDatabaseTestSetup(suite);
}
Aggregations