use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class JoinDeadlockTest method suite.
public static Test suite() {
final Properties systemProperties = new Properties();
systemProperties.setProperty("derby.locks.waitTimeout", "7");
systemProperties.setProperty("derby.locks.deadlockTimeout", "5");
return new SystemPropertyTestSetup(TestConfiguration.defaultSuite(JoinDeadlockTest.class), systemProperties, true);
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class BootLockTest method decorateTest.
/**
* Decorate test with singleUseDatabaseDecorator and noSecurityManager.
*
* @return the decorated test
*/
private static Test decorateTest() {
Test test = new BaseTestSuite(BootLockTest.class);
if (JDBC.vmSupportsJSR169() && !isJ9Platform()) {
// PhoneME requires forceDatabaseLock
Properties props = new Properties();
props.setProperty("derby.database.forceDatabaseLock", "true");
test = new SystemPropertyTestSetup(test, props, true);
}
test = TestConfiguration.singleUseDatabaseDecorator(test, dbName);
test = SecurityManagerSetup.noSecurityManager(test);
return test;
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup 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.SystemPropertyTestSetup in project derby by apache.
the class Derby3980DeadlockTest method decorateTest.
/**
* Decorate a test with SecurityManagerSetup, clientServersuite, and
* SupportFilesSetup.
*
* @return the decorated test
*/
private static Test decorateTest() {
Test test = TestConfiguration.clientServerSuite(Derby3980DeadlockTest.class);
Properties diagProperties = new Properties();
diagProperties.setProperty("derby.stream.error.extendedDiagSeverityLevel", "30000");
diagProperties.setProperty("derby.infolog.append", "true");
test = new SystemPropertyTestSetup(test, diagProperties, true);
// Install a security manager using the initial policy file.
return new SecurityManagerSetup(test, POLICY_FILE_NAME);
}
use of org.apache.derbyTesting.junit.SystemPropertyTestSetup in project derby by apache.
the class StressMultiTest method suite.
/**
* Set up the testsuite to run in embedded, client and encryption mode.
* Default run is 10 threads for 10 minutes in each mode
*/
public static Test suite() {
Properties dbprops = new Properties();
dbprops.put("derby.locks.deadlockTimeout", "2");
dbprops.put("derby.locks.waitTimeout", "3");
Properties sysprops = new Properties();
sysprops.put("derby.storage.keepTransactionLog", "true");
sysprops.put("derby.language.logStatementText", "true");
sysprops.put("derby.infolog.append", "true");
Test embedded = new BaseTestSuite(StressMultiTest.class);
embedded = new SystemPropertyTestSetup(embedded, sysprops, true);
embedded = new DatabasePropertyTestSetup(embedded, dbprops);
// make this a singleUseDatabase so the datbase and
// transaction log will be preserved.
embedded = TestConfiguration.singleUseDatabaseDecorator(newCleanDatabase(embedded));
// SystemPropertyTestSetup for static properties
// does not work for client because shutting down the
// engine causes protocol errors on the client. Run
// with -Dderby.storage.keepTransactionLog=true if
// you need to save the transaction log for client.
Test client = TestConfiguration.clientServerDecorator(new BaseTestSuite(StressMultiTest.class));
client = newCleanDatabase(new DatabasePropertyTestSetup(client, dbprops));
Test encrypted = new BaseTestSuite(StressMultiTest.class);
// SystemPropertyTestSetup for static properties
// does not work for encrypted databases because the
// database has to be rebooted and we don't have access
// to the boot password (local to Decorator.encryptedDatabase()
// Run with -Dderby.storage.keepTransactionLog=true if you
// need to save the transaction log for encrypted.
BaseTestSuite unencrypted = new BaseTestSuite("StressMultiTest:unencrypted");
unencrypted.addTest((embedded));
unencrypted.addTest((client));
BaseTestSuite suite = new BaseTestSuite("StressMultiTest, " + THREADS + " Threads " + MINUTES + " Minutes");
suite.addTest(newCleanDatabase(unencrypted));
// Encrypted uses a different database so it needs its own newCleanDatabase
suite.addTest(Decorator.encryptedDatabase(new DatabasePropertyTestSetup(newCleanDatabase(encrypted), dbprops)));
return suite;
}
Aggregations