Package org.codehaus.loom.xmlpolicy.builder

Examples of org.codehaus.loom.xmlpolicy.builder.PolicyBuilder


    }

    public void testFailureRetrievingCertForAlias()
        throws Exception
    {
        final PolicyBuilder builder = new TestNoInitPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName() + "sss", null, null,
                                    null, null );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "peter", "default",
                               new PermissionMetaData[]{permission} );
        final KeyStoreMetaData keyStore =
            new KeyStoreMetaData( "default", "http://spice.sourceforge.net", "DoDgY" );
        final PolicyMetaData metaData =
            new PolicyMetaData( new KeyStoreMetaData[]{keyStore}, new GrantMetaData[]{grant} );
        final TestResolver resolver = new TestResolver();
        try
        {
            builder.buildPolicy( metaData, resolver );
            fail( "Expected to fail when creating policy as unable to create store" );
        }
        catch( Exception e )
        {
        }
View Full Code Here


    }

    public void testAliasNoExist()
        throws Exception
    {
        final PolicyBuilder builder = new TestPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName() + "sss", null, null,
                                    null, null );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "peter", "default",
                               new PermissionMetaData[]{permission} );
        final KeyStoreMetaData keyStore =
            new KeyStoreMetaData( "default", "http://spice.sourceforge.net", "DoDgY" );
        final PolicyMetaData metaData =
            new PolicyMetaData( new KeyStoreMetaData[]{keyStore}, new GrantMetaData[]{grant} );
        final TestResolver resolver = new TestResolver();
        try
        {
            builder.buildPolicy( metaData, resolver );
            fail( "Expected to fail when creating policy as unable to load alias" );
        }
        catch( Exception e )
        {
        }
View Full Code Here

    }

    public void testNoKeyStore()
        throws Exception
    {
        final PolicyBuilder builder = new TestPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName(), null, null,
                                    null, null );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "peter", "default",
                               new PermissionMetaData[]{permission} );
        final PolicyMetaData metaData =
            new PolicyMetaData( new KeyStoreMetaData[]{}, new GrantMetaData[]{grant} );
        final TestResolver resolver = new TestResolver();
        try
        {
            builder.buildPolicy( metaData, resolver );
            fail( "Expected to fail when creating policy as missing keystore" );
        }
        catch( Exception e )
        {
        }
View Full Code Here

TOP

Related Classes of org.codehaus.loom.xmlpolicy.builder.PolicyBuilder

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.