Search in sources :

Example 6 with LocaleTestSetup

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

the class TableLockBasicTest method suite.

public static Test suite() {
    Test test = TestConfiguration.defaultSuite(TableLockBasicTest.class);
    test = DatabasePropertyTestSetup.singleProperty(test, "derby.storage.rowLocking", "false", true);
    test = new LocaleTestSetup(test, Locale.ENGLISH);
    return TestConfiguration.singleUseDatabaseDecorator(test);
}
Also used : Test(junit.framework.Test) LocaleTestSetup(org.apache.derbyTesting.junit.LocaleTestSetup)

Example 7 with LocaleTestSetup

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

the class ImportExportIJTest method suite.

/**
 * Return the suite that runs the script.
 */
public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("importExportIJ");
    // only run with embedded
    // network server makes slightly different output
    // ('statement executed' instead of '# rows inserted/deteled', etc.)
    // and this test would never work if the server were on
    // a remote system because the export file would be on the
    // server side, and import would be looking on the client.
    // Also, running client & embedded would require some cleanup magic to
    // remove the exported files (see e.g. ImportExportTest).
    Test test = new ImportExportIJTest("importExportIJ");
    // This test should run in English locale since it compares error
    // messages against a canon based on the English message text. Also,
    // run the test in a fresh database, since the language of the message
    // text is determined when the database is created.
    test = new LocaleTestSetup(test, Locale.ENGLISH);
    test = TestConfiguration.singleUseDatabaseDecorator(test);
    suite.addTest(new CleanDatabaseTestSetup(test));
    return new SupportFilesSetup(suite, new String[] { "functionTests/testData/ImportExport/TwoLineBadEOF.dat", "functionTests/testData/ImportExport/NoEOR.dat", "functionTests/testData/ImportExport/Access1.txt", "functionTests/testData/ImportExport/AccountData_defaultformat.dat", "functionTests/testData/ImportExport/AccountData_format1.dat", "functionTests/testData/ImportExport/AccountData_format2.dat", "functionTests/testData/ImportExport/AccountData_format2oops.dat", "functionTests/testData/ImportExport/AccountData_NullFields.dat", "functionTests/testData/ImportExport/UnsupportedFormat1.dat", "functionTests/testData/ImportExport/UnsupportedFormat2.dat", "functionTests/testData/ImportExport/derby-2193.txt", "functionTests/testData/ImportExport/derby-2193-linenumber.txt" });
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) LocaleTestSetup(org.apache.derbyTesting.junit.LocaleTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 8 with LocaleTestSetup

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

the class RuntimeInfoTest method decorateTest.

/**
 * Decorate a test with SecurityManagerSetup, clientServersuite, and
 * SupportFilesSetup.
 *
 * @return the decorated test
 */
private static Test decorateTest(Locale serverLocale, String testName) {
    Test test = new RuntimeInfoTest(testName);
    test = TestConfiguration.clientServerDecorator(test);
    /* A single use database must be used to ensure the consistent output.
         * The output would change whether the test was being ran for the first
         * or subsequent times. */
    test = TestConfiguration.singleUseDatabaseDecorator(test);
    test = new LocaleTestSetup(test, serverLocale);
    // Install a security manager using the initial policy file.
    return new SecurityManagerSetup(test, POLICY_FILE_NAME);
}
Also used : Test(junit.framework.Test) LocaleTestSetup(org.apache.derbyTesting.junit.LocaleTestSetup) SecurityManagerSetup(org.apache.derbyTesting.junit.SecurityManagerSetup)

Example 9 with LocaleTestSetup

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

the class ij2Test method suite.

public static Test suite() {
    Properties props = new Properties();
    props.setProperty("derby.infolog.append", "true");
    props.setProperty("ij.protocol", "jdbc:derby:");
    props.setProperty("ij.database", "wombat;create=true");
    Test test = new SystemPropertyTestSetup(new ij2Test("ij2"), props);
    test = new LocaleTestSetup(test, Locale.ENGLISH);
    test = TestConfiguration.singleUseDatabaseDecorator(test, "wombat1");
    test = new CleanDatabaseTestSetup(test);
    BaseTestSuite suite = new BaseTestSuite("ij2Scripts");
    suite.addTest(test);
    if (JDBC.vmSupportsJDBC3()) {
        props.setProperty("ij.protocol", "jdbc:derby:");
        props.setProperty("ij.showNoConnectionsAtStart", "true");
        Test testb = new SystemPropertyTestSetup(new ij2Test("ij2b"), props);
        testb = new LocaleTestSetup(testb, Locale.ENGLISH);
        testb = TestConfiguration.singleUseDatabaseDecorator(testb, "wombat1");
        testb = new CleanDatabaseTestSetup(testb);
        suite.addTest(testb);
    }
    return getIJConfig(suite);
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) LocaleTestSetup(org.apache.derbyTesting.junit.LocaleTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) Properties(java.util.Properties)

Aggregations

LocaleTestSetup (org.apache.derbyTesting.junit.LocaleTestSetup)9 Test (junit.framework.Test)7 BaseTestSuite (org.apache.derbyTesting.junit.BaseTestSuite)7 Locale (java.util.Locale)3 CleanDatabaseTestSetup (org.apache.derbyTesting.junit.CleanDatabaseTestSetup)3 SupportFilesSetup (org.apache.derbyTesting.junit.SupportFilesSetup)3 SecurityManagerSetup (org.apache.derbyTesting.junit.SecurityManagerSetup)2 Statement (java.sql.Statement)1 Properties (java.util.Properties)1 SystemPropertyTestSetup (org.apache.derbyTesting.junit.SystemPropertyTestSetup)1