Search in sources :

Example 26 with SupportFilesSetup

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

the class XMLBindingTest method suite.

/**
 * Return a suite that runs a set of XML binding tests.  Only return
 * such a suite IF the testing classpath has the required XML classes.
 * Otherwise just return an empty suite.
 */
public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("XML Binding Suite");
    if (XML.classpathMeetsXMLReqs()) {
        /* "false" in the next line means that we will *not* clean the
             * database before the embedded and client suites.  This ensures
             * that we do not remove the objects created by XBindTestSetup.
             */
        Test test = TestConfiguration.defaultSuite(XMLBindingTest.class, false);
        test = new XBindTestSetup(test);
        /* XML parser needs to read "personal.dtd" for schema-based
             * insertion, so copy it to user directory.
             */
        test = new SupportFilesSetup(test, new String[] { "functionTests/tests/lang/xmlTestFiles/personal.dtd" });
        // JEP 185 (http://openjdk.java.net/jeps/185) in Java SE 8 added
        // restrictions on access to external resources. This system
        // property loosens the restriction so that the XML parser is
        // allowed to read the DTD.
        test = SystemPropertyTestSetup.singleProperty(test, "javax.xml.accessExternalDTD", "file");
        suite.addTest(test);
    }
    return suite;
}
Also used : Test(junit.framework.Test) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 27 with SupportFilesSetup

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

the class Derby6884Test method baseSuite.

protected static Test baseSuite(String name) {
    BaseTestSuite suite = new BaseTestSuite(name);
    suite.addTestSuite(Derby6884Test.class);
    Test test = suite;
    test = new SupportFilesSetup(test);
    return new CleanDatabaseTestSetup(test) {

        protected void decorateSQL(Statement stmt) throws SQLException {
            Connection conn = stmt.getConnection();
            stmt.execute("CREATE TABLE DERBY_6884_TESTBLOB" + "(id BIGINT, content BLOB)");
            stmt.execute("CREATE TABLE DERBY_6884_TESTCLOB" + "(id BIGINT, content CLOB)");
            conn.commit();
        }
    };
}
Also used : Test(junit.framework.Test) ImportExportBaseTest(org.apache.derbyTesting.functionTests.tests.tools.ImportExportBaseTest) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) PreparedStatement(java.sql.PreparedStatement) Statement(java.sql.Statement) Connection(java.sql.Connection) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 28 with SupportFilesSetup

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

the class Changes10_7 method suite.

// /////////////////////////////////////////////////////////////////////////////////
// 
// JUnit BEHAVIOR
// 
// /////////////////////////////////////////////////////////////////////////////////
/**
 * Return the suite of tests to test the changes made in 10.7.
 * @param phase an integer that indicates the current phase in
 *              the upgrade test.
 * @return the test suite created.
 */
public static Test suite(int phase) {
    BaseTestSuite suite = new BaseTestSuite("Upgrade test for 10.7");
    suite.addTestSuite(Changes10_7.class);
    return new SupportFilesSetup((Test) suite);
}
Also used : BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 29 with SupportFilesSetup

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

the class Changes10_9 method suite.

/**
 * Return the suite of tests to test the changes made in 10.7.
 * @param phase an integer that indicates the current phase in
 *              the upgrade test.
 * @return the test suite created.
 */
public static Test suite(int phase) {
    BaseTestSuite suite = new BaseTestSuite("Upgrade test for 10.9");
    suite.addTestSuite(Changes10_9.class);
    return new SupportFilesSetup((Test) suite, SUPPORT_FILES_SOURCE);
}
Also used : BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 30 with SupportFilesSetup

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

the class Changes10_10 method suite.

// /////////////////////////////////////////////////////////////////////////////////
// 
// JUnit BEHAVIOR
// 
// /////////////////////////////////////////////////////////////////////////////////
/**
 * Return the suite of tests to test the changes made in 10.10.
 * @param phase an integer that indicates the current phase in
 *              the upgrade test.
 * @return the test suite created.
 */
public static Test suite(int phase) {
    BaseTestSuite suite = new BaseTestSuite("Upgrade test for 10.9");
    suite.addTestSuite(Changes10_10.class);
    return new SupportFilesSetup((Test) suite);
}
Also used : 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