Examples of SCSSecurityManager


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

        }

        // PASS
        logger.fine("Method works as expected.");
        logger.fine("Set security manager to SCSSecurityManager.");
        SCSSecurityManager sm = new SCSSecurityManager();
        System.setSecurityManager(sm);
        policy.resetCallsNum();
        sc = Security.getContext();

        if (sm.getCallsNum() != 1) {
            // FAIL
            throw new TestException(
                    "'getContext' method of installed security manager was "
                    + "called " + sm.getCallsNum() + " times while 1 "
                    + "call was expected.");
        }

        if (policy.getCallsNum() != 0) {
            // FAIL
            throw new TestException(
                    "'getContext' method of installed policy provider was "
                    + "called " + policy.getCallsNum()
                    + " times while no calls were expected.");
        }

        if (!sc.equals(sm.getContext())) {
            // FAIL
            throw new TestException(
                    "'Security.getContext()' method returned " + sc
                    + " SecurityPolicy while " + sm.getContext()
                    + " was expected.");
        }

        // PASS
        logger.fine("Method works as expected.");
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.