use of org.apache.derbyTesting.junit.SupportFilesSetup in project derby by apache.
the class SimpleJsonTest method suite.
// /////////////////////////////////////////////////////////////////////////////////
//
// JUnit MACHINERY
//
// /////////////////////////////////////////////////////////////////////////////////
public static Test suite() {
BaseTestSuite suite = new BaseTestSuite("SimpleJsonTest");
suite.addTest(TestConfiguration.defaultSuite(SimpleJsonTest.class));
return new SupportFilesSetup(suite, new String[] { "functionTests/tests/lang/thermostatReadings.dat", "functionTests/tests/lang/json.dat" });
}
use of org.apache.derbyTesting.junit.SupportFilesSetup in project derby by apache.
the class SSLTest method decorateTest.
// Test decoration
/**
* <p>
* Compose the required decorators to bring up the server in the correct
* configuration.
* </p>
*/
private static Test decorateTest(String testName) {
SSLTest sslTest = new SSLTest(testName);
String[] startupProperties = getStartupProperties();
String[] startupArgs = new String[] {};
NetworkServerTestSetup networkServerTestSetup = new NetworkServerTestSetup(sslTest, startupProperties, startupArgs, true);
Test testSetup = SecurityManagerSetup.noSecurityManager(networkServerTestSetup);
testSetup = new SupportFilesSetup(testSetup, null, new String[] { "functionTests/tests/derbynet/SSLTestServerKey.key" }, null, new String[] { "SSLTestServerKey.key" });
Test test = TestConfiguration.defaultServerDecorator(testSetup);
test = TestConfiguration.changeSSLDecorator(test, "basic");
return test;
}
use of org.apache.derbyTesting.junit.SupportFilesSetup in project derby by apache.
the class SecureServerTest method decorateTest.
// /////////////////////////////////////////////////////////////////////////////////
//
// TEST DECORATION
//
// /////////////////////////////////////////////////////////////////////////////////
/**
* <p>
* Compose the required decorators to bring up the server in the correct
* configuration.
* </p>
*/
private static Test decorateTest(boolean unsecureSet, boolean authenticationRequired, String customDerbyProperties, String wildCardHost, Outcome outcome) {
SecureServerTest secureServerTest = new SecureServerTest(unsecureSet, authenticationRequired, customDerbyProperties, wildCardHost, outcome);
String[] startupProperties = getStartupProperties(authenticationRequired, customDerbyProperties);
String[] startupArgs = getStartupArgs(unsecureSet, wildCardHost);
NetworkServerTestSetup networkServerTestSetup = new NetworkServerTestSetup(secureServerTest, startupProperties, startupArgs, secureServerTest._outcome.serverShouldComeUp());
secureServerTest.nsTestSetup = networkServerTestSetup;
Test testSetup = SecurityManagerSetup.noSecurityManager(networkServerTestSetup);
// if using the custom derby.properties, copy the custom properties to a visible place
if (customDerbyProperties != null) {
testSetup = new SupportFilesSetup(testSetup, null, new String[] { "functionTests/tests/derbynet/SecureServerTest.derby.properties" }, null, new String[] { "derby.properties" });
}
Test test = TestConfiguration.defaultServerDecorator(testSetup);
// DERBY-2109: add support for user credentials
test = TestConfiguration.changeUserDecorator(test, SST_USER_NAME, SST_PASSWORD);
return test;
}
use of org.apache.derbyTesting.junit.SupportFilesSetup in project derby by apache.
the class Derby6587Test method baseSuite.
public static Test baseSuite(String name) {
BaseTestSuite suite = new BaseTestSuite(Derby6587Test.class, name);
Test test = new SupportFilesSetup(suite, new String[] { "functionTests/testData/Derby6587/Derby6587_TABLE1_T.csv", "functionTests/testData/Derby6587/Derby6587_TABLE2_T.csv" });
return new CleanDatabaseTestSetup(test) {
protected void decorateSQL(Statement stmt) throws SQLException {
stmt.executeUpdate("CREATE TABLE TABLE1_T " + "(UUID char (16) for bit data NOT NULL," + "NR integer NOT NULL," + "TEXT varchar(200) NOT NULL," + "CONSTRAINT IDX_1 PRIMARY KEY (UUID, NR))");
stmt.executeUpdate("CREATE TABLE TABLE2_T " + "(UUID char (16) for bit data NOT NULL," + "ID1 char(5) NOT NULL," + "ID2 integer NOT NULL," + "NR integer NOT NULL," + "CONSTRAINT IDX_2 PRIMARY KEY (ID1, UUID))");
stmt.executeUpdate("ALTER TABLE TABLE2_T " + "ADD CONSTRAINT FK_1 FOREIGN KEY (UUID, NR) " + "REFERENCES TABLE1_T (UUID, NR) " + "ON DELETE NO ACTION ON UPDATE NO ACTION");
}
};
}
use of org.apache.derbyTesting.junit.SupportFilesSetup in project derby by apache.
the class Changes10_3 method suite.
/**
* Return the suite of tests to test the changes made in 10.3.
* @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 changes for 10.3");
suite.addTestSuite(Changes10_3.class);
// only during the hard(full) upgrade phase.
if (phase == PH_HARD_UPGRADE) {
if (JDBC.vmSupportsJDBC3()) {
// Tests for the Blob related locator StoredProcedures
suite.addTestSuite(BlobStoredProcedureTest.class);
// Tests for the Clob related locator StoredProcedures
suite.addTestSuite(ClobStoredProcedureTest.class);
}
}
return new SupportFilesSetup((Test) suite);
}
Aggregations