use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class SysinfoLocaleTest method createTest.
/**
* Create a single test case.
*
* @param loc default locale for the test case
* @param ui <code>derby.ui.locale</code> for the test case
* @param german whether output is expected to be German
*/
private static Test createTest(Locale loc, String ui, boolean german) {
Properties prop = new Properties();
if (ui != null) {
prop.setProperty("derby.ui.locale", ui);
}
// always set the encoding so that we can reliably read the output
prop.setProperty("derby.ui.codeset", ENCODING);
String info = "defaultLocale=" + loc + ",uiLocale=" + ui;
Test test = new SysinfoLocaleTest(loc, german, info);
return new SystemPropertyTestSetup(test, prop);
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class st_derby1939 method suite.
public static Test suite() {
Properties sysprops = new Properties();
sysprops.setProperty("derby.language.maxMemoryPerTable", "140");
sysprops.setProperty("derby.optimizer.noTimeout", "true");
return new SystemPropertyTestSetup(new CleanDatabaseTestSetup(TestConfiguration.embeddedSuite(st_derby1939.class)), sysprops, true);
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class LoginTimeoutTest method suite.
// /////////////////////////////////////////////////////////////////////////////////
//
// JUnit MACHINERY
//
// /////////////////////////////////////////////////////////////////////////////////
/**
* Return suite with all tests of the class.
*/
public static Test suite() {
BaseTestSuite suite = new BaseTestSuite();
Test embedded = new BaseTestSuite(LoginTimeoutTest.class, "embedded LoginTimeoutTest");
embedded = TestConfiguration.singleUseDatabaseDecorator(embedded);
embedded = new SystemPropertyTestSetup(embedded, systemProperties());
suite.addTest(embedded);
if (Derby.hasServer() && Derby.hasClient()) {
Test clientServer = new BaseTestSuite(LoginTimeoutTest.class, "client/server LoginTimeoutTest");
clientServer = TestConfiguration.singleUseDatabaseDecorator(clientServer);
clientServer = new JDBCClientSetup(clientServer, JDBCClient.DERBYNETCLIENT);
clientServer = new NetworkServerTestSetup(clientServer, systemPropertiesArray(), new String[] {}, true);
suite.addTest(clientServer);
}
return suite;
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class DistinctTest method suite.
public static Test suite() {
Test s = new BaseTestSuite(DistinctTest.class);
Properties p = new Properties();
p.put("derby.optimizer.noTimeout", "true");
Test t = new SystemPropertyTestSetup(s, p);
return new CleanDatabaseTestSetup(t) {
protected void decorateSQL(Statement s) throws SQLException {
s.execute("create table t (i int, s smallint, r real, f float, d date, t time, ts timestamp, c char(10), v varchar(20))");
// for tests from distinctElimination
s.execute("create table one(c1 int, c2 int, c3 int, c4 int, c5 int)");
s.execute("create unique index one_c1 on one(c1)");
s.execute("create table two(c1 int, c2 int, c3 int, c4 int, c5 int)");
s.execute("create unique index two_c1c3 on two(c1, c3)");
s.execute("create table three(c1 int, c2 int, c3 int, c4 int, c5 int)");
s.execute("create unique index three_c1 on three(c1)");
s.execute("create table four(c1 int, c2 int, c3 int, c4 int, c5 int)");
s.execute("create unique index four_c1c3 on four(c1, c3)");
s.execute("CREATE TABLE \"APP\".\"IDEPT\" (\"DISCRIM_DEPT\" VARCHAR(32), \"NO1\" INTEGER NOT NULL, " + "\"NAME\" VARCHAR(50), \"AUDITOR_NO\" INTEGER, \"REPORTTO_NO\" INTEGER, \"HARDWAREASSET\"" + " VARCHAR(15), \"SOFTWAREASSET\" VARCHAR(15))");
s.execute("ALTER TABLE \"APP\".\"IDEPT\" ADD CONSTRAINT \"PK_IDEPT\" PRIMARY KEY (\"NO1\")");
s.execute("insert into one values (1, 1, 1, 1, 1)");
s.execute("insert into one values (2, 1, 1, 1, 1)");
s.execute("insert into one values (3, 1, 1, 1, 1)");
s.execute("insert into one values (4, 1, 1, 1, 1)");
s.execute("insert into one values (5, 1, 1, 1, 1)");
s.execute("insert into one values (6, 1, 1, 1, 1)");
s.execute("insert into one values (7, 1, 1, 1, 1)");
s.execute("insert into one values (8, 1, 1, 1, 1)");
s.execute("insert into two values (1, 1, 1, 1, 1)");
s.execute("insert into two values (1, 1, 2, 1, 1)");
s.execute("insert into two values (1, 1, 3, 1, 1)");
s.execute("insert into two values (2, 1, 1, 1, 1)");
s.execute("insert into two values (2, 1, 2, 1, 1)");
s.execute("insert into two values (2, 1, 3, 1, 1)");
s.execute("insert into two values (3, 1, 1, 1, 1)");
s.execute("insert into two values (3, 1, 2, 1, 1)");
s.execute("insert into two values (3, 1, 3, 1, 1)");
s.execute("insert into three values (1, 1, 1, 1, 1)");
s.execute("insert into three values (2, 1, 1, 1, 1)");
s.execute("insert into three values (3, 1, 1, 1, 1)");
s.execute("insert into three values (4, 1, 1, 1, 1)");
s.execute("insert into three values (5, 1, 1, 1, 1)");
s.execute("insert into three values (6, 1, 1, 1, 1)");
s.execute("insert into three values (7, 1, 1, 1, 1)");
s.execute("insert into three values (8, 1, 1, 1, 1)");
s.execute("insert into four values (1, 1, 1, 1, 1)");
s.execute("insert into four values (1, 1, 2, 1, 1)");
s.execute("insert into four values (1, 1, 3, 1, 1)");
s.execute("insert into four values (2, 1, 1, 1, 1)");
s.execute("insert into four values (2, 1, 2, 1, 1)");
s.execute("insert into four values (2, 1, 3, 1, 1)");
s.execute("insert into four values (3, 1, 1, 1, 1)");
s.execute("insert into four values (3, 1, 2, 1, 1)");
s.execute("insert into four values (3, 1, 3, 1, 1)");
s.execute("insert into idept values ('Dept', 1, 'Department1', null, null, null, null)");
s.execute("insert into idept values ('HardwareDept', 2, 'Department2', 25, 1, 'hardwareaset2', null)");
s.execute("insert into idept values ('HardwareDept', 3, 'Department3', 25, 2, 'hardwareaset3', null)");
s.execute("insert into idept values ('SoftwareDept', 4, 'Department4', 25, 1, null, 'softwareasset4')");
s.execute("insert into idept values ('SoftwareDept', 5, 'Department5', 30, 4, null, 'softwareasset5')");
}
};
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class MultiByteClobTest method suite.
/**
* Runs the test fixtures in embedded and client.
*
* @return test suite
*/
public static Test suite() {
BaseTestSuite suite = new BaseTestSuite("MultiByteClobTest");
suite.addTest(baseSuite("MultiByteClobTest:embedded"));
suite.addTest(TestConfiguration.clientServerDecorator(baseSuite("MultiByteClobTest:client")));
Properties p = new Properties();
// use small pageCacheSize so we don't run out of memory on the insert.
p.setProperty("derby.storage.pageCacheSize", "100");
return new SystemPropertyTestSetup(suite, p);
}
Aggregations