Search in sources :

Example 21 with CleanDatabaseTestSetup

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

the class I18NImportExport method suite.

public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("I18NImportExport");
    suite.addTest(new CleanDatabaseTestSetup(new I18NImportExport("I18NImportExport")));
    return getIJConfig(new SupportFilesSetup(suite, new String[] { "functionTests/tests/i18n/data/Tab1_fr.ctrl", "functionTests/tests/i18n/data/Tab1_il.ctrl", "functionTests/tests/i18n/data/Tab1_jp.ctrl" }));
}
Also used : CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 22 with CleanDatabaseTestSetup

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

the class ConnectTest method suite.

public static Test suite() {
    if (JDBC.vmSupportsJSR169())
        // is not supported with JSR169
        return new BaseTestSuite("empty ConnectTest:DriverManager not supported");
    else {
        BaseTestSuite suite = new BaseTestSuite("ConnectTest suite");
        suite.addTest(TestConfiguration.defaultSuite(ConnectTest.class));
        // Derby2026 test uses explicit client connection so not relevant to embedded
        suite.addTest(TestConfiguration.clientServerDecorator(new ConnectTest("clientTestDerby2026LoginTimeout")));
        return new CleanDatabaseTestSetup(suite);
    }
}
Also used : CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 23 with CleanDatabaseTestSetup

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

the class Bug5054Test method suite.

/**
 * Returns the implemented tests.
 *
 * @return An instance of <code>Test</code> with the implemented tests to
 *         run.
 */
public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("Bug5054Test");
    Test test = new CleanDatabaseTestSetup(TestConfiguration.embeddedSuite(Bug5054Test.class)) {

        protected void decorateSQL(Statement stmt) throws SQLException {
            stmt.executeUpdate("CREATE TABLE T1 (a integer, b integer)");
            stmt.executeUpdate("INSERT INTO T1 VALUES(1, 1)");
            stmt.executeUpdate("INSERT INTO T1 VALUES(2, 2)");
        }
    };
    suite.addTest(test);
    suite.addTest(TestConfiguration.clientServerDecorator(test));
    return suite;
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) Statement(java.sql.Statement) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 24 with CleanDatabaseTestSetup

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

the class XATest method baseSuite.

public static Test baseSuite(String name) {
    BaseTestSuite suite = new BaseTestSuite(name);
    suite.addTestSuite(XATest.class);
    return new CleanDatabaseTestSetup(suite) {

        /**
         * Creates the table used in the test cases.
         */
        protected void decorateSQL(Statement s) throws SQLException {
            XATestUtil.createXATransactionView(s);
            // Table for lock timeout test
            s.executeUpdate("CREATE TABLE TABLT (I INT)");
            s.executeUpdate("INSERT INTO TABLT VALUES(1)");
        }
    };
}
Also used : CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) PreparedStatement(java.sql.PreparedStatement) Statement(java.sql.Statement) CallableStatement(java.sql.CallableStatement) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 25 with CleanDatabaseTestSetup

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

the class UDAPermsTest method suite.

// /////////////////////////////////////////////////////////////////////////////////
// 
// JUnit BEHAVIOR
// 
// /////////////////////////////////////////////////////////////////////////////////
/**
 * Construct top level suite in this JUnit test
 */
public static Test suite() {
    BaseTestSuite suite = (BaseTestSuite) TestConfiguration.embeddedSuite(UDAPermsTest.class);
    Test cleanTest = new CleanDatabaseTestSetup(suite);
    Test authenticatedTest = DatabasePropertyTestSetup.builtinAuthentication(cleanTest, LEGAL_USERS, "udaPermissions");
    Test authorizedTest = TestConfiguration.sqlAuthorizationDecorator(authenticatedTest);
    return authorizedTest;
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Aggregations

CleanDatabaseTestSetup (org.apache.derbyTesting.junit.CleanDatabaseTestSetup)147 BaseTestSuite (org.apache.derbyTesting.junit.BaseTestSuite)118 Statement (java.sql.Statement)95 PreparedStatement (java.sql.PreparedStatement)77 Test (junit.framework.Test)77 Properties (java.util.Properties)25 CallableStatement (java.sql.CallableStatement)21 Connection (java.sql.Connection)20 SystemPropertyTestSetup (org.apache.derbyTesting.junit.SystemPropertyTestSetup)20 SupportFilesSetup (org.apache.derbyTesting.junit.SupportFilesSetup)19 SQLException (java.sql.SQLException)7 DatabasePropertyTestSetup (org.apache.derbyTesting.junit.DatabasePropertyTestSetup)7 UnsupportedEncodingException (java.io.UnsupportedEncodingException)3 Random (java.util.Random)3 TestSetup (junit.extensions.TestSetup)3 LocaleTestSetup (org.apache.derbyTesting.junit.LocaleTestSetup)3 ResultSet (java.sql.ResultSet)2 Locale (java.util.Locale)2 PrepareStatementTest (org.apache.derbyTesting.functionTests.tests.derbynet.PrepareStatementTest)2 AnsiTrimTest (org.apache.derbyTesting.functionTests.tests.lang.AnsiTrimTest)2