Search in sources :

Example 51 with BaseTestSuite

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

the class LuceneJarLoadingTest method suite.

// /////////////////////////////////////////////////////////////////////////////////
// 
// JUnit BEHAVIOR
// 
// /////////////////////////////////////////////////////////////////////////////////
/**
 * Construct top level suite in this JUnit test
 */
public static Test suite() {
    BaseTestSuite suite = (BaseTestSuite) TestConfiguration.embeddedSuite(LuceneJarLoadingTest.class);
    Test secureTest = new SecurityManagerSetup(suite, POLICY_FILE);
    Test authenticatedTest = DatabasePropertyTestSetup.builtinAuthentication(secureTest, LEGAL_USERS, "LuceneJarLoadingPermissions");
    Test authorizedTest = TestConfiguration.sqlAuthorizationDecoratorSingleUse(authenticatedTest, DB_NAME, true);
    Test supportFilesTest = new SupportFilesSetup(authorizedTest, SUPPORT_FILES);
    return supportFilesTest;
}
Also used : Test(junit.framework.Test) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SecurityManagerSetup(org.apache.derbyTesting.junit.SecurityManagerSetup) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 52 with BaseTestSuite

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

the class LuceneSuite method suite.

public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("LuceneSuite");
    Properties properties = TestConfiguration.getSystemProperties();
    // 
    if (getBooleanProperty(properties, TestConfiguration.KEY_OMIT_LUCENE)) {
        assertFalse("Lucene core jar file should not be on the classpath!", JDBC.HAVE_LUCENE_CORE);
        assertFalse("Lucene analyzer jar file should not be on the classpath!", JDBC.HAVE_LUCENE_ANALYZERS);
        assertFalse("Lucene query parser jar file should not be on the classpath!", JDBC.HAVE_LUCENE_QUERYPARSER);
    } else if (JDBC.HAVE_LUCENE_CORE && suffersFromDerby6650()) {
        alarm("Lucene tests are skipped on this platform because of " + "DERBY-6650. Please upgrade to Lucene 4.8 or higher " + "if you would like to run them.");
    } else {
        suite.addTest(LuceneSupportTest.suite());
        suite.addTest(LuceneSupportPermsTest.suite());
        suite.addTest(LuceneCollationTest.suite());
        suite.addTest(LuceneCoarseAuthorizationTest.suite());
        suite.addTest(LuceneInMemoryTest.suite());
        suite.addTest(LuceneBackupTest.suite());
        suite.addTest(LuceneJarLoadingTest.suite());
    }
    return suite;
}
Also used : BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) Properties(java.util.Properties)

Example 53 with BaseTestSuite

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

the class LuceneSupportPermsTest method suite.

// /////////////////////////////////////////////////////////////////////////////////
// 
// JUnit BEHAVIOR
// 
// /////////////////////////////////////////////////////////////////////////////////
/**
 * Construct top level suite in this JUnit test
 */
public static Test suite() {
    String luceneVersion = getSystemProperty(LUCENE_VERSION_PROPERTY);
    if (luceneVersion != null) {
        LUCENE_VERSION = luceneVersion;
    }
    BaseTestSuite suite = (BaseTestSuite) TestConfiguration.embeddedSuite(LuceneSupportPermsTest.class);
    Test secureTest = new SecurityManagerSetup(suite, POLICY_FILE);
    Test authenticatedTest = DatabasePropertyTestSetup.builtinAuthentication(secureTest, LEGAL_USERS, "LuceneSupportPermissions");
    Test authorizedTest = TestConfiguration.sqlAuthorizationDecoratorSingleUse(authenticatedTest, DB_NAME, true);
    Test localizedTest = new LocaleTestSetup(authorizedTest, new Locale(LANGUAGE, COUNTRY));
    return localizedTest;
}
Also used : Locale(java.util.Locale) Test(junit.framework.Test) LocaleTestSetup(org.apache.derbyTesting.junit.LocaleTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SecurityManagerSetup(org.apache.derbyTesting.junit.SecurityManagerSetup)

Example 54 with BaseTestSuite

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

the class AutomaticIndexStatisticsTest method suite.

public static Test suite() {
    Test test = new BaseTestSuite(AutomaticIndexStatisticsTest.class);
    test = new CleanDatabaseTestSetup(test);
    test = TestConfiguration.additionalDatabaseDecorator(test, MASTERDB);
    // TimeZoneTestSetup can probably be removed once DERBY-5974 is fixed.
    return new TimeZoneTestSetup(test, "GMT");
}
Also used : Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) TimeZoneTestSetup(org.apache.derbyTesting.junit.TimeZoneTestSetup)

Example 55 with BaseTestSuite

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

the class BootLockTest method suite.

/**
 * Creates a suite.
 *
 * @return The test suite
 */
public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("BootLockTest");
    suite.addTest(decorateTest());
    return suite;
}
Also used : BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Aggregations

BaseTestSuite (org.apache.derbyTesting.junit.BaseTestSuite)476 Test (junit.framework.Test)136 CleanDatabaseTestSetup (org.apache.derbyTesting.junit.CleanDatabaseTestSetup)118 Statement (java.sql.Statement)81 PreparedStatement (java.sql.PreparedStatement)68 SupportFilesSetup (org.apache.derbyTesting.junit.SupportFilesSetup)49 Properties (java.util.Properties)43 SystemPropertyTestSetup (org.apache.derbyTesting.junit.SystemPropertyTestSetup)34 CallableStatement (java.sql.CallableStatement)19 Connection (java.sql.Connection)14 SecurityManagerSetup (org.apache.derbyTesting.junit.SecurityManagerSetup)13 DatabasePropertyTestSetup (org.apache.derbyTesting.junit.DatabasePropertyTestSetup)11 TestSetup (junit.extensions.TestSetup)10 SQLException (java.sql.SQLException)7 LocaleTestSetup (org.apache.derbyTesting.junit.LocaleTestSetup)7 Method (java.lang.reflect.Method)5 Locale (java.util.Locale)5 BaseJDBCTestSetup (org.apache.derbyTesting.junit.BaseJDBCTestSetup)4 NetworkServerTestSetup (org.apache.derbyTesting.junit.NetworkServerTestSetup)4 ResultSet (java.sql.ResultSet)3