}
public void testMetaDataWithAPermissionAndMultipleCerts()
throws Exception
{
final PolicyBuilder builder = new TestPolicyBuilder();
final PermissionMetaData permission =
new PermissionMetaData( RuntimePermission.class.getName(), "getFactory", null,
null, null );
final GrantMetaData grant =
new GrantMetaData( "file:/", "jenny,mischelle,jenny", "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();
final Policy policy = builder.buildPolicy( metaData, resolver );
final CodeSource codesource =
new CodeSource( new URL( "file:/" ), new Certificate[]{MockCertificate.JENNY_CERTIFICATE} );
final PermissionCollection permissions = policy.getPermissions( codesource );
final Enumeration enumeration = permissions.elements();
while( enumeration.hasMoreElements() )