Search in sources :

Example 21 with SystemPropertyTestSetup

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

the class TriggerTests method suite.

public static Test suite() {
    Test suite = new CleanDatabaseTestSetup(TestConfiguration.embeddedSuite(TriggerTests.class));
    Properties p = new Properties();
    // use small pageCacheSize so we don't run out of memory on the insert
    // of large LOB columns.
    p.setProperty("derby.storage.pageCacheSize", "100");
    return new SystemPropertyTestSetup(suite, p);
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) Properties(java.util.Properties)

Example 22 with SystemPropertyTestSetup

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

the class ClobMemTest method suite.

public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite();
    // Just add Derby-6096 embedded as it takes time to run
    suite.addTest(new ClobMemTest("xtestderby6096ClobHashJoin"));
    suite.addTest(TestConfiguration.defaultSuite(ClobMemTest.class));
    Properties p = new Properties();
    // use small pageCacheSize so we don't run out of memory on the insert.
    p.setProperty("derby.storage.pageCacheSize", "100");
    return new SystemPropertyTestSetup(suite, p);
}
Also used : SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) Properties(java.util.Properties)

Example 23 with SystemPropertyTestSetup

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

the class ij3Test method suite.

public static Test suite() {
    Properties props = new Properties();
    props.setProperty("ij.database", "jdbc:derby:wombat;create=true");
    props.setProperty("ij.showNoConnectionsAtStart", "true");
    props.setProperty("ij.showNoCountForSelect", "true");
    Test test = new SystemPropertyTestSetup(new ij3Test("ij3"), props);
    test = new CleanDatabaseTestSetup(test);
    return getIJConfig(test);
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) Properties(java.util.Properties)

Example 24 with SystemPropertyTestSetup

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

the class UpgradeTrajectoryTest method addTrajectory.

/**
 * <p>
 * Add a single trajectory to the suite, with upgrade instructions.
 * </p>
 */
private static void addTrajectory(BaseTestSuite suite, Version.Trajectory trajectory, boolean[] hardUpgradeRequests) {
    UpgradeTrajectoryTest utt = new UpgradeTrajectoryTest(trajectory, hardUpgradeRequests);
    TestSetup setup = TestConfiguration.additionalDatabaseDecorator(utt, UPGRADED_DATABASE);
    setup = TestConfiguration.additionalDatabaseDecorator(setup, VIRGIN_DATABASE);
    setup = TestConfiguration.additionalDatabaseDecorator(setup, COMPARISON_DATABASE);
    Properties preReleaseUpgrade = new Properties();
    preReleaseUpgrade.setProperty("derby.database.allowPreReleaseUpgrade", "true");
    setup = new SystemPropertyTestSetup(setup, preReleaseUpgrade);
    // the version-specific classloader.
    if (trajectory.getVersion(0).compareTo(VERSION_10_2_2_0) < 0) {
        setup = new JDBCClientSetup(setup, JDBCClient.EMBEDDED_30);
    }
    suite.addTest(setup);
}
Also used : ClassLoaderTestSetup(org.apache.derbyTesting.junit.ClassLoaderTestSetup) TestSetup(junit.extensions.TestSetup) SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) Properties(java.util.Properties) JDBCClientSetup(org.apache.derbyTesting.junit.JDBCClientSetup)

Example 25 with SystemPropertyTestSetup

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

the class HarnessJavaTest method decorate.

/**
 * Decorate a HarnessJavaTest test. Any sub-class must
 * call this decorator when adding a test to a suite.
 * This sets up the ij system properties to setup
 * the default connection to be to the default database.
 * The lock timeouts are also shortened and the test
 * will start in a clean database.
 */
protected static Test decorate(HarnessJavaTest test) {
    Test dtest = new SystemPropertyTestSetup(test, new Properties()) {

        protected void setUp() throws java.lang.Exception {
            TestConfiguration config = TestConfiguration.getCurrent();
            // With JDBC 3 connect using a JDBC URL
            if (JDBC.vmSupportsJDBC3()) {
                newValues.setProperty("ij.database", config.getJDBCUrl());
            }
            super.setUp();
        }
    };
    dtest = DatabasePropertyTestSetup.setLockTimeouts(dtest, 4, 6);
    dtest = new CleanDatabaseTestSetup(dtest);
    return dtest;
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) TestConfiguration(org.apache.derbyTesting.junit.TestConfiguration) Properties(java.util.Properties)

Aggregations

SystemPropertyTestSetup (org.apache.derbyTesting.junit.SystemPropertyTestSetup)55 Properties (java.util.Properties)54 BaseTestSuite (org.apache.derbyTesting.junit.BaseTestSuite)34 Test (junit.framework.Test)33 CleanDatabaseTestSetup (org.apache.derbyTesting.junit.CleanDatabaseTestSetup)20 PreparedStatement (java.sql.PreparedStatement)8 Statement (java.sql.Statement)8 SupportFilesSetup (org.apache.derbyTesting.junit.SupportFilesSetup)8 DatabasePropertyTestSetup (org.apache.derbyTesting.junit.DatabasePropertyTestSetup)6 Connection (java.sql.Connection)3 TestSetup (junit.extensions.TestSetup)3 JDBCClientSetup (org.apache.derbyTesting.junit.JDBCClientSetup)2 NetworkServerTestSetup (org.apache.derbyTesting.junit.NetworkServerTestSetup)2 SecurityManagerSetup (org.apache.derbyTesting.junit.SecurityManagerSetup)2 File (java.io.File)1 URL (java.net.URL)1 CallableStatement (java.sql.CallableStatement)1 SQLException (java.sql.SQLException)1 Locale (java.util.Locale)1 Random (java.util.Random)1