Search in sources :

Example 46 with SystemPropertyTestSetup

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

the class QueryPlanTest method suite.

public static Test suite() {
    // Set derby.optimizer.noTimeout to prevent the optimizer from
    // timing out and returning an unexpected plan on slower machines.
    // Run in embedded mode only, since we're only interested in testing
    // functionality in the engine.
    Properties sysprops = new Properties();
    sysprops.setProperty("derby.optimizer.noTimeout", "true");
    return new CleanDatabaseTestSetup(new SystemPropertyTestSetup(TestConfiguration.embeddedSuite(QueryPlanTest.class), sysprops, true));
}
Also used : CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) Properties(java.util.Properties)

Example 47 with SystemPropertyTestSetup

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

the class NetworkServerControlApiTest method decorateSystemPropertyTests.

private static BaseTestSuite decorateSystemPropertyTests(BaseTestSuite suite) {
    Properties traceProps = new Properties();
    traceProps.put("derby.drda.traceDirectory", "/");
    traceProps.put("derby.drda.traceAll", "true");
    suite.addTest(new SystemPropertyTestSetup(TestConfiguration.clientServerDecorator(new NetworkServerControlApiTest("xtestTraceSystemPropertiesNoPermission")), traceProps));
    Properties traceProps2 = new Properties();
    traceProps2.put("derby.drda.traceDirectory", getSystemProperty("derby.system.home") + "/trace");
    traceProps2.put("derby.drda.traceAll", "true");
    suite.addTest(new SystemPropertyTestSetup(TestConfiguration.clientServerDecorator(new NetworkServerControlApiTest("xtestTraceSystemPropertiesHasPermission")), traceProps2));
    return suite;
}
Also used : SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) Properties(java.util.Properties)

Example 48 with SystemPropertyTestSetup

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

the class OutBufferedStreamTest method suite.

/**
 * Returns the testsuite with a clientServerDecorator and a
 * CleanDatabaseTestSetup with a table. Also sets system property
 * derby.drda.streamOutBufferSize=131072.
 *
 * @return the testsuite
 */
public static Test suite() {
    Properties properties = new Properties();
    properties.setProperty("derby.drda.streamOutBufferSize", "131072");
    Test suite = TestConfiguration.clientServerSuite(OutBufferedStreamTest.class);
    suite = new SystemPropertyTestSetup(suite, properties);
    return new CleanDatabaseTestSetup(suite) {

        /**
         * Creates the table used in the test case.
         *
         * @throws SQLException
         */
        protected void decorateSQL(Statement s) throws SQLException {
            /* Create a table */
            s.execute("create table TEST_TABLE( TEST_COL blob( 65536 ))");
            getConnection().commit();
        }
    };
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) PreparedStatement(java.sql.PreparedStatement) Statement(java.sql.Statement) SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) Properties(java.util.Properties)

Example 49 with SystemPropertyTestSetup

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

the class ClientSideSystemPropertiesTest method suite.

/*
     * Set the system properties related to client side tracing.
     */
public static Test suite() {
    // Create the traceDirectory required by the tests in this class
    Properties traceRelatedProperties = new Properties();
    traceRelatedProperties.setProperty("derby.client.traceLevel", "64");
    traceRelatedProperties.setProperty("derby.client.traceDirectory", "TraceDir");
    Test suite = TestConfiguration.clientServerSuite(ClientSideSystemPropertiesTest.class);
    return new SystemPropertyTestSetup(suite, traceRelatedProperties);
}
Also used : Test(junit.framework.Test) SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) Properties(java.util.Properties)

Example 50 with SystemPropertyTestSetup

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

the class LockInterruptTest method suite.

public static Test suite() {
    // Only run in embedded mode since we cannot interrupt the engine
    // thread from the network client.
    Test test = TestConfiguration.embeddedSuite(LockInterruptTest.class);
    // Set the lock timeout to a known value so that we know what to
    // expect for timeouts.
    test = DatabasePropertyTestSetup.setLockTimeouts(test, DEADLOCK_TIMEOUT, LOCK_TIMEOUT);
    Properties syspros = new Properties();
    // Derby-4856 interrupt error create thread dump and diagnostic
    // info. Add property to avoid the information.
    syspros.put("derby.stream.error.extendedDiagSeverityLevel", "50000");
    test = new SystemPropertyTestSetup(test, syspros, true);
    return new CleanDatabaseTestSetup(test);
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) 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