Examples of FakePrincipal


Examples of com.sun.jini.test.spec.security.util.FakePrincipal

     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        Class testClass = Class.class;
        Principal testPrin = new FakePrincipal();
        Permission[] testPerm = new Permission[] {
            new PropertyPermission("*", "read") };
        Subject testSubj = new Subject();
        testSubj.getPrincipals().add(testPrin);
        Policy[] testPolicy = new Policy[] {
View Full Code Here

Examples of com.sun.jini.test.spec.security.util.FakePrincipal

        // PASS
        logger.fine("'doPrivileged' method returned " + obj
                + " as expected.");
        final TestPrivilegedAction pa1 = new TestPrivilegedAction(perm1);
        Subject subj = new Subject();
        Principal prin = new FakePrincipal("DoPrivilegedTest");
        subj.getPrincipals().add(prin);
        SubjectDomainCombiner comb = new SubjectDomainCombiner(subj);
        AccessControlContext acc = new AccessControlContext(
                AccessController.getContext(), comb);
        obj = AccessController.doPrivileged(new PrivilegedAction() {
View Full Code Here

Examples of com.sun.jini.test.spec.security.util.FakePrincipal

     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        Set prin = new HashSet();
        prin.add(new FakePrincipal());

        try {
            createAP(null, prin, "listen");

            // FAIL
            throw new TestException(
                    "AuthenticationPermission was created successfully "
                    + "while NullPointerException was expected to be "
                    + "thrown.");
        } catch (NullPointerException npe) {
            // PASS
            logger.fine(npe.toString() + " was thrown as expected.");
        }

        try {
            createAP(prin, prin, null);

            // FAIL
            throw new TestException(
                    "AuthenticationPermission was created successfully "
                    + "while NullPointerException was expected to be "
                    + "thrown.");
        } catch (NullPointerException npe) {
            // PASS
            logger.fine(npe.toString() + " was thrown as expected.");
        }

        try {
            createAP(null, prin, null);

            // FAIL
            throw new TestException(
                    "AuthenticationPermission was created successfully "
                    + "while NullPointerException was expected to be "
                    + "thrown.");
        } catch (NullPointerException npe) {
            // PASS
            logger.fine(npe.toString() + " was thrown as expected.");
        }
        Set testPrin = new HashSet();

        try {
            createAP(testPrin, prin, "listen");

            // FAIL
            throw new TestException(
                    "AuthenticationPermission was created successfully "
                    + "while IllegalArgumentException was expected to be "
                    + "thrown.");
        } catch (IllegalArgumentException iae) {
            // PASS
            logger.fine(iae.toString() + " was thrown as expected.");
        }
        testPrin.add(new FakePrincipal());
        testPrin.add(new Object());

        try {
            createAP(testPrin, prin, "listen");

View Full Code Here

Examples of com.sun.jini.test.spec.security.util.FakePrincipal

        logger.fine("'doPrivileged' method returned " + obj
                + " as expected.");
        final TestPrivilegedExceptionAction pea1
                = new TestPrivilegedExceptionAction(perm1);
        Subject subj = new Subject();
        Principal prin = new FakePrincipal("DoPrivilegedExceptionTest");
        subj.getPrincipals().add(prin);
        SubjectDomainCombiner comb = new SubjectDomainCombiner(subj);
        AccessControlContext acc = new AccessControlContext(
                AccessController.getContext(), comb);
        obj = AccessController.doPrivileged(
View Full Code Here

Examples of com.sun.jini.test.spec.security.util.FakePrincipal

        Permission[] testPerm = new Permission[] {
            new GrantPermission(new SecurityPermission("getPolicy")),
            new GrantPermission(new PropertyPermission("*", "read")),
            new GrantPermission(new FilePermission("*", "read")),
            new GrantPermission(new RuntimePermission("getClassLoader")) };
        Principal testPrin = new FakePrincipal();
        Subject subj = new Subject();
        subj.getPrincipals().add(testPrin);
        TestDynamicPolicyProvider policy =
                new TestDynamicPolicyProvider(testPerm);
        logger.fine("Policy provider is " + policy);
View Full Code Here

Examples of com.sun.jini.test.spec.security.util.FakePrincipal

     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        Class testClass = Class.class;
        Principal[] testPrin = new Principal[] { new FakePrincipal() };
        Permission[] testPerm = new Permission[] {
            new PropertyPermission("*", "read") };
        Policy[] testPolicy = new Policy[] {
            new BasePolicyProvider(),
            new DynamicPolicyProviderThrowingUOE(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.