use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class OLAPTest method makeSuite.
public static Test makeSuite() {
Test clean = new CleanDatabaseTestSetup(new BaseTestSuite(OLAPTest.class)) {
protected void decorateSQL(Statement s) throws SQLException {
getConnection().setAutoCommit(false);
s.executeUpdate("create table t1 (a int, b int)");
s.executeUpdate("create table t2 (x int)");
s.executeUpdate("create table t3 (y int)");
s.executeUpdate("create table t4 (a int, b int)");
s.executeUpdate("create table t5 (a int, b int)");
s.executeUpdate("insert into t1 values (10,100),(20,200)," + " (30,300),(40,400)," + " (50,500)");
s.executeUpdate("insert into t2 values (1),(2),(3),(4),(5)");
s.executeUpdate("insert into t3 values (4),(5),(6),(7),(8)");
s.executeUpdate("insert into t4 values (10,100),(20,200)");
s.executeUpdate("insert into t5 values (1,1),(2,4),(3,4),(4,4),(5,9)");
getConnection().commit();
}
};
return clean;
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class OrderByAndOffsetFetchInSubqueries method makeSuite.
/**
* Construct suite of tests
*
* @return A suite containing the test cases.
*/
private static Test makeSuite() {
return new CleanDatabaseTestSetup(new BaseTestSuite(OrderByAndOffsetFetchInSubqueries.class)) {
@Override
protected void decorateSQL(Statement s) throws SQLException {
getConnection().setAutoCommit(false);
s.execute("create table temp1(s varchar(10))");
// GENERATED ALWAYS AS IDENTITY
s.execute("create table temp2(" + "i integer not null " + " generated always as identity," + "s varchar(10))");
s.execute("create table temp2b(" + "i integer not null " + " generated always as identity," + "s varchar(10))");
// DEFAULT value
s.execute("create table temp3(" + "i integer not null " + " generated always as identity," + "s varchar(10)," + "j integer not null " + " default 66," + "t varchar(10))");
// GENERATED ALWAYS AS (expression)
s.execute("create table temp4(" + "i integer not null " + " generated always as identity," + "s varchar(10)," + "j integer not null " + " generated always as (2*i)," + "t varchar(10))");
s.execute("create table t01(c1 int)");
s.execute("create table t02(c2 int)");
s.execute("create table t_source(c1 int, c2 varchar(10))");
s.execute("create table t(i int not null, " + " constraint c unique (i), " + " j int, k int)");
getConnection().commit();
}
};
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class AutomaticIndexStatisticsTest method suite.
public static Test suite() {
Test test = new BaseTestSuite(AutomaticIndexStatisticsTest.class);
test = new CleanDatabaseTestSetup(test);
test = TestConfiguration.additionalDatabaseDecorator(test, MASTERDB);
// TimeZoneTestSetup can probably be removed once DERBY-5974 is fixed.
return new TimeZoneTestSetup(test, "GMT");
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class ClassLoaderBootTest method suite.
/**
* Runs the tests in the default embedded configuration and then
* the client server configuration.
*/
public static Test suite() {
BaseTestSuite suite = new BaseTestSuite(ClassLoaderBootTest.class);
Test test = suite;
TestSetup setup = new CleanDatabaseTestSetup(test) {
protected void setUp() throws Exception {
super.setUp();
// shutdown the database.
DataSource ds = JDBCDataSource.getDataSource();
JDBCDataSource.shutdownDatabase(ds);
}
};
Properties p = new Properties();
p.setProperty("derby.infolog.append", "true");
setup = new SystemPropertyTestSetup(setup, p);
// on. Have to run without security manager for now.
return SecurityManagerSetup.noSecurityManager(setup);
// return setup;
}
use of org.apache.derbyTesting.junit.CleanDatabaseTestSetup in project derby by apache.
the class Derby4577Test method baseSuite.
protected static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(name);
suite.addTestSuite(Derby4577Test.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 {
Connection conn = stmt.getConnection();
// create a table, with blob it will be 32k page size
stmt.executeUpdate("CREATE TABLE testBadUpdate (id int, value blob(1M))");
stmt.executeUpdate("CREATE TABLE testSmallRow1 (id char(1))");
stmt.executeUpdate("CREATE TABLE testSmallRow2 (id char(1))");
stmt.executeUpdate("CREATE TABLE testSmallRow3 (id char(20), id2 int)");
conn.setAutoCommit(false);
}
};
}
Aggregations