use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class MultiByteClobTest method baseSuite.
/**
* Base suite of tests that will run in both embedded and client.
*
* @param name name for the suite.
*/
private static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(name);
suite.addTestSuite(MultiByteClobTest.class);
return new CleanDatabaseTestSetup(DatabasePropertyTestSetup.setLockTimeouts(suite, 2, 4)) {
/**
* Creates the tables used in the test cases.
*
* @exception java.sql.SQLException
* if a database error occurs
*/
protected void decorateSQL(Statement stmt) throws SQLException {
stmt.execute("CREATE TABLE MB_CLOBTABLE " + "(K INT CONSTRAINT PK PRIMARY KEY, C CLOB(" + LONG_CLOB_LENGTH + "))");
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class TriggerTests method suite.
public static Test suite() {
Test suite = new CleanDatabaseTestSetup(TestConfiguration.embeddedSuite(TriggerTests.class));
Properties p = new Properties();
// use small pageCacheSize so we don't run out of memory on the insert
// of large LOB columns.
p.setProperty("derby.storage.pageCacheSize", "100");
return new SystemPropertyTestSetup(suite, p);
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class ij3Test method suite.
public static Test suite() {
Properties props = new Properties();
props.setProperty("ij.database", "jdbc:derby:wombat;create=true");
props.setProperty("ij.showNoConnectionsAtStart", "true");
props.setProperty("ij.showNoCountForSelect", "true");
Test test = new SystemPropertyTestSetup(new ij3Test("ij3"), props);
test = new CleanDatabaseTestSetup(test);
return getIJConfig(test);
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class HarnessJavaTest method decorate.
/**
* Decorate a HarnessJavaTest test. Any sub-class must
* call this decorator when adding a test to a suite.
* This sets up the ij system properties to setup
* the default connection to be to the default database.
* The lock timeouts are also shortened and the test
* will start in a clean database.
*/
protected static Test decorate(HarnessJavaTest test) {
Test dtest = new SystemPropertyTestSetup(test, new Properties()) {
protected void setUp() throws java.lang.Exception {
TestConfiguration config = TestConfiguration.getCurrent();
// With JDBC 3 connect using a JDBC URL
if (JDBC.vmSupportsJDBC3()) {
newValues.setProperty("ij.database", config.getJDBCUrl());
}
super.setUp();
}
};
dtest = DatabasePropertyTestSetup.setLockTimeouts(dtest, 4, 6);
dtest = new CleanDatabaseTestSetup(dtest);
return dtest;
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class BatchUpdateTest method baseSuite.
protected static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(name);
suite.addTestSuite(BatchUpdateTest.class);
return new CleanDatabaseTestSetup(DatabasePropertyTestSetup.setLockTimeouts(suite, 2, 4)) {
/**
* Creates the tables used in the test cases.
* @exception SQLException if a database error occurs
*/
protected void decorateSQL(Statement stmt) throws SQLException {
stmt.execute("create table t1(c1 int)");
// for fixture testCallableStatementBatch
stmt.execute("create table datetab(c1 date)");
stmt.execute("create table timetab(c1 time)");
stmt.execute("create table timestamptab(c1 timestamp)");
stmt.execute("create table usertypetab(c1 DATE)");
// for fixture testAssociatedParams
stmt.execute("create table assoc" + "(x char(10) not null primary key, y char(100))");
stmt.execute("create table assocout(x char(10))");
}
};
}
Aggregations