Search in sources :

Example 46 with SupportFilesSetup

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

the class ConstraintCharacteristicsTest method baseSuite3.

// this suite holds tests that require a more optimal
// locks.waitTimeout setting.
private static Test baseSuite3(final String name) {
    final BaseTestSuite suite = new BaseTestSuite(name);
    suite.addTest(new ConstraintCharacteristicsTest("testDeferredRowsInvalidation"));
    suite.addTest(new ConstraintCharacteristicsTest("testLockingForUniquePK"));
    final Properties systemProperties = new Properties();
    systemProperties.setProperty("derby.locks.waitTimeout", Integer.toString(WAIT_TIMEOUT_DURATION));
    return new SupportFilesSetup(new SystemPropertyTestSetup(suite, systemProperties, true));
}
Also used : SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) Properties(java.util.Properties) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 47 with SupportFilesSetup

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

the class ConstraintCharacteristicsTest method baseSuite1.

private static Test baseSuite1(final String name) {
    final BaseTestSuite suite = new BaseTestSuite(name);
    suite.addTest(new ConstraintCharacteristicsTest("testSyntaxAndBinding"));
    suite.addTest(new ConstraintCharacteristicsTest("testDropNotNullOnUniqueColumn"));
    suite.addTest(new ConstraintCharacteristicsTest("testCompressTableOKUnique"));
    suite.addTest(new ConstraintCharacteristicsTest("testLockingForUniquePKWithCommit"));
    suite.addTest(new ConstraintCharacteristicsTest("testLockingForUniquePKWithRollback"));
    suite.addTest(new ConstraintCharacteristicsTest("testDatabaseMetaData"));
    suite.addTest(new ConstraintCharacteristicsTest("testCreateConstraintDictionaryEncodings"));
    suite.addTest(new ConstraintCharacteristicsTest("testAlterConstraintDictionaryEncodings"));
    suite.addTest(new ConstraintCharacteristicsTest("testAlterConstraintInvalidation"));
    suite.addTest(new ConstraintCharacteristicsTest("testBasicDeferral"));
    suite.addTest(new ConstraintCharacteristicsTest("testRoutines"));
    suite.addTest(new ConstraintCharacteristicsTest("testImport"));
    suite.addTest(new ConstraintCharacteristicsTest("testDerby6374"));
    suite.addTest(new ConstraintCharacteristicsTest("testXA"));
    suite.addTest(new ConstraintCharacteristicsTest("testAlmostRemovedAllDups"));
    suite.addTest(new ConstraintCharacteristicsTest("testCheckConstraintsWithDeferredRows"));
    suite.addTest(new ConstraintCharacteristicsTest("testSeveralCheckConstraints"));
    suite.addTest(new ConstraintCharacteristicsTest("testDerby6670_a"));
    suite.addTest(new ConstraintCharacteristicsTest("testDerby6670_b"));
    suite.addTest(new ConstraintCharacteristicsTest("testManySimilarDuplicates"));
    suite.addTest(new ConstraintCharacteristicsTest("testDerby6773"));
    final Properties systemProperties = new Properties();
    systemProperties.setProperty("derby.locks.waitTimeout", Integer.toString(500));
    return new SupportFilesSetup(new SystemPropertyTestSetup(suite, systemProperties, true));
}
Also used : SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) Properties(java.util.Properties) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 48 with SupportFilesSetup

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

the class SecurityPolicyReloadingTest method decorateTest.

// /////////////////////////////////////////////////////////////////////////////////
// 
// TEST DECORATION
// 
// /////////////////////////////////////////////////////////////////////////////////
/**
 * Add decorators to a test run. Context is established in the reverse order
 * that decorators are declared here. That is, decorators compose in reverse
 * order. The order of the setup methods is:
 *
 * <ul>
 * <li>Copy security policy to visible location.</li>
 * <li>Setup authorization-enabling properties.</li>
 * <li>Install a security manager.</li>
 * <li>Run the tests.</li>
 * </ul>
 */
private static Test decorateTest() {
    Test test = new SecurityPolicyReloadingTest();
    // 
    // Install a security manager using the initial policy file.
    // 
    test = new SecurityManagerSetup(test, makeServerPolicyName());
    // 
    // Set up authorization with a DBO and non-DBO user
    // 
    test = TestConfiguration.sqlAuthorizationDecorator(test, new String[] { NON_DBO_USER }, PASSWORD_TOKEN);
    // 
    // Copy over the initial policy file we want to use.
    // 
    test = new SupportFilesSetup(test, null, new String[] { getSourcePolicy() }, null, new String[] { makeTargetPolicyStub() });
    // No need to run with default testing policy file because we install our
    // own initial policy file.
    test = SecurityManagerSetup.noSecurityManager(test);
    return test;
}
Also used : Test(junit.framework.Test) SecurityManagerSetup(org.apache.derbyTesting.junit.SecurityManagerSetup) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 49 with SupportFilesSetup

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

the class TriggerGeneralTest method suite.

public static Test suite() {
    Test t = TestConfiguration.defaultSuite(TriggerGeneralTest.class);
    t = new SupportFilesSetup(t, new String[] { "functionTests/tests/lang/dcl_emc1.jar" });
    return SecurityManagerSetup.noSecurityManager(t);
}
Also used : Test(junit.framework.Test) SupportFilesSetup(org.apache.derbyTesting.junit.SupportFilesSetup)

Example 50 with SupportFilesSetup

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

the class SimpleJsonPermsTest method suite.

// /////////////////////////////////////////////////////////////////////////////////
// 
// JUnit BEHAVIOR
// 
// /////////////////////////////////////////////////////////////////////////////////
/**
 * Construct top level suite in this JUnit test
 */
public static Test suite() {
    BaseTestSuite suite = (BaseTestSuite) TestConfiguration.embeddedSuite(SimpleJsonPermsTest.class);
    Test customTest = new SupportFilesSetup(suite, new String[] { "functionTests/tests/lang/json.dat" });
    Test authenticatedTest = DatabasePropertyTestSetup.builtinAuthentication(customTest, LEGAL_USERS, "SimpleJsonPermissions");
    Test authorizedTest = TestConfiguration.sqlAuthorizationDecoratorSingleUse(authenticatedTest, DB_NAME, true);
    return authorizedTest;
}
Also used : Test(junit.framework.Test) 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