Search in sources :

Example 1 with SecurityManagerSetup

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

the class NoDBInternalsPermissionTest method suite.

// /////////////////////////////////////////////////////////////////////////////////
// 
// JUnit BEHAVIOR
// 
// /////////////////////////////////////////////////////////////////////////////////
/**
 * Construct top level suite in this JUnit test
 */
public static Test suite() {
    BaseTestSuite suite = (BaseTestSuite) TestConfiguration.embeddedSuite(NoDBInternalsPermissionTest.class);
    Test secureTest = new SecurityManagerSetup(suite, POLICY_FILE);
    return secureTest;
}
Also used : Test(junit.framework.Test) BaseTestSuite(org.apache.derbyTesting.junit.BaseTestSuite) SecurityManagerSetup(org.apache.derbyTesting.junit.SecurityManagerSetup)

Example 2 with SecurityManagerSetup

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

the class LuceneBackupTest method suite.

// /////////////////////////////////////////////////////////////////////////////////
// 
// JUnit BEHAVIOR
// 
// /////////////////////////////////////////////////////////////////////////////////
/**
 * Construct top level suite in this JUnit test
 */
public static Test suite() {
    BaseTestSuite suite = (BaseTestSuite) TestConfiguration.embeddedSuite(LuceneBackupTest.class);
    Test secureTest = new SecurityManagerSetup(suite, POLICY_FILE);
    Test authenticatedTest = DatabasePropertyTestSetup.builtinAuthentication(secureTest, LEGAL_USERS, "LuceneBackupPermissions");
    Test authorizedTest = TestConfiguration.sqlAuthorizationDecoratorSingleUse(authenticatedTest, DB_NAME, true);
    Test supportFilesTest = new SupportFilesSetup(authorizedTest);
    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 3 with SecurityManagerSetup

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

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

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

the class Derby3980DeadlockTest method decorateTest.

/**
 * Decorate a test with SecurityManagerSetup, clientServersuite, and
 * SupportFilesSetup.
 *
 * @return the decorated test
 */
private static Test decorateTest() {
    Test test = TestConfiguration.clientServerSuite(Derby3980DeadlockTest.class);
    Properties diagProperties = new Properties();
    diagProperties.setProperty("derby.stream.error.extendedDiagSeverityLevel", "30000");
    diagProperties.setProperty("derby.infolog.append", "true");
    test = new SystemPropertyTestSetup(test, diagProperties, true);
    // Install a security manager using the initial policy file.
    return new SecurityManagerSetup(test, POLICY_FILE_NAME);
}
Also used : Test(junit.framework.Test) SystemPropertyTestSetup(org.apache.derbyTesting.junit.SystemPropertyTestSetup) SecurityManagerSetup(org.apache.derbyTesting.junit.SecurityManagerSetup) Properties(java.util.Properties)

Aggregations

SecurityManagerSetup (org.apache.derbyTesting.junit.SecurityManagerSetup)20 Test (junit.framework.Test)13 BaseTestSuite (org.apache.derbyTesting.junit.BaseTestSuite)13 SupportFilesSetup (org.apache.derbyTesting.junit.SupportFilesSetup)4 Properties (java.util.Properties)2 LocaleTestSetup (org.apache.derbyTesting.junit.LocaleTestSetup)2 SystemPropertyTestSetup (org.apache.derbyTesting.junit.SystemPropertyTestSetup)2 BufferedReader (java.io.BufferedReader)1 InputStreamReader (java.io.InputStreamReader)1 URL (java.net.URL)1 PreparedStatement (java.sql.PreparedStatement)1 Statement (java.sql.Statement)1 ArrayList (java.util.ArrayList)1 Locale (java.util.Locale)1 ClassLoaderTestSetup (org.apache.derbyTesting.junit.ClassLoaderTestSetup)1 CleanDatabaseTestSetup (org.apache.derbyTesting.junit.CleanDatabaseTestSetup)1 ServerSetup (org.apache.derbyTesting.junit.ServerSetup)1 TestConfiguration (org.apache.derbyTesting.junit.TestConfiguration)1