Package org.apache.derbyTesting.junit

Examples of org.apache.derbyTesting.junit.SecurityManagerSetup


    // as well as write for the trace files.
    private static Test decorateWithPolicy(Test test) {
        //
        // Install a security manager using the initial policy file.
        //
        return new SecurityManagerSetup(test, POLICY_FILE_NAME);
    }
View Full Code Here


    private static Test decorateTest() {
        Test test = TestConfiguration.clientServerSuite(SysinfoTest.class);

        // Install a security manager using the initial policy file.
        return TestConfiguration.singleUseDatabaseDecorator(
                new SecurityManagerSetup(test, POLICY_FILE_NAME));
    }
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));
        }

        // We need to manipulate private and final fields in order to test
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

    }


    private static Test makeTest(String fixture, String policy) {
        Test t =  new MissingPermissionsTest(fixture);
        t = new SecurityManagerSetup(t, policy);
        final Properties props = new Properties();
        props.setProperty("derby.connection.requireAuthentication", "true");
        props.setProperty("derby.database.sqlAuthorization", "true");
        props.setProperty("derby.authentication.provider", "BUILTIN");
        props.setProperty("derby.user.APP", "APPPW");
View Full Code Here

        test = TestConfiguration.clientServerDecorator(test);

        // Install a security manager using the special policy file.
        // Grant ALL FILES execute, and getPolicy permissions,
        // as well as write for the trace files.
        test = new SecurityManagerSetup(test, POLICY_FILE_NAME);

        // return suite; to ensure that nothing interferes with setting of
        // properties, wrap in singleUseDatabaseDecorator
        return TestConfiguration.singleUseDatabaseDecorator(test);
    }
View Full Code Here

        }
        Class klass = Derby5937SlaveShutdownTest.class;
        // The default security policy doesn't allow derby.jar to do
        // networking, which is needed for replication, so install a custom
        // policy for this test.
        return new SecurityManagerSetup(
            TestConfiguration.singleUseDatabaseDecorator(
                TestConfiguration.embeddedSuite(klass), MASTER_DB),
            klass.getName().replace('.', '/') + ".policy", true);
    }
View Full Code Here

        Test test = TestConfiguration.clientServerDecorator(
                new BaseTestSuite(NetworkServerControlApiTest.class));
        //
        // Install a security manager using the initial policy file.
        //
        return new SecurityManagerSetup(test, POLICY_FILE_NAME);
    }
View Full Code Here

                                 "client or server is missing");
        }
        BaseTestSuite suite = new BaseTestSuite();
        addVersionCombinations(suite);
        TestConfiguration config = TestConfiguration.getCurrent();
        return new SecurityManagerSetup(
                new ServerSetup(suite, "localhost", config.getPort()),
                // Need permission for getProtectionDomain to determine what
                // to put on the classpath for the spawned process(es).
                VersionCombinationConfigurator.class.getName().
                    replaceAll("\\.", "/") + ".policy",
View Full Code Here

    public ShutdownWithoutDeregisterPermissionTest(String name) {
        super(name);
    }

    public static Test suite() {
        return new SecurityManagerSetup(
                TestConfiguration.embeddedSuite(
                        ShutdownWithoutDeregisterPermissionTest.class),
                "org/apache/derbyTesting/functionTests/tests/engine/" +
                "noDeregisterPermission.policy");
    }
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.