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/policy/src/test/org/apache/excalibur/policy/reader/test config4.xml ReaderTestCase.java
Date Sat, 28 Sep 2002 02:19:12 GMT
donaldp     2002/09/27 19:19:12

  Modified:    policy/src/test/org/apache/excalibur/policy/reader/test
                        ReaderTestCase.java
  Added:       policy/src/test/org/apache/excalibur/policy/reader/test
                        config4.xml
  Log:
  Add in unit test for null code-base
  
  Revision  Changes    Path
  1.2       +46 -0     jakarta-avalon-excalibur/policy/src/test/org/apache/excalibur/policy/reader/test/ReaderTestCase.java
  
  Index: ReaderTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/policy/src/test/org/apache/excalibur/policy/reader/test/ReaderTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ReaderTestCase.java	25 Sep 2002 12:37:44 -0000	1.1
  +++ ReaderTestCase.java	28 Sep 2002 02:19:11 -0000	1.2
  @@ -145,4 +145,50 @@
           fail( "Should have failed as loaded a " +
                 "configuration with bad version set" );
       }
  +
  +    public void testConfig4()
  +        throws Exception
  +    {
  +        final PolicyMetaData policy = buildFromResource( "config4.xml" );
  +        assertEquals( "Policy KeyStore Count",
  +                      0,
  +                      policy.getKeyStores().length );
  +
  +        assertEquals( "Policy Grant Count",
  +                      1,
  +                      policy.getGrants().length );
  +
  +        final GrantMetaData grant1 = policy.getGrants()[ 0 ];
  +
  +        assertEquals( "grant1.getCodebase()",
  +                      null,
  +                      grant1.getCodebase() );
  +        assertEquals( "grant1.getKeyStore()",
  +                      null,
  +                      grant1.getKeyStore() );
  +        assertEquals( "grant1.getSignedBy()",
  +                      null,
  +                      grant1.getSignedBy() );
  +
  +        assertEquals( "grant1.getPermissions().length",
  +                      1,
  +                      grant1.getPermissions().length );
  +
  +        final PermissionMetaData permission1 = grant1.getPermissions()[ 0 ];
  +        assertEquals( "permission1.getClassname()",
  +                      "java.io.FilePermission",
  +                      permission1.getClassname() );
  +        assertEquals( "permission1.getAction()",
  +                      null,
  +                      permission1.getAction() );
  +        assertEquals( "permission1.getTarget()",
  +                      null,
  +                      permission1.getTarget() );
  +        assertEquals( "permission1.getKeyStore()",
  +                      null,
  +                      permission1.getKeyStore() );
  +        assertEquals( "permission1.getSignedBy()",
  +                      null,
  +                      permission1.getSignedBy() );
  +    }
   }
  
  
  
  1.1                  jakarta-avalon-excalibur/policy/src/test/org/apache/excalibur/policy/reader/test/config4.xml
  
  Index: config4.xml
  ===================================================================
  <policy version="1.0">
  
      <!-- a grant with no codebase -->
      <grant>
          <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