Package org.apache.derbyTesting.junit

Examples of org.apache.derbyTesting.junit.SecurityManagerSetup


    private static Test decorateWithPolicy(Test test) {
        String serverPolicyName = makeServerPolicyName();
        //
        // Install a security manager using the initial policy file.
        //
        test = new SecurityManagerSetup(test,serverPolicyName );
        // Copy over the policy file we want to use.
        //
        test = new SupportFilesSetup(
                test, null, new String[] {POLICY_FILE_NAME},
                null, new String[] {TARGET_POLICY_FILE_NAME}
View Full Code Here


        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.
        test = new SecurityManagerSetup(test, policyName);

        // Copy over the policy file we want to use.
        String POLICY_FILE_NAME=
            "functionTests/tests/store/Derby3980DeadlockTest.policy";
View Full Code Here

        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 ) );
View Full Code Here

        Test                                        test = undecoratedTest;

        //
        // Install a security manager using the initial policy file.
        //
        test = new SecurityManagerSetup( test, undecoratedTest.makeServerPolicyName() );
       
        //
        // Set up authorization with a DBO and non-DBO user
        //
        test = TestConfiguration.sqlAuthorizationDecorator
View Full Code Here

                }
            };

        if ( hasSecurityManager )
        {
            return new SecurityManagerSetup( test, "org/apache/derbyTesting/functionTests/tests/jdbc4/noAbortPermission.policy" );
        }
        else
        {
            return SecurityManagerSetup.noSecurityManager( test );
        }
View Full Code Here

        String serverPolicyName = new NetworkServerControlApiTest("test").makeServerPolicyName();
        Test test = TestConfiguration.clientServerSuite(NetworkServerControlApiTest.class);
        //
        // Install a security manager using the initial policy file.
        //
        test = new SecurityManagerSetup( test,serverPolicyName );
       
       
        //
        // Copy over the policy file we want to use.
        //
View Full Code Here

                SystemPrivilegesPermissionTest.class,
                "SystemPrivilegesPermissionTest");
       
        if (SecurityManagerSetup.JVM_HAS_SUBJECT_AUTHORIZATION)
        {
            suite.addTest(new SecurityManagerSetup(
                new SystemPrivilegesPermissionTest("policyTestSystemGrants"),
                POLICY_FILE_NAME));
        }
        return suite;
    }
View Full Code Here

        suite.addTest(
            new SystemPrivilegesPermissionTest("testSystemPermission"));
        // the DatabasePermission test attempts to canonicalize various
        // directory path names and requires an all-files-read-permission,
        // which is not granted by default derby_tests.policy
        suite.addTest(new SecurityManagerSetup(
            new SystemPrivilegesPermissionTest("testDatabasePermission"),
            POLICY_FILE_NAME1));

        // add authorization tests for security permissions; requires
        // class javax.security.auth.Subject, which is not available
        // on all JVM platforms
        if (SecurityManagerSetup.JVM_HAS_SUBJECT_AUTHORIZATION) {
            suite.addTest(new SecurityManagerSetup(
                new SystemPrivilegesPermissionTest("policyTestSystemPermissionGrants"),
                     POLICY_FILE_NAME));
            suite.addTest(new SecurityManagerSetup(
                new SystemPrivilegesPermissionTest("policyTestDatabasePermissionGrants"),
                     POLICY_FILE_NAME));
        }

        return suite;
View Full Code Here

TOP

Related Classes of org.apache.derbyTesting.junit.SecurityManagerSetup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.