Search in sources :

Example 76 with BaseTestSuite

use of org.apache.derbyTesting.junit.BaseTestSuite in project derby by apache.

the class ReplicationRun_Local_3_p3 method suite.

public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("ReplicationRun_Local_3_p3 Suite");
    suite.addTestSuite(ReplicationRun_Local_3_p3.class);
    return SecurityManagerSetup.noSecurityManager(suite);
}
Also used : BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 77 with BaseTestSuite

use of org.apache.derbyTesting.junit.BaseTestSuite in project derby by apache.

the class DestroySlaveDB method suite.

public static Test suite() throws Exception {
    System.out.println("**** DestroySlaveDB.suite()");
    System.out.println("'DestroySlaveDB' can not be run outside the 'ReplicationRun' framework.");
    BaseTestSuite suite = new BaseTestSuite("DestroySlaveDB");
    String masterHostName = System.getProperty("test.serverHost", "localhost");
    int masterPortNo = Integer.parseInt(System.getProperty("test.serverPort", "1527"));
    repRun.initEnvironment();
    slaveServerHost = ReplicationRun.slaveServerHost;
    suite.addTest(DestroySlaveDB.suite(masterHostName, masterPortNo));
    return (Test) suite;
}
Also used : Test(junit.framework.Test) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 78 with BaseTestSuite

use of org.apache.derbyTesting.junit.BaseTestSuite in project derby by apache.

the class ReplicationRun_CleanUp method suite.

public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("ReplicationRun_CleanUp");
    suite.addTestSuite(ReplicationRun_CleanUp.class);
    return SecurityManagerSetup.noSecurityManager(suite);
}
Also used : BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 79 with BaseTestSuite

use of org.apache.derbyTesting.junit.BaseTestSuite in project derby by apache.

the class _Suite method suite.

public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("In-memory db test suite");
    // Tests are not yet compatible with JSR169 / JavaME
    if (!JDBC.vmSupportsJSR169()) {
        suite.addTest(BasicInMemoryDbTest.suite());
        suite.addTest(Derby6662Test.suite());
        suite.addTest(MogTest.suite());
    }
    return suite;
}
Also used : BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 80 with BaseTestSuite

use of org.apache.derbyTesting.junit.BaseTestSuite 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;
}
Also used : Test(junit.framework.Test) DatabasePropertyTestSetup(org.apache.derbyTesting.junit.DatabasePropertyTestSetup) SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) Properties(java.util.Properties)

Aggregations

BaseTestSuite (org.apache.derbyTesting.junit.BaseTestSuite)476 Test (junit.framework.Test)136 CleanDatabaseTestSetup (org.apache.derbyTesting.junit.CleanDatabaseTestSetup)118 Statement (java.sql.Statement)81 PreparedStatement (java.sql.PreparedStatement)68 SupportFilesSetup (org.apache.derbyTesting.junit.SupportFilesSetup)49 Properties (java.util.Properties)43 SystemPropertyTestSetup (org.apache.derbyTesting.junit.SystemPropertyTestSetup)34 CallableStatement (java.sql.CallableStatement)19 Connection (java.sql.Connection)14 SecurityManagerSetup (org.apache.derbyTesting.junit.SecurityManagerSetup)13 DatabasePropertyTestSetup (org.apache.derbyTesting.junit.DatabasePropertyTestSetup)11 TestSetup (junit.extensions.TestSetup)10 SQLException (java.sql.SQLException)7 LocaleTestSetup (org.apache.derbyTesting.junit.LocaleTestSetup)7 Method (java.lang.reflect.Method)5 Locale (java.util.Locale)5 BaseJDBCTestSetup (org.apache.derbyTesting.junit.BaseJDBCTestSetup)4 NetworkServerTestSetup (org.apache.derbyTesting.junit.NetworkServerTestSetup)4 ResultSet (java.sql.ResultSet)3