Search in sources :

Example 81 with BaseTestSuite

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

the class StressMultiTest method embeddedSuite.

/**
 * Get at testsuite that runs only the embedded suite with
 * the given number of threads for the given number of minutes.
 *
 * @param threads
 * @param minutes
 */
public static Test embeddedSuite(int threads, int minutes) {
    THREADS = threads;
    MINUTES = minutes;
    Properties dbprops = new Properties();
    dbprops.put("derby.locks.deadlockTimeout", "2");
    dbprops.put("derby.locks.waitTimeout", "3");
    dbprops.put("derby.language.logStatementText", "true");
    dbprops.put("derby.storage.keepTransactionLog", "true");
    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);
    embedded = TestConfiguration.singleUseDatabaseDecorator(newCleanDatabase(embedded));
    return embedded;
}
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)

Example 82 with BaseTestSuite

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

the class NistScripts method suite.

/**
 * Return the suite that runs the NIST SQL scripts.
 */
public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("NIST");
    String suiteUser = null;
    BaseTestSuite userSuite = null;
    for (int i = 0; i < TESTS.length; i++) {
        String testScript = TESTS[i][0];
        String testUser = TESTS[i][1];
        Test test = new NistScripts(testScript);
        if (testUser.equals(suiteUser)) {
            userSuite.addTest(test);
            continue;
        }
        // Add the new user suite with the change user decorator to
        // the main suite but continue to add tests to the user suite.
        userSuite = new BaseTestSuite("NIST user=" + testUser);
        String password = testUser.concat("ni8s4T");
        suite.addTest(TestConfiguration.changeUserDecorator(userSuite, testUser, password));
        suiteUser = testUser;
        userSuite.addTest(test);
    }
    Test test = getIJConfig(suite);
    // Setup user authentication
    test = DatabasePropertyTestSetup.builtinAuthentication(test, new String[] { "APP", "HU", "FLATER", "SUN", "CTS1", "SULLIVAN1", "SCHANZLE" }, "ni8s4T");
    // Lock timeout settings that were set for the old harness when
    // running nist.
    test = DatabasePropertyTestSetup.setLockTimeouts(test, 2, 4);
    return new CleanDatabaseTestSetup(test);
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 83 with BaseTestSuite

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

the class ReplicationTestRun_Verify method suite.

public static Test suite() throws Exception {
    System.out.println("*** ReplicationTestRun_Verify.suite()");
    BaseTestSuite suite = new BaseTestSuite("ReplicationTestRun_Verify");
    System.out.println("*** Done new BaseTestSuite()");
    String masterHostName = System.getProperty("test.serverHost", "localhost");
    int masterPortNo = Integer.parseInt(System.getProperty("test.serverPort", "1527"));
    suite.addTest(ReplicationTestRun_Verify.simpleVerify(masterHostName, masterPortNo));
    System.out.println("*** Done suite.addTest(StandardTests.simpleTest())");
    return (Test) suite;
}
Also used : Test(junit.framework.Test) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 84 with BaseTestSuite

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

the class ShutdownMasterServerByOsKill method suite.

public static Test suite() throws Exception {
    System.out.println("**** ShutdownMasterServerByOsKill.suite()");
    System.out.println("'ShutdownMasterServerByOsKill' can not be run outside the 'ReplicationRun' framework.");
    setEnv();
    BaseTestSuite suite = new BaseTestSuite("ShutdownMasterServerByOsKillCtrl");
    // (masterHostName, masterPortNo));
    suite.addTest(ShutdownMasterServerByOsKill.suite(masterServerHost, masterServerPort));
    return (Test) suite;
}
Also used : Test(junit.framework.Test) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 85 with BaseTestSuite

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

the class ShutdownMasterServerViaNwSrvCtrl method suite.

public static Test suite() throws Exception {
    System.out.println("**** ShutdownMasterServerViaNwSrvCtrl.suite()");
    System.out.println("'ShutdownMasterServerViaNwSrvCtrl' can not be run outside the 'ReplicationRun' framework.");
    setEnv();
    BaseTestSuite suite = new BaseTestSuite("ShutdownMasterServerViaNwSrvCtrl");
    // (masterHostName, masterPortNo));
    suite.addTest(ShutdownMasterServerViaNwSrvCtrl.suite(masterServerHost, masterServerPort));
    return (Test) suite;
}
Also used : Test(junit.framework.Test) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

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