Search in sources :

Example 41 with SupportFilesSetup

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

the class XplainStatisticsTest method suite.

public static Test suite() {
    timeSuiteStarted = (new Date()).getTime();
    BaseTestSuite allTests = new BaseTestSuite(XplainStatisticsTest.class, "XplainStatisticsTest");
    Test test = allTests;
    // added by DERBY-4587
    test = new SupportFilesSetup(test);
    return new CleanDatabaseTestSetup(test) {

        protected void decorateSQL(Statement s) throws SQLException {
            createSchemaObjects(s);
        }
    };
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) PreparedStatement(java.sql.PreparedStatement) Statement(java.sql.Statement) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup) Date(java.util.Date)

Example 42 with SupportFilesSetup

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

the class XMLOptimizerTraceTest method suite.

// /////////////////////////////////////////////////////////////////////////////////
// 
// JUnit BEHAVIOR
// 
// /////////////////////////////////////////////////////////////////////////////////
/**
 * Construct top level suite in this JUnit test
 */
public static Test suite() {
    String[] testFiles = new String[] { "functionTests/tests/lang/" + SAVED_TRACE_NAME };
    BaseTestSuite suite = new BaseTestSuite("XMLOptimizerTraceTest");
    suite.addTest(TestConfiguration.defaultSuite(XMLOptimizerTraceTest.class));
    return new SupportFilesSetup(TestConfiguration.singleUseDatabaseDecorator(suite), testFiles);
}
Also used : BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 43 with SupportFilesSetup

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

the class BlobImplT method baseSuite.

/**
 * Create an instance of the {@code LobLimitsTest} suite.
 *
 * @param biggestSize the size of the biggest LOB to test
 * @param bigSize the size of a typical big LOB to test
 * @return a test suite
 */
static Test baseSuite(final int biggestSize, final int bigSize) {
    // Run the suite with following properties in case we run into lock
    // time out issues. It will help debug the problem if timeouts occur.
    Properties sysprops = new Properties();
    sysprops.setProperty("derby.locks.deadlockTrace", "true");
    sysprops.setProperty("derby.locks.monitor", "true");
    // Some of the test cases depend on certain other test cases to run
    // first, so force the test cases to run in lexicographical order.
    Test suite = new CleanDatabaseTestSetup(new BaseTestSuite(LobLimitsTest.class)) {

        @Override
        protected void decorateSQL(Statement s) throws SQLException {
            setupTables(s, biggestSize, bigSize);
        }
    };
    suite = new SystemPropertyTestSetup(suite, sysprops);
    return new SupportFilesSetup(suite);
}
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) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) Properties(java.util.Properties) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 44 with SupportFilesSetup

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

the class CheckConstraintTest method suite.

public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("checkConstraint Test");
    suite.addTest(TestConfiguration.defaultSuite(CheckConstraintTest.class));
    return new SupportFilesSetup(suite, new String[] { "functionTests/tests/lang/" + IMPORT_FILE_NAME });
}
Also used : BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 45 with SupportFilesSetup

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

the class ConstraintCharacteristicsTest method baseSuite2.

private static Test baseSuite2(final String name) {
    final BaseTestSuite suite = new BaseTestSuite(name);
    final Properties systemProperties = new Properties();
    systemProperties.setProperty("derby.language.logQueryPlan", "true");
    suite.addTest(new SupportFilesSetup(new SystemPropertyTestSetup(new ConstraintCharacteristicsTest("testDerby6666"), systemProperties, true)));
    return suite;
}
Also used : SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) Properties(java.util.Properties) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Aggregations

SupportFilesSetup (org.apache.derbyTesting.junit.SupportFilesSetup)58 BaseTestSuite (org.apache.derbyTesting.junit.BaseTestSuite)49 Test (junit.framework.Test)34 CleanDatabaseTestSetup (org.apache.derbyTesting.junit.CleanDatabaseTestSetup)19 Statement (java.sql.Statement)13 PreparedStatement (java.sql.PreparedStatement)11 Properties (java.util.Properties)9 SystemPropertyTestSetup (org.apache.derbyTesting.junit.SystemPropertyTestSetup)8 SecurityManagerSetup (org.apache.derbyTesting.junit.SecurityManagerSetup)4 CallableStatement (java.sql.CallableStatement)3 LocaleTestSetup (org.apache.derbyTesting.junit.LocaleTestSetup)3 NetworkServerTestSetup (org.apache.derbyTesting.junit.NetworkServerTestSetup)3 URL (java.net.URL)2 Locale (java.util.Locale)2 ClasspathSetup (org.apache.derbyTesting.junit.ClasspathSetup)2 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 InputStreamReader (java.io.InputStreamReader)1 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1