KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > loom > xmlpolicy > builder > TestNoInitPolicyBuilder


1 /*
2  * Copyright (C) The Spice Group. All rights reserved.
3  *
4  * This software is published under the terms of the Spice
5  * Software License version 1.1, a copy of which has been included
6  * with this distribution in the LICENSE.txt file.
7  */

8 package org.codehaus.loom.xmlpolicy.builder;
9
10 import java.security.KeyStore JavaDoc;
11 import java.net.URL JavaDoc;
12 import java.util.HashMap JavaDoc;
13
14 import org.codehaus.loom.xmlpolicy.builder.PolicyBuilder;
15
16 /**
17  *
18  * @author Peter Donald
19  * @version $Revision: 1.1 $ $Date: 2004/04/19 22:20:26 $
20  */

21 class TestNoInitPolicyBuilder
22     extends PolicyBuilder
23 {
24     protected KeyStore JavaDoc createKeyStore( String JavaDoc type,
25                                        URL JavaDoc url )
26         throws Exception JavaDoc
27     {
28         if( url.equals( new URL JavaDoc( "http://spice.sourceforge.net" ) ) )
29         {
30             final HashMap JavaDoc certs = new HashMap JavaDoc();
31             certs.put( "jenny", MockCertificate.JENNY_CERTIFICATE );
32             certs.put( "mischelle", MockCertificate.MISCHELLE_CERTIFICATE );
33             certs.put( "george", MockCertificate.GEORGE_CERTIFICATE );
34             return new MockNoInitKeyStore( certs );
35         }
36         else
37         {
38             throw new Exception JavaDoc( "Unable to create keystore " + url );
39         }
40     }
41 }
42
Popular Tags