use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class CollationTest2 method suite.
public static Test suite() {
// only test in embedded mode, all tests are server side actions.
BaseTestSuite suite = new BaseTestSuite("CollationTest2");
suite.addTest(new CollationTest2("testDefaultCollation"));
suite.addTest(collatedTest("en", "testEnglishCollation"));
suite.addTest(caseInsensitiveCollationSuite());
// Only add tests for other locales if they are in fact supported
// by the jvm.
Locale[] availableLocales = Collator.getAvailableLocales();
boolean norwegian = false;
boolean polish = false;
for (int i = 0; i < availableLocales.length; i++) {
if ("no".equals(availableLocales[i].getLanguage())) {
norwegian = true;
}
if ("pl".equals(availableLocales[i].getLanguage())) {
polish = true;
}
}
if (norwegian) {
suite.addTest(collatedTest("no_NO", "testNorwayCollation"));
}
if (polish) {
suite.addTest(collatedTest("pl", "testPolishCollation"));
}
suite.addTest(collatedTest(null, "testDefaultJVMTerritoryCollation"));
// add support to use external files for import/export calls.
Test test = new SupportFilesSetup(suite);
// turn on log statement text for sequence of statements in derby.log.
if (verbose_debug) {
Properties props = new Properties();
props.setProperty("derby.language.logStatementText", "true");
test = new SystemPropertyTestSetup(test, props);
}
return test;
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class SubqueryTest method suite.
public static Test suite() {
Properties props = new Properties();
props.setProperty("derby.language.statementCacheSize", "0");
return new DatabasePropertyTestSetup(new SystemPropertyTestSetup(new CleanDatabaseTestSetup(new BaseTestSuite(SubqueryTest.class, "SubqueryTest")) {
/**
* @see org.apache.derbyTesting.junit.CleanDatabaseTestSetup#decorateSQL(java.sql.Statement)
*/
protected void decorateSQL(Statement s) throws SQLException {
s.execute("CREATE FUNCTION ConsistencyChecker() " + "RETURNS VARCHAR(128) " + "EXTERNAL NAME " + "'org.apache.derbyTesting.functionTests." + "util.T_ConsistencyChecker.runConsistencyChecker' " + "LANGUAGE JAVA PARAMETER STYLE JAVA");
s.execute("create table s " + "(i int, s smallint, c char(30), " + "vc char(30), b bigint)");
s.execute("create table t " + "(i int, s smallint, c char(30), " + "vc char(30), b bigint)");
s.execute("create table tt " + "(ii int, ss smallint, cc char(30), " + "vcvc char(30), b bigint)");
s.execute("create table ttt " + "(iii int, sss smallint, ccc char(30), " + "vcvcvc char(30))");
// populate the tables
s.execute("insert into s values " + "(null, null, null, null, null)");
s.execute("insert into s values (0, 0, '0', '0', 0)");
s.execute("insert into s values (1, 1, '1', '1', 1)");
s.execute("insert into t values " + "(null, null, null, null, null)");
s.execute("insert into t values (0, 0, '0', '0', 0)");
s.execute("insert into t values (1, 1, '1', '1', 1)");
s.execute("insert into t values (1, 1, '1', '1', 1)");
s.execute("insert into t values (2, 2, '2', '2', 1)");
s.execute("insert into tt values " + "(null, null, null, null, null)");
s.execute("insert into tt values (0, 0, '0', '0', 0)");
s.execute("insert into tt values (1, 1, '1', '1', 1)");
s.execute("insert into tt values (1, 1, '1', '1', 1)");
s.execute("insert into tt values (2, 2, '2', '2', 1)");
s.execute("insert into ttt values (null, null, null, null)");
s.execute("insert into ttt values (11, 11, '11', '11')");
s.execute("insert into ttt values (11, 11, '11', '11')");
s.execute("insert into ttt values (22, 22, '22', '22')");
}
}, props), props, true);
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class SysDiagVTIMappingTest method suite.
public static Test suite() {
BaseTestSuite suite = new BaseTestSuite("Diagnostic VTI Table Mappings");
Test defaultSetup = TestConfiguration.defaultSuite(SysDiagVTIMappingTest.class);
// turn on statement logging so there will be something in the error log
// to run these vtis against
Properties sysprops = new Properties();
sysprops.put("derby.language.logStatementText", "true");
Test verboseTest = new SystemPropertyTestSetup(defaultSetup, sysprops);
suite.addTest(verboseTest);
/* Some of the VTIs that are tested in this class require a derby.log
* file. We have a test log file stored in the tests/lang directory,
* and since the VTIs are going to try to read it, the test log file
* must be in a directory for which Derby has read access. By
* using a SupportFilesSetup wrapper, we copy the test log file to
* the "extin" directory, which has the required permissions.
*/
return SecurityManagerSetup.noSecurityManager(new SupportFilesSetup(suite, new String[] { "functionTests/tests/lang/" + testLogFile }));
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class InterruptResilienceTest method makeSuite.
protected static Test makeSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(name);
Test est = TestConfiguration.embeddedSuite(InterruptResilienceTest.class);
Test cst = TestConfiguration.clientServerSuite(InterruptResilienceTest.class);
est = TestConfiguration.singleUseDatabaseDecorator(est);
cst = TestConfiguration.singleUseDatabaseDecorator(cst);
// Cut down on running time:
Properties p = new Properties();
p.put("derby.system.durability", "test");
p.put("derby.infolog.append", "true");
// we'll force interrupts and thus serious errors, which with
// ibm jvms would result in javacore files, which aren't of
// interest if the test passes. Setting the stream error level
// so we don't get those javacores.
p.put("derby.stream.error.extendedDiagSeverityLevel", "50000");
suite.addTest(new SystemPropertyTestSetup(est, p, true));
suite.addTest(new SystemPropertyTestSetup(cst, p, true));
return suite;
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class StoreScriptsTest method suite.
public static Test suite() {
Properties props = new Properties();
props.setProperty("derby.infolog.append", "true");
props.setProperty("ij.protocol", "jdbc:derby:");
props.setProperty("ij.database", "wombat;create=true");
Test test = new SystemPropertyTestSetup(getSuite(EMBEDDED_TESTS), props);
// Lock timeout settings that were set for the old harness store tests
test = DatabasePropertyTestSetup.setLockTimeouts(test, 1, 4);
BaseTestSuite suite = new BaseTestSuite("StoreScripts");
suite.addTest(test);
return getIJConfig(suite);
}
Aggregations