use of org.apache.derbyTesting.junit.SupportFilesSetup in project derby by apache.
the class Changes10_5 method suite.
/**
* Return the suite of tests to test the changes made in 10.5.
* @param phase an integer that indicates the current phase in
* the upgrade test.
* @return the test suite created.
*/
public static Test suite(int phase) {
BaseTestSuite suite = new BaseTestSuite("Upgrade test for 10.5");
suite.addTestSuite(Changes10_5.class);
return new SupportFilesSetup((Test) suite);
}
use of org.apache.derbyTesting.junit.SupportFilesSetup in project derby by apache.
the class MissingPermissionsTest method suite.
public static Test suite() {
inSubProcess = Boolean.getBoolean("inSubProcess");
final BaseTestSuite suite = new BaseTestSuite("SystemPrivilegesPermissionTest");
if (!inSubProcess && !TestConfiguration.loadingFromJars()) {
// level
return suite;
}
if (!inSubProcess) {
suite.addTest(new SupportFilesSetup(makeTest("testMissingFilePermission", POLICY_MINUS_FILEPERMISSION_T), new String[] { POLICY_MINUS_FILEPERMISSION_R }));
suite.addTest(makeTest("testPresentPropertiesPermission", OK_POLICY_T));
suite.addTest(makeTest("testMissingPropertiesPermission", POLICY_MINUS_PROPERTYPERMISSION_T));
}
// This test runs in both the top process and a subprocess since it has
// two parts:
suite.addTest(new SupportFilesSetup(makeTest("testModifyThreadGroup", OK_POLICY_T), new String[] { OK_POLICY_R }));
return suite;
}
use of org.apache.derbyTesting.junit.SupportFilesSetup in project derby by apache.
the class ConnectionMethodsTest method baseSuite.
public static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(ConnectionMethodsTest.class, name);
Test test = new SupportFilesSetup(suite, new String[] { "functionTests/testData/ConnectionMethods/short.txt" });
return new CleanDatabaseTestSetup(test) {
protected void decorateSQL(Statement s) throws SQLException {
s.execute("create table clobtable2(n int,clobcol CLOB)");
s.execute("create table blobtable2(n int,blobcol BLOB)");
s.execute("create table abort_table(a int)");
s.execute("create schema foo");
s.execute("create table foo.set_schema_table( a int )");
}
};
}
use of org.apache.derbyTesting.junit.SupportFilesSetup in project derby by apache.
the class UrlLocaleTest method suite.
public static Test suite() {
BaseTestSuite suite = new BaseTestSuite();
suite.addTestSuite(UrlLocaleTest.class);
suite.addTest(new LocaleTestSetup(new UrlLocaleTest("messageLocale_unknown"), new Locale("rr", "TT")));
suite.addTest(new LocaleTestSetup(new UrlLocaleTest("messageLocale_Germany"), Locale.GERMANY));
Test tsuite = new CleanDatabaseTestSetup(suite) {
/**
* Creates the table used in the test cases.
*/
protected void decorateSQL(Statement s) throws SQLException {
createLocaleProcedures(s.getConnection());
}
};
tsuite = new SupportFilesSetup(tsuite);
return tsuite;
}
use of org.apache.derbyTesting.junit.SupportFilesSetup in project derby by apache.
the class NativeAuthenticationServiceTest method decorate.
/**
* <p>
* Wrap base test with standard decorators in order to setup system
* properties and allow for the creation of multiple databases with
* stored properties that can't be removed at tearDown time.
* </p>
*/
private Test decorate(boolean clientServer) throws Exception {
String credentialsDBPhysicalName = TestConfiguration.generateUniqueDatabaseName();
Test result = this;
//
if (clientServer) {
result = TestConfiguration.clientServerDecorator(result);
}
//
// Turn on the property which enables NATIVE authentication. This will trigger
// an engine shutdown at the end of the test. We want to shutdown the engine
// before deleting the physical databases. This is because we need one of the
// databases (the credentials db) in order to authenticate engine shutdown.
//
Properties systemProperties = null;
try {
systemProperties = systemProperties(credentialsDBPhysicalName);
} catch (Exception e) {
printStackTrace(e);
}
println(nameOfTest());
println(" NativeAuthenticationServiceTest.decorate() systemProperties = " + systemProperties);
result = new SystemPropertyTestSetup(result, systemProperties, true);
//
if (enableSubprotocolTests()) {
// Add a jar file to the classpath so that we can test the classpath subprotocol.
URL nast2Jar = SupportFilesSetup.getReadOnlyURL(NAST2_JAR_FILE);
result = new ClasspathSetup(result, nast2Jar);
// Add the jar files needed for testing jar and classpath subprotocols.
result = new SupportFilesSetup(result, SUPPORT_FILES_SOURCE, null, SUPPORT_FILES_TARGET, null);
}
//
// Register temporary databases, where the test will do its work.
// We can't use the default, re-usable database because NATIVE authentication stores
// persistent properties which cannot be turned off.
//
result = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, CREDENTIALS_DB, credentialsDBPhysicalName);
result = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, SECOND_DB);
result = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, THIRD_DB);
result = _fourthDBSetup = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, FOURTH_DB, true);
result = _fifthDBSetup = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, FIFTH_DB, true);
result = _sixthDBSetup = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, SIXTH_DB, true);
result = _seventhDBSetup = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, SEVENTH_DB, true);
result = _eighthDBSetup = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, EIGHTH_DB, true);
result = _ninthDBSetup = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, NINTH_DB, true);
result = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, TENTH_DB);
result = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, ELEVENTH_DB);
result = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, TWELTH_DB);
result = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, THIRTEENTH_DB);
result = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, FOURTEENTH_DB);
result = _fifteenthDBSetup = TestConfiguration.additionalDatabaseDecoratorNoShutdown(result, FIFTEENTH_DB, true);
result = TestConfiguration.changeUserDecorator(result, DBO, getPassword(DBO));
return result;
}
Aggregations