Search in sources :

Example 16 with SupportFilesSetup

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

the class ImportExportProcedureTest method suite.

public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("ImportExportProcedureTest");
    suite.addTest(TestConfiguration.defaultSuite(ImportExportProcedureTest.class));
    return new SupportFilesSetup(suite, new String[] { "functionTests/testData/ImportExport/db2ttypes.del", "functionTests/testData/ImportExport/mixednl.del", "functionTests/testData/ImportExport/position_info.del" });
}
Also used : BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 17 with SupportFilesSetup

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

the class Test_6661 method suite.

// /////////////////////////////////////////////////////////////////////////////////
// 
// JUnit BEHAVIOR
// 
// /////////////////////////////////////////////////////////////////////////////////
public static Test suite() {
    BaseTestSuite baseTest = new BaseTestSuite(Test_6661.class, "Test_6661");
    Test singleUseWrapper = TestConfiguration.singleUseDatabaseDecorator(baseTest);
    Test cleanDatabaseWrapper = new CleanDatabaseTestSetup(singleUseWrapper);
    Test supportFileWrapper = new SupportFilesSetup(cleanDatabaseWrapper);
    Test noSecurityWrapper = SecurityManagerSetup.noSecurityManager(supportFileWrapper);
    return noSecurityWrapper;
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 18 with SupportFilesSetup

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

the class IjSecurityManagerTest method decorateTest.

private static Test decorateTest() {
    Test test = TestConfiguration.embeddedSuite(IjSecurityManagerTest.class);
    test = new SupportFilesSetup(test, null, new String[] { "functionTests/tests/tools/IjSecurityManagerTest.sql" }, null, new String[] { "IjSecurityManagerTest.sql" });
    return test;
}
Also used : Test(junit.framework.Test) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 19 with SupportFilesSetup

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

the class ImportExportBinaryDataTest method suite.

/**
 * Runs the tests in the default embedded configuration and then
 * the client server configuration.
 */
public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite(ImportExportBinaryDataTest.class);
    suite.addTest(TestConfiguration.clientServerSuite(ImportExportBinaryDataTest.class));
    Test test = suite;
    test = new SupportFilesSetup(test);
    return new CleanDatabaseTestSetup(test) {

        protected void decorateSQL(Statement s) throws SQLException {
            // table used to test  export.
            s.execute("CREATE TABLE BIN_TAB (id int," + "C_BD CHAR(4) FOR BIT DATA," + "C_VBD VARCHAR(10) FOR BIT DATA, " + "C_LVBD LONG VARCHAR FOR BIT DATA)");
            // load some data into the above table.
            loadData(s);
            // table used to test import.
            s.execute("CREATE TABLE BIN_TAB_IMP(id int," + "C_BD CHAR(4) FOR BIT DATA," + "C_VBD VARCHAR(10) FOR BIT DATA, " + "C_LVBD LONG VARCHAR FOR BIT DATA)");
            // Create a table that holds some invalid hex strings.
            s.execute("CREATE TABLE hex_tab(id int," + "C1 varchar(20)," + "C2 varchar(20)," + "C3 varchar(20))");
            // Create a table to test
            // DERBY-2925: Prevent export from overwriting existing files
            s.execute("create table derby_2925_tab(a varchar( 50 )," + "b varchar( 50 ))");
        }
    };
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) Statement(java.sql.Statement) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 20 with SupportFilesSetup

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

the class GrantRevokeDDLTest method suite.

public static Test suite() {
    if (JDBC.vmSupportsJSR169()) {
        // return empty suite;
        return new BaseTestSuite("GrantRevokeDDLTest");
    }
    // test uses triggers and procedures that use DriverManager.
    BaseTestSuite suite = new BaseTestSuite(GrantRevokeDDLTest.class, "GrantRevokeDDL Test");
    Test test = new SupportFilesSetup(suite);
    test = new CleanDatabaseTestSetup(test);
    test = DatabasePropertyTestSetup.builtinAuthentication(test, users, "grantrevokeddl");
    test = TestConfiguration.sqlAuthorizationDecorator(test);
    return test;
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) 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