Package org.codehaus.loom.xmlpolicy.runtime

Examples of org.codehaus.loom.xmlpolicy.runtime.DefaultPolicy.refresh()


        final AllPermission allPermission = new AllPermission();
        final HashMap grants = new HashMap();
        grants.put( codeSource, new Permission[]{allPermission} );

        final Policy policy = new DefaultPolicy( grants );
        policy.refresh();
        final PermissionCollection resultPermissions = policy.getPermissions( codeSource );
        final Enumeration enumeration = resultPermissions.elements();
        while( enumeration.hasMoreElements() )
        {
            final Permission permission = (Permission)enumeration.nextElement();
View Full Code Here


        final AllPermission allPermission = new AllPermission();
        final HashMap grants = new HashMap();
        grants.put( codeSource, new Permission[]{allPermission} );

        final Policy policy = new DefaultPolicy( grants );
        policy.refresh();
        final PermissionCollection resultPermissions = policy.getPermissions( new CodeSource( null, new Certificate[ 0 ] ) );
        final Enumeration enumeration = resultPermissions.elements();
        assertEquals( "Permissions for codeSource" + codeSource,
                      false, enumeration.hasMoreElements() );
    }
View Full Code Here

    public void testPolicyAccessPermissionForNonSpecifiedCodeBase()
        throws Exception
    {
        final Policy policy = new DefaultPolicy();
        policy.refresh();

        final URL url = new URL( "http://spice.sourceforge.net/-" );
        final CodeSource codeSource = new CodeSource( url, new Certificate[ 0 ] );
        final PermissionCollection permissions = policy.getPermissions( codeSource );
        assertEquals( "Expect no permissions for http://...", false, permissions.elements().hasMoreElements() );
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.