Search in sources :

Example 1 with LocaleTestSetup

use of org.apache.derbyTesting.junit.LocaleTestSetup 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 2 with LocaleTestSetup

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

the class ErrorCodeTest method suite.

public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("errorcode Test");
    suite.addTest(TestConfiguration.defaultSuite(ErrorCodeTest.class));
    return new LocaleTestSetup(suite, Locale.ENGLISH);
}
Also used : LocaleTestSetup(org.apache.derbyTesting.junit.LocaleTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

Example 3 with LocaleTestSetup

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

the class XMLXXETest method suite.

/**
 * Only return 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 XXE Vulnerability tests\n");
    if (!XML.classpathMeetsXMLReqs())
        return suite;
    String[] testFiles = new String[] { "functionTests/tests/lang/xmlOptimizerXXE1Payload.trace", "functionTests/tests/lang/xmlOptimizerXXE1.trace", "functionTests/tests/lang/xmlOptimizerXXE2.trace" };
    suite.addTest(new SupportFilesSetup(TestConfiguration.defaultSuite(XMLXXETest.class), testFiles));
    // which may be different in different locales (DERBY-6869).
    return new LocaleTestSetup(SecurityManagerSetup.noSecurityManager(suite), Locale.US);
}
Also used : LocaleTestSetup(org.apache.derbyTesting.junit.LocaleTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 4 with LocaleTestSetup

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

the class UrlLocaleTest method suite.

public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite();
    suite.addTestSuite(UrlLocaleTest.class);
    suite.addTest(new LocaleTestSetup(new UrlLocaleTest("messageLocale_unknown"), new Locale("rr", "TT")));
    suite.addTest(new LocaleTestSetup(new UrlLocaleTest("messageLocale_Germany"), Locale.GERMANY));
    Test tsuite = new CleanDatabaseTestSetup(suite) {

        /**
         * Creates the table used in the test cases.
         */
        protected void decorateSQL(Statement s) throws SQLException {
            createLocaleProcedures(s.getConnection());
        }
    };
    tsuite = new SupportFilesSetup(tsuite);
    return tsuite;
}
Also used : Locale(java.util.Locale) Test(junit.framework.Test) CleanDatabaseTestSetup(org.apache.derbyTesting.junit.CleanDatabaseTestSetup) Statement(java.sql.Statement) LocaleTestSetup(org.apache.derbyTesting.junit.LocaleTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 5 with LocaleTestSetup

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

the class LuceneSupportTest method suite.

public static Test suite() {
    BaseTestSuite suite = new BaseTestSuite("LuceneSupportTest");
    Test baseTest = TestConfiguration.embeddedSuite(LuceneSupportTest.class);
    Test singleUseTest = TestConfiguration.singleUseDatabaseDecorator(baseTest);
    Test localizedTest = new LocaleTestSetup(singleUseTest, new Locale("en", "US"));
    suite.addTest(SecurityManagerSetup.noSecurityManager(localizedTest));
    return suite;
}
Also used : Locale(java.util.Locale) Test(junit.framework.Test) LocaleTestSetup(org.apache.derbyTesting.junit.LocaleTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite)

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