avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/loader/src/test/org/apache/excalibur/policy/verifier/test config5.xml VerifierTestCase.java
Date Wed, 25 Sep 2002 11:34:41 GMT
donaldp     2002/09/25 04:34:41

  Modified:    loader/src/java/org/apache/excalibur/policy/verifier
                        PolicyVerifier.java
               loader/src/test/org/apache/excalibur/policy/verifier/test
                        VerifierTestCase.java
  Added:       loader/src/test/org/apache/excalibur/policy/verifier/test
                        config5.xml
  Log:
  Make verifier allow grants with null keystores and add a unit test to enforce this.
  
  Revision  Changes    Path
  1.2       +6 -1      jakarta-avalon-excalibur/loader/src/java/org/apache/excalibur/policy/verifier/PolicyVerifier.java
  
  Index: PolicyVerifier.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/loader/src/java/org/apache/excalibur/policy/verifier/PolicyVerifier.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PolicyVerifier.java	25 Sep 2002 11:25:05 -0000	1.1
  +++ PolicyVerifier.java	25 Sep 2002 11:34:41 -0000	1.2
  @@ -203,6 +203,11 @@
                                             final String keyStoreName )
           throws Exception
       {
  +        //Ignore keystores that are not specified
  +        if( null == keyStoreName )
  +        {
  +            return;
  +        }
           final KeyStoreMetaData[] keyStores = policy.getKeyStores();
           for( int i = 0; i < keyStores.length; i++ )
           {
  
  
  
  1.2       +14 -0     jakarta-avalon-excalibur/loader/src/test/org/apache/excalibur/policy/verifier/test/VerifierTestCase.java
  
  Index: VerifierTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/loader/src/test/org/apache/excalibur/policy/verifier/test/VerifierTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- VerifierTestCase.java	25 Sep 2002 11:25:55 -0000	1.1
  +++ VerifierTestCase.java	25 Sep 2002 11:34:41 -0000	1.2
  @@ -88,6 +88,20 @@
                 "action with null target" );
       }
   
  +    public void testConfig5()
  +        throws Exception
  +    {
  +        try
  +        {
  +            verifyResource( "config5.xml" );
  +        }
  +        catch( final Throwable t )
  +        {
  +            fail( "Expected to pass when not specifying keystore" );
  +        }
  +
  +    }
  +
       private void verifyResource( final String resource )
           throws Exception
       {
  
  
  
  1.1                  jakarta-avalon-excalibur/loader/src/test/org/apache/excalibur/policy/verifier/test/config5.xml
  
  Index: config5.xml
  ===================================================================
  <policy version="1.0">
      <grant code-base="sar:/SAR-INF/lib/*">
          <permission class="java.io.FilePermission"/>
      </grant>
  </policy>
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message