directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vte...@apache.org
Subject svn commit: r354061 - in /directory/authx/trunk: core/src/java/org/apache/authx/authorization/ core/src/java/org/apache/authx/authorization/effect/ core/src/test/org/apache/authx/authentication/ core/src/test/org/apache/authx/authentication/realm/ core...
Date Mon, 05 Dec 2005 13:24:43 GMT
Author: vtence
Date: Mon Dec  5 05:23:26 2005
New Revision: 354061

URL: http://svn.apache.org/viewcvs?rev=354061&view=rev
Log:
Small refactorings. Got rid of Effects class and move static factory methods to Effect. Renamed DefaultRule to more appropriate SImpleRule.

Added:
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/SimpleRule.java
      - copied, changed from r351546, directory/authx/trunk/core/src/java/org/apache/authx/authorization/DefaultRule.java
    directory/authx/trunk/core/src/test/org/apache/authx/authorization/SimpleRuleTest.java
      - copied, changed from r351546, directory/authx/trunk/core/src/test/org/apache/authx/authorization/DefaultRuleTest.java
Removed:
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/DefaultRule.java
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/Effects.java
    directory/authx/trunk/core/src/test/org/apache/authx/authorization/DefaultRuleTest.java
Modified:
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/AuthorizationRequest.java
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/DefaultAuthorizer.java
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/Effect.java
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/PermissionCollection.java
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/PrimitiveRule.java
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/DenyEffect.java
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/DenyOverridesEffect.java
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/FirstApplicableEffect.java
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/GrantEffect.java
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/LastApplicableEffect.java
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/NotApplicableEffect.java
    directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/PermitOverridesEffect.java
    directory/authx/trunk/core/src/test/org/apache/authx/authentication/DefaultAuthenticatorTest.java
    directory/authx/trunk/core/src/test/org/apache/authx/authentication/realm/SameCredentialsBuilderTest.java
    directory/authx/trunk/core/src/test/org/apache/authx/authorization/DefaultAuthorizerTest.java
    directory/authx/trunk/core/src/test/org/apache/authx/authorization/PolicyTest.java
    directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/DenyOverridesEffectTest.java
    directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/FirstApplicableEffectTest.java
    directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/LastApplicableEffectTest.java
    directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/PermitOverridesEffectTest.java
    directory/authx/trunk/script/src/java/org/apache/authx/script/groovy/GroovyRuleLoader.java
    directory/authx/trunk/script/src/java/org/apache/authx/script/xml/AbstractDom4JInformationProviderBuilder.java
    directory/authx/trunk/script/src/java/org/apache/authx/script/xml/Dom4JRoleBuilder.java
    directory/authx/trunk/script/src/java/org/apache/authx/script/xml/ElementBuilder.java
    directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/AbstractRuleBuilder.java
    directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/DenyRuleBuilder.java
    directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/GrantRuleBuilder.java
    directory/authx/trunk/script/src/test/org/apache/authx/script/common/DynamicRuleProxyTest.java
    directory/authx/trunk/script/src/test/org/apache/authx/script/common/ScriptedRuleSetBuilderTest.java
    directory/authx/trunk/script/src/test/org/apache/authx/script/groovy/GroovyRuleLoaderTest.java
    directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JGroupBuilderTest.java
    directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRealmBuilderTest.java
    directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRoleBuilderTest.java
    directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRuleSetBuilderTest.java

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authorization/AuthorizationRequest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authorization/AuthorizationRequest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authorization/AuthorizationRequest.java (original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authorization/AuthorizationRequest.java Mon Dec  5 05:23:26 2005
@@ -58,7 +58,7 @@
 
     public void propagateEffect( AuthorizationRequest other )
     {
-        m_effect.apply( other );
+        m_effect.applyTo( other );
     }
 
     public AuthorizationRequest childRequest( Effect effect )

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authorization/DefaultAuthorizer.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authorization/DefaultAuthorizer.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authorization/DefaultAuthorizer.java (original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authorization/DefaultAuthorizer.java Mon Dec  5 05:23:26 2005
@@ -16,8 +16,6 @@
  */
 package org.apache.authx.authorization;
 
-import org.apache.authx.authorization.effect.Effects;
-
 import javax.security.auth.Subject;
 import java.util.HashMap;
 import java.util.Map;
@@ -31,9 +29,9 @@
     {
         m_ruleSet = ruleSet;
         m_decisions = new HashMap();
-        m_decisions.put( Effects.GRANT, Boolean.TRUE );
-        m_decisions.put( Effects.NOT_APPLICABLE, Boolean.FALSE );
-        m_decisions.put( Effects.DENY, Boolean.FALSE);
+        m_decisions.put( Effect.GRANT, Boolean.TRUE );
+        m_decisions.put( Effect.NOT_APPLICABLE, Boolean.FALSE );
+        m_decisions.put( Effect.DENY, Boolean.FALSE);
     }
 
     public boolean renderDecision( Subject s, Permission p )

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authorization/Effect.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authorization/Effect.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authorization/Effect.java (original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authorization/Effect.java Mon Dec  5 05:23:26 2005
@@ -16,16 +16,33 @@
  */
 package org.apache.authx.authorization;
 
+import org.apache.authx.authorization.effect.GrantEffect;
+import org.apache.authx.authorization.effect.DenyEffect;
+import org.apache.authx.authorization.effect.NotApplicableEffect;
+
 /**
  * @author <a href="mailto:vtence@apache.org">Vincent Tence</a>
  */
-public interface Effect
+public abstract class Effect
 {
-    void apply( AuthorizationRequest request );
+    public static final Effect GRANT = new GrantEffect();
+    public static final Effect DENY = new DenyEffect();
+    public static final Effect NOT_APPLICABLE = new NotApplicableEffect();
+
+    public abstract void applyTo( AuthorizationRequest request );
 
-    Effect permit();
+    public Effect permit()
+    {
+        return this;
+    }
 
-    Effect deny();
+    public Effect deny()
+    {
+        return this;
+    }
 
-    Effect reduce();
+    public Effect reduce()
+    {
+        return this;
+    }
 }

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authorization/PermissionCollection.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authorization/PermissionCollection.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authorization/PermissionCollection.java (original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authorization/PermissionCollection.java Mon Dec  5 05:23:26 2005
@@ -16,8 +16,6 @@
  */
 package org.apache.authx.authorization;
 
-import org.apache.authx.authorization.Permission;
-
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authorization/PrimitiveRule.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authorization/PrimitiveRule.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authorization/PrimitiveRule.java (original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authorization/PrimitiveRule.java Mon Dec  5 05:23:26 2005
@@ -27,6 +27,6 @@
 
     public void evaluate( AuthorizationRequest request )
     {
-        m_effect.apply( request );
+        m_effect.applyTo( request );
     }
 }

Copied: directory/authx/trunk/core/src/java/org/apache/authx/authorization/SimpleRule.java (from r351546, directory/authx/trunk/core/src/java/org/apache/authx/authorization/DefaultRule.java)
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authorization/SimpleRule.java?p2=directory/authx/trunk/core/src/java/org/apache/authx/authorization/SimpleRule.java&p1=directory/authx/trunk/core/src/java/org/apache/authx/authorization/DefaultRule.java&r1=351546&r2=354061&rev=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authorization/DefaultRule.java (original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authorization/SimpleRule.java Mon Dec  5 05:23:26 2005
@@ -16,25 +16,24 @@
  */
 package org.apache.authx.authorization;
 
-import org.apache.authx.authorization.effect.Effects;
-import org.apache.authx.authorization.condition.OrCondition;
 import org.apache.authx.authorization.condition.Conditions;
+import org.apache.authx.authorization.condition.OrCondition;
 
 /**
  * @author <a href="mailto:vtence@apache.org">Vincent Tence</a>
  */
-public class DefaultRule implements Rule
+public class SimpleRule implements Rule
 {
     private Effect m_effect;
     private Condition m_subjectCondition;
     private Condition m_permissionCondition;
 
-    public DefaultRule()
+    public SimpleRule()
     {
-        this( Effects.GRANT );
+        this( Effect.GRANT );
     }
 
-    public DefaultRule( Effect effect )
+    public SimpleRule( Effect effect )
     {
         m_effect = effect;
         m_subjectCondition = Conditions.FALSE;
@@ -60,7 +59,7 @@
     {
         if ( request.affectsSuject( m_subjectCondition ) && request.targetsPermission( m_permissionCondition ) )
         {
-            m_effect.apply( request );
+            m_effect.applyTo( request );
         }
     }
 }

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/DenyEffect.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/DenyEffect.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/DenyEffect.java (original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/DenyEffect.java Mon Dec  5 05:23:26 2005
@@ -22,34 +22,24 @@
 /**
  * @author <a href="mailto:vtence@apache.org">Vincent Tence</a>
  */
-public final class DenyEffect implements Effect
+public final class DenyEffect extends Effect
 {
-    DenyEffect()
+    public DenyEffect()
     {
     }
 
-    public void apply( AuthorizationRequest request )
+    public void applyTo( AuthorizationRequest request )
     {
         request.deny();
     }
 
-    public Effect permit()
-    {
-        return this;
-    }
-
-    public Effect deny()
-    {
-        return this;
-    }
-
-    public Effect reduce()
+    public String toString()
     {
-        return this;
+        return "deny";
     }
 
-    public String toString()
+    public boolean equals( Object obj )
     {
-        return "deny";
+        return obj instanceof DenyEffect;
     }
 }

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/DenyOverridesEffect.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/DenyOverridesEffect.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/DenyOverridesEffect.java (original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/DenyOverridesEffect.java Mon Dec  5 05:23:26 2005
@@ -22,13 +22,13 @@
 /**
  * @author <a href="mailto:vtence@apache.org">Vincent Tence</a>
  */
-public class DenyOverridesEffect implements Effect
+public class DenyOverridesEffect extends Effect
 {
     private final Effect m_effect;
 
     public DenyOverridesEffect()
     {
-        this( Effects.NOT_APPLICABLE );
+        this( Effect.NOT_APPLICABLE );
     }
 
     public DenyOverridesEffect( Effect effect )
@@ -36,19 +36,19 @@
         m_effect = effect;
     }
 
-    public void apply( AuthorizationRequest request )
+    public void applyTo( AuthorizationRequest request )
     {
-        m_effect.apply( request );
+        m_effect.applyTo( request );
     }
 
     public Effect permit()
     {
-        return new DenyOverridesEffect( Effects.GRANT );
+        return new DenyOverridesEffect( Effect.GRANT );
     }
 
     public Effect deny()
     {
-        return Effects.DENY;
+        return Effect.DENY;
     }
 
     public Effect reduce()

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/FirstApplicableEffect.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/FirstApplicableEffect.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/FirstApplicableEffect.java (original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/FirstApplicableEffect.java Mon Dec  5 05:23:26 2005
@@ -22,13 +22,13 @@
 /**
  * @author <a href="mailto:vtence@apache.org">Vincent Tence</a>
  */
-public class FirstApplicableEffect implements Effect
+public class FirstApplicableEffect extends Effect
 {
     private final Effect m_effect;
 
     public FirstApplicableEffect()
     {
-        this( Effects.NOT_APPLICABLE );
+        this( Effect.NOT_APPLICABLE );
     }
 
     protected FirstApplicableEffect( Effect effect )
@@ -36,19 +36,19 @@
         m_effect = effect;
     }
 
-    public void apply( AuthorizationRequest request )
+    public void applyTo( AuthorizationRequest request )
     {
-        m_effect.apply( request );
+        m_effect.applyTo( request );
     }
 
     public Effect permit()
     {
-        return Effects.GRANT;
+        return Effect.GRANT;
     }
 
     public Effect deny()
     {
-        return Effects.DENY;
+        return Effect.DENY;
     }
 
     public Effect reduce()

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/GrantEffect.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/GrantEffect.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/GrantEffect.java (original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/GrantEffect.java Mon Dec  5 05:23:26 2005
@@ -22,30 +22,20 @@
 /**
  * @author <a href="mailto:vtence@apache.org">Vincent Tence</a>
  */
-public final class GrantEffect implements Effect
+public final class GrantEffect extends Effect
 {
-    GrantEffect()
+    public GrantEffect()
     {
     }
 
-    public void apply( AuthorizationRequest request )
+    public void applyTo( AuthorizationRequest request )
     {
         request.grant();
     }
 
-    public Effect permit()
+    public boolean equals( Object obj )
     {
-        return this;
-    }
-
-    public Effect deny()
-    {
-        return this;
-    }
-
-    public Effect reduce()
-    {
-        return this;
+        return obj instanceof GrantEffect;
     }
 
     public String toString()

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/LastApplicableEffect.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/LastApplicableEffect.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/LastApplicableEffect.java (original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/LastApplicableEffect.java Mon Dec  5 05:23:26 2005
@@ -22,13 +22,13 @@
 /**
  * @author <a href="mailto:vtence@apache.org">Vincent Tence</a>
  */
-public class LastApplicableEffect implements Effect
+public class LastApplicableEffect extends Effect
 {
     private final Effect m_effect;
 
     public LastApplicableEffect()
     {
-        this( Effects.NOT_APPLICABLE );
+        this( Effect.NOT_APPLICABLE );
     }
 
     protected LastApplicableEffect( Effect effect )
@@ -36,19 +36,19 @@
         m_effect = effect;
     }
 
-    public void apply( AuthorizationRequest request )
+    public void applyTo( AuthorizationRequest request )
     {
-        m_effect.apply( request );
+        m_effect.applyTo( request );
     }
 
     public Effect permit()
     {
-        return new LastApplicableEffect( Effects.GRANT );
+        return new LastApplicableEffect( Effect.GRANT );
     }
 
     public Effect deny()
     {
-        return new LastApplicableEffect( Effects.DENY );
+        return new LastApplicableEffect( Effect.DENY );
     }
 
     public Effect reduce()

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/NotApplicableEffect.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/NotApplicableEffect.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/NotApplicableEffect.java (original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/NotApplicableEffect.java Mon Dec  5 05:23:26 2005
@@ -22,29 +22,19 @@
 /**
  * @author <a href="mailto:vtence@apache.org">Vincent Tence</a>
  */
-public final class NotApplicableEffect implements Effect
+public final class NotApplicableEffect extends Effect
 {
-    NotApplicableEffect()
+    public NotApplicableEffect()
     {
     }
 
-    public void apply( AuthorizationRequest request )
+    public void applyTo( AuthorizationRequest request )
     {
     }
 
-    public Effect permit()
+    public boolean equals( Object obj )
     {
-        return this;
-    }
-
-    public Effect deny()
-    {
-        return this;
-    }
-
-    public Effect reduce()
-    {
-        return this;
+        return obj instanceof NotApplicableEffect;
     }
 
     public String toString()

Modified: directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/PermitOverridesEffect.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/PermitOverridesEffect.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/PermitOverridesEffect.java (original)
+++ directory/authx/trunk/core/src/java/org/apache/authx/authorization/effect/PermitOverridesEffect.java Mon Dec  5 05:23:26 2005
@@ -22,13 +22,13 @@
 /**
  * @author <a href="mailto:vtence@apache.org">Vincent Tence</a>
  */
-public class PermitOverridesEffect implements Effect
+public class PermitOverridesEffect extends Effect
 {
     private final Effect m_effect;
 
     public PermitOverridesEffect()
     {
-        this( Effects.NOT_APPLICABLE );
+        this( Effect.NOT_APPLICABLE );
     }
 
     protected PermitOverridesEffect( Effect effect )
@@ -36,19 +36,19 @@
         m_effect = effect;
     }
 
-    public void apply( AuthorizationRequest request )
+    public void applyTo( AuthorizationRequest request )
     {
-        m_effect.apply( request );
+        m_effect.applyTo( request );
     }
 
     public Effect permit()
     {
-        return Effects.GRANT;
+        return Effect.GRANT;
     }
 
     public Effect deny()
     {
-        return new PermitOverridesEffect( Effects.DENY );
+        return new PermitOverridesEffect( Effect.DENY );
     }
 
     public Effect reduce()

Modified: directory/authx/trunk/core/src/test/org/apache/authx/authentication/DefaultAuthenticatorTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/test/org/apache/authx/authentication/DefaultAuthenticatorTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/test/org/apache/authx/authentication/DefaultAuthenticatorTest.java (original)
+++ directory/authx/trunk/core/src/test/org/apache/authx/authentication/DefaultAuthenticatorTest.java Mon Dec  5 05:23:26 2005
@@ -41,7 +41,7 @@
 
     protected void setUp() throws Exception
     {
-        m_mockRealm = new Mock( Realm.class );
+        m_mockRealm = mock( Realm.class );
         m_authenticator = new DefaultAuthenticator();
         m_authenticator.addRealm( new EmptyRealm() );
         m_authenticator.addRealm( (Realm) m_mockRealm.proxy() );
@@ -51,7 +51,6 @@
     {
         m_mockRealm.expects( once() ).method( "validateCredentials" ).with( eq( Creds.banana() ) ).will( returnValue( Fruits.banana() ) );
         m_authenticator.authenticate( Creds.banana() );
-        m_mockRealm.verify();
     }
 
     public void testValidatedPrincipalIsAddedToSubject()

Modified: directory/authx/trunk/core/src/test/org/apache/authx/authentication/realm/SameCredentialsBuilderTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/test/org/apache/authx/authentication/realm/SameCredentialsBuilderTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/test/org/apache/authx/authentication/realm/SameCredentialsBuilderTest.java (original)
+++ directory/authx/trunk/core/src/test/org/apache/authx/authentication/realm/SameCredentialsBuilderTest.java Mon Dec  5 05:23:26 2005
@@ -38,11 +38,10 @@
         creds.add( new PasswordCredential( "foo" ) );
         SameCredentialsBuilder builder = new SameCredentialsBuilder( creds );
 
-        Mock mockSelector = new Mock( Selector.class );
+        Mock mockSelector = mock( Selector.class );
 
         mockSelector.expects( once() ).method( "eq" ).with( eq( UsernameCredential.class), eq( new UsernameCredential( "joe" ) ) );
         mockSelector.expects( once() ).method( "eq" ).with( eq( PasswordCredential.class), eq( new PasswordCredential( "foo" ) ) );
         builder.build( ( Selector ) mockSelector.proxy() );
-        mockSelector.verify();
     }
 }

Modified: directory/authx/trunk/core/src/test/org/apache/authx/authorization/DefaultAuthorizerTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/test/org/apache/authx/authorization/DefaultAuthorizerTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/test/org/apache/authx/authorization/DefaultAuthorizerTest.java (original)
+++ directory/authx/trunk/core/src/test/org/apache/authx/authorization/DefaultAuthorizerTest.java Mon Dec  5 05:23:26 2005
@@ -17,7 +17,6 @@
 package org.apache.authx.authorization;
 
 import junit.framework.TestCase;
-import org.apache.authx.authorization.effect.Effects;
 import org.apache.authx.authorization.effect.PermitOverridesEffect;
 
 import javax.security.auth.Subject;
@@ -33,40 +32,40 @@
 
     public void testTakesPositiveDecisionIfRuleSuggestsPermission()
     {
-        m_authorizer = new DefaultAuthorizer( new Policy( Effects.GRANT ) );
+        m_authorizer = new DefaultAuthorizer( new Policy( Effect.GRANT ) );
         assertTrue( m_authorizer.renderDecision( new Subject(), new SomePermission() ) );
     }
 
     public void testTakesNegativeDecisionIfRuleIsNotApplicable()
     {
-        m_authorizer = new DefaultAuthorizer( new Policy( Effects.NOT_APPLICABLE ) );
+        m_authorizer = new DefaultAuthorizer( new Policy( Effect.NOT_APPLICABLE ) );
         assertFalse( m_authorizer.renderDecision( new Subject(), new SomePermission() ) );
     }
 
-    public void testTakesNegativeDecisionIfRuleSuggestDenial()
+    public void testTakesNegativeDecisionIfRuleSuggestsDenial()
     {
-        m_authorizer = new DefaultAuthorizer( new Policy( Effects.DENY ) );
+        m_authorizer = new DefaultAuthorizer( new Policy( Effect.DENY ) );
         assertFalse( m_authorizer.renderDecision( new Subject(), new SomePermission() ) );
     }
 
     public void testCanForceEffectToGrantDecision()
     {
-        m_authorizer = new DefaultAuthorizer( new Policy( Effects.DENY ) );
-        m_authorizer.grantOn( Effects.DENY );
+        m_authorizer = new DefaultAuthorizer( new Policy( Effect.DENY ) );
+        m_authorizer.grantOn( Effect.DENY );
         assertTrue( m_authorizer.renderDecision( new Subject(), new SomePermission() ) );
     }
 
     public void testCanForceEffectToDenyDecision()
     {
-        m_authorizer = new DefaultAuthorizer( new Policy( Effects.NOT_APPLICABLE ) );
-        m_authorizer.denyOn( Effects.NOT_APPLICABLE );
+        m_authorizer = new DefaultAuthorizer( new Policy( Effect.NOT_APPLICABLE ) );
+        m_authorizer.denyOn( Effect.NOT_APPLICABLE );
         assertFalse( m_authorizer.renderDecision( new Subject(), new SomePermission() ) );
     }
 
-    public void testMakesDecisionBasedOnPrimitiveEffect()
+    public void testTakesDecisionBasedOnPrimitiveEffect()
     {
         m_authorizer = new DefaultAuthorizer( new Policy( new PermitOverridesEffect() ) );
-        m_authorizer.denyOn( Effects.NOT_APPLICABLE );
+        m_authorizer.denyOn( Effect.NOT_APPLICABLE );
         assertFalse( m_authorizer.renderDecision( new Subject(), new SomePermission() ) );
     }
 }

Modified: directory/authx/trunk/core/src/test/org/apache/authx/authorization/PolicyTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/test/org/apache/authx/authorization/PolicyTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/test/org/apache/authx/authorization/PolicyTest.java (original)
+++ directory/authx/trunk/core/src/test/org/apache/authx/authorization/PolicyTest.java Mon Dec  5 05:23:26 2005
@@ -16,14 +16,13 @@
  */
 package org.apache.authx.authorization;
 
-import org.apache.authx.authorization.effect.Effects;
-import org.apache.authx.authorization.effect.PermitOverridesEffect;
+import junit.framework.TestCase;
 import org.apache.authx.authorization.effect.LastApplicableEffect;
-import org.jmock.MockObjectTestCase;
+import org.apache.authx.authorization.effect.PermitOverridesEffect;
 
 import javax.security.auth.Subject;
 
-public class PolicyTest extends MockObjectTestCase
+public class PolicyTest extends TestCase
 {
     public void testRendersDefaultDecisionWhenEmpty()
     {
@@ -31,18 +30,18 @@
         AuthorizationRequest request = new AuthorizationRequest( new Subject(), new SomePermission(), new LastApplicableEffect() );
         policy.evaluate( request );
 
-        assertEquals( Effects.NOT_APPLICABLE, request.outcome() );
+        assertEquals( Effect.NOT_APPLICABLE, request.outcome() );
     }
 
     public void testCombinesResultOfContainedRulesEvaluation()
     {
         Policy policy = new Policy( new PermitOverridesEffect() );
-        policy.addRule( new PrimitiveRule( Effects.GRANT ) );
-        policy.addRule( new PrimitiveRule( Effects.DENY ) );
+        policy.addRule( new PrimitiveRule( Effect.GRANT ) );
+        policy.addRule( new PrimitiveRule( Effect.DENY ) );
 
         AuthorizationRequest request = new AuthorizationRequest( new Subject(), new SomePermission(), new LastApplicableEffect() );
         policy.evaluate( request );
 
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
     }
 }

Copied: directory/authx/trunk/core/src/test/org/apache/authx/authorization/SimpleRuleTest.java (from r351546, directory/authx/trunk/core/src/test/org/apache/authx/authorization/DefaultRuleTest.java)
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/test/org/apache/authx/authorization/SimpleRuleTest.java?p2=directory/authx/trunk/core/src/test/org/apache/authx/authorization/SimpleRuleTest.java&p1=directory/authx/trunk/core/src/test/org/apache/authx/authorization/DefaultRuleTest.java&r1=351546&r2=354061&rev=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/test/org/apache/authx/authorization/DefaultRuleTest.java (original)
+++ directory/authx/trunk/core/src/test/org/apache/authx/authorization/SimpleRuleTest.java Mon Dec  5 05:23:26 2005
@@ -20,71 +20,70 @@
 import org.apache.authx.authorization.condition.HasPrincipalCondition;
 import org.apache.authx.authorization.condition.ImpliedPermissionCondition;
 import org.apache.authx.authorization.condition.TrueCondition;
-import org.apache.authx.authorization.effect.Effects;
 import org.apache.authx.authorization.effect.LastApplicableEffect;
 import org.apache.authx.testmodel.Subjects;
 import org.apache.authx.testmodel.Usernames;
-import org.jmock.MockObjectTestCase;
+import junit.framework.TestCase;
 
 /**
  * @author <a href="mailto:vtence@apache.org">Vincent Tence</a>
  */
-public class DefaultRuleTest extends MockObjectTestCase
+public class SimpleRuleTest extends TestCase
 {
-    private DefaultRule m_rule;
+    private SimpleRule m_rule;
 
     public static void main( String[] args )
     {
-        junit.textui.TestRunner.run( DefaultRuleTest.class );
+        junit.textui.TestRunner.run( SimpleRuleTest.class );
     }
 
     protected void setUp() throws Exception
     {
-        m_rule = new DefaultRule();
+        m_rule = new SimpleRule();
     }
 
     public void testEvaluatesToRuleEffectIfTargetVerifiesCondition()
     {
-        m_rule.setEffect( Effects.DENY );
+        m_rule.setEffect( Effect.DENY );
         m_rule.matchSubjects( new HasPrincipalCondition( Usernames.john() ) );
         m_rule.matchPermissions( new ImpliedPermissionCondition( new SomePermission() ) );
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.john(), new SomePermission(), new LastApplicableEffect() );
         m_rule.evaluate( request );
 
-        assertEquals( Effects.DENY, request.outcome() );
+        assertEquals( Effect.DENY, request.outcome() );
     }
 
     public void testSubjectConditionsAreCombinedIntoAnOrOperation()
     {
-        m_rule.setEffect( Effects.GRANT );
+        m_rule.setEffect( Effect.GRANT );
         m_rule.matchSubjects( new HasPrincipalCondition( Usernames.john() ) );
         m_rule.matchSubjects( new HasPrincipalCondition( Usernames.joe() ) );
         m_rule.matchPermissions( new ImpliedPermissionCondition( new SomePermission() ) );
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.john(), new SomePermission(), new LastApplicableEffect() );
         m_rule.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
 
         request = new AuthorizationRequest( Subjects.joe(), new SomePermission(), new LastApplicableEffect() );
         m_rule.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
     }
 
     public void testPermissionConditionsAreCombinedIntoAnOrOperation()
     {
-        m_rule.setEffect( Effects.GRANT );
+        m_rule.setEffect( Effect.GRANT );
         m_rule.matchSubjects( new HasPrincipalCondition( Usernames.john() ) );
         m_rule.matchPermissions( new ImpliedPermissionCondition( new BasicPermission( "foo" ) ) );
         m_rule.matchPermissions( new ImpliedPermissionCondition( new BasicPermission( "bar" ) ) );
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.john(), new BasicPermission( "foo" ), new LastApplicableEffect() );
         m_rule.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
 
         request = new AuthorizationRequest( Subjects.john(), new BasicPermission( "bar" ), new LastApplicableEffect() );
         m_rule.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
     }
 
     public void testIsNotApplicableIfSubjectConditionIsNotVerified()
@@ -94,7 +93,7 @@
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.john(), new SomePermission(), new LastApplicableEffect() );
         m_rule.evaluate( request );
-        assertEquals( Effects.NOT_APPLICABLE, request.outcome() );
+        assertEquals( Effect.NOT_APPLICABLE, request.outcome() );
     }
 
     public void testIsNotApplicableIfPermissionConditionIsNotVerified()
@@ -104,6 +103,6 @@
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.john(), new SomePermission(), new LastApplicableEffect() );
         m_rule.evaluate( request );
-        assertEquals( Effects.NOT_APPLICABLE, request.outcome() );
+        assertEquals( Effect.NOT_APPLICABLE, request.outcome() );
     }
 }

Modified: directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/DenyOverridesEffectTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/DenyOverridesEffectTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/DenyOverridesEffectTest.java (original)
+++ directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/DenyOverridesEffectTest.java Mon Dec  5 05:23:26 2005
@@ -24,7 +24,7 @@
     public void testDefaultsToNotApplicable()
     {
         Effect effect = new DenyOverridesEffect();
-        assertEquals( Effects.NOT_APPLICABLE, effect.reduce() );
+        assertEquals( Effect.NOT_APPLICABLE, effect.reduce() );
     }
 
     public void testCombinedResultIsDenyIfSingleDenyIsEncountered()
@@ -32,13 +32,13 @@
         Effect effect = new DenyOverridesEffect();
         effect = effect.deny();
         effect = effect.permit();
-        assertEquals( Effects.DENY, effect.reduce() );
+        assertEquals( Effect.DENY, effect.reduce() );
     }
 
     public void testCombinedResultIsPermitIfNoDenyAndAtLeastAPermitIsEncountered()
     {
         Effect effect = new DenyOverridesEffect();
         effect = effect.permit();
-        assertEquals( Effects.GRANT, effect.reduce() );
+        assertEquals( Effect.GRANT, effect.reduce() );
     }
 }

Modified: directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/FirstApplicableEffectTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/FirstApplicableEffectTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/FirstApplicableEffectTest.java (original)
+++ directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/FirstApplicableEffectTest.java Mon Dec  5 05:23:26 2005
@@ -24,15 +24,15 @@
     public void testDefaultsToNotApplicable()
     {
         Effect effect = new FirstApplicableEffect();
-        assertEquals( Effects.NOT_APPLICABLE, effect.reduce() );
+        assertEquals( Effect.NOT_APPLICABLE, effect.reduce() );
     }
 
     public void testCombinedResultIsFirstApplicableEffect()
     {
         Effect effect = new FirstApplicableEffect();
-        effect = effect.deny();
         effect = effect.permit();
         effect = effect.deny();
-        assertEquals( Effects.DENY, effect.reduce() );
+        effect = effect.deny();
+        assertEquals( Effect.GRANT, effect.reduce() );
     }
 }

Modified: directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/LastApplicableEffectTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/LastApplicableEffectTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/LastApplicableEffectTest.java (original)
+++ directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/LastApplicableEffectTest.java Mon Dec  5 05:23:26 2005
@@ -24,15 +24,14 @@
     public void testDefaultsToNotApplicable()
     {
         Effect effect = new LastApplicableEffect();
-        assertEquals( Effects.NOT_APPLICABLE, effect.reduce() );
+        assertEquals( Effect.NOT_APPLICABLE, effect.reduce() );
     }
 
     public void testCombinedResultIsLastApplicableEffect()
     {
         Effect effect = new LastApplicableEffect();
-        effect = effect.deny();
         effect = effect.permit();
         effect = effect.deny();
-        assertEquals( Effects.DENY, effect.reduce() );
+        assertEquals( Effect.DENY, effect.reduce() );
     }
 }

Modified: directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/PermitOverridesEffectTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/PermitOverridesEffectTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/PermitOverridesEffectTest.java (original)
+++ directory/authx/trunk/core/src/test/org/apache/authx/authorization/effect/PermitOverridesEffectTest.java Mon Dec  5 05:23:26 2005
@@ -24,7 +24,7 @@
     public void testDefaultsToNotApplicable()
     {
         Effect effect = new PermitOverridesEffect();
-        assertEquals( Effects.NOT_APPLICABLE, effect.reduce() );
+        assertEquals( Effect.NOT_APPLICABLE, effect.reduce() );
     }
 
     public void testCombinedResultIsPermitIfSinglePermitIsEncountered()
@@ -32,13 +32,13 @@
         Effect effect = new PermitOverridesEffect();
         effect = effect.permit();
         effect = effect.deny();
-        assertEquals( Effects.GRANT, effect.reduce() );
+        assertEquals( Effect.GRANT, effect.reduce() );
     }
 
     public void testCombinedResultIsDenyIfNoPermitAndAtLeastADenyIsEncountered()
     {
         Effect effect = new PermitOverridesEffect();
         effect = effect.deny();
-        assertEquals( Effects.DENY, effect.reduce() );
+        assertEquals( Effect.DENY, effect.reduce() );
     }
 }

Modified: directory/authx/trunk/script/src/java/org/apache/authx/script/groovy/GroovyRuleLoader.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/java/org/apache/authx/script/groovy/GroovyRuleLoader.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/java/org/apache/authx/script/groovy/GroovyRuleLoader.java (original)
+++ directory/authx/trunk/script/src/java/org/apache/authx/script/groovy/GroovyRuleLoader.java Mon Dec  5 05:23:26 2005
@@ -57,9 +57,8 @@
     public Rule load( URL scriptURL ) throws IOException, ScriptingException
     {
         Class clazz = m_scriptClassLoader.loadClass( scriptURL );
-        Rule rule = new DynamicRuleProxy( instanciate( clazz ) );
 
-        return rule;
+        return new DynamicRuleProxy( instanciate( clazz ) );
     }
 
     private Object instanciate( Class clazz )
@@ -71,7 +70,7 @@
         }
         catch ( Exception e )
         {
-            throw new ScriptingException( "Failed to instanciate rule from groovy script", e );
+            throw new ScriptingException( "Failed to instanciate rule from script", e );
         }
         return instance;
     }

Modified: directory/authx/trunk/script/src/java/org/apache/authx/script/xml/AbstractDom4JInformationProviderBuilder.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/java/org/apache/authx/script/xml/AbstractDom4JInformationProviderBuilder.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/java/org/apache/authx/script/xml/AbstractDom4JInformationProviderBuilder.java (original)
+++ directory/authx/trunk/script/src/java/org/apache/authx/script/xml/AbstractDom4JInformationProviderBuilder.java Mon Dec  5 05:23:26 2005
@@ -54,14 +54,12 @@
     protected Principal getUserPrincipal( Element element )
     {
         String username = element.attributeValue( "username" );
-        Principal usernamePrincipal = new UsernamePrincipal( username );
-        return usernamePrincipal;
+        return new UsernamePrincipal( username );
     }
 
     protected Principal getGroupPrincipal( Element element )
     {
         String groupName = element.attributeValue( "groupname" );
-        Principal groupPrincipal = new GroupPrincipal( groupName );
-        return groupPrincipal;
+        return new GroupPrincipal( groupName );
     }
 }

Modified: directory/authx/trunk/script/src/java/org/apache/authx/script/xml/Dom4JRoleBuilder.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/java/org/apache/authx/script/xml/Dom4JRoleBuilder.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/java/org/apache/authx/script/xml/Dom4JRoleBuilder.java (original)
+++ directory/authx/trunk/script/src/java/org/apache/authx/script/xml/Dom4JRoleBuilder.java Mon Dec  5 05:23:26 2005
@@ -107,14 +107,12 @@
     private Principal getRolePrincipal( Element element )
     {
         String roleName = element.attributeValue( "rolename" );
-        Principal rolePrincipal = new RolePrincipal( roleName );
-        return rolePrincipal;
+        return new RolePrincipal( roleName );
     }
 
     private Principal getRoleAttribute( Element element )
     {
         String roleName = element.attributeValue( "role" );
-        Principal rolePrincipal = new RolePrincipal( roleName );
-        return rolePrincipal;
+        return new RolePrincipal( roleName );
     }
 }

Modified: directory/authx/trunk/script/src/java/org/apache/authx/script/xml/ElementBuilder.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/java/org/apache/authx/script/xml/ElementBuilder.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/java/org/apache/authx/script/xml/ElementBuilder.java (original)
+++ directory/authx/trunk/script/src/java/org/apache/authx/script/xml/ElementBuilder.java Mon Dec  5 05:23:26 2005
@@ -23,7 +23,7 @@
  * <pre>
  * <code>boolean validate(Element element)</code>
  * </pre>
- * to recursively validates an element tree.
+ * to recursively validate an element tree.
  */
 public interface ElementBuilder
 {

Modified: directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/AbstractRuleBuilder.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/AbstractRuleBuilder.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/AbstractRuleBuilder.java (original)
+++ directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/AbstractRuleBuilder.java Mon Dec  5 05:23:26 2005
@@ -16,7 +16,7 @@
  */
 package org.apache.authx.script.xml.builder;
 
-import org.apache.authx.authorization.DefaultRule;
+import org.apache.authx.authorization.SimpleRule;
 import org.apache.authx.authorization.Effect;
 import org.apache.authx.authorization.Condition;
 import org.dom4j.Element;
@@ -42,7 +42,7 @@
 
     public Object buildFrom( Element e )
     {
-        DefaultRule rule = new DefaultRule( m_effect );
+        SimpleRule rule = new SimpleRule( m_effect );
         setSubjectPredicate( rule, e );
         setPermissionPredicate( rule, e );
         return rule;
@@ -53,7 +53,7 @@
         return ( Condition ) getParent().buildFrom( e );
     }
 
-    private void setPermissionPredicate( DefaultRule rule, Element element )
+    private void setPermissionPredicate( SimpleRule rule, Element element )
     {
         Element permissions = element.element( "permissions" );
         List predicates = permissions.elements();
@@ -65,7 +65,7 @@
         }
     }
 
-    private void setSubjectPredicate( DefaultRule rule, Element element )
+    private void setSubjectPredicate( SimpleRule rule, Element element )
     {
         Element subjects = element.element( "subjects" );
         List predicates = subjects.elements();

Modified: directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/DenyRuleBuilder.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/DenyRuleBuilder.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/DenyRuleBuilder.java (original)
+++ directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/DenyRuleBuilder.java Mon Dec  5 05:23:26 2005
@@ -16,7 +16,7 @@
  */
 package org.apache.authx.script.xml.builder;
 
-import org.apache.authx.authorization.effect.Effects;
+import org.apache.authx.authorization.Effect;
 
 public class DenyRuleBuilder extends AbstractRuleBuilder
 {
@@ -27,6 +27,6 @@
 
     public DenyRuleBuilder( String elementName )
     {
-        super( elementName, Effects.DENY );
+        super( elementName, Effect.DENY );
     }
 }

Modified: directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/GrantRuleBuilder.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/GrantRuleBuilder.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/GrantRuleBuilder.java (original)
+++ directory/authx/trunk/script/src/java/org/apache/authx/script/xml/builder/GrantRuleBuilder.java Mon Dec  5 05:23:26 2005
@@ -16,8 +16,7 @@
  */
 package org.apache.authx.script.xml.builder;
 
-
-import org.apache.authx.authorization.effect.Effects;
+import org.apache.authx.authorization.Effect;
 
 public class GrantRuleBuilder extends AbstractRuleBuilder
 {
@@ -28,6 +27,6 @@
 
     public GrantRuleBuilder( String elementName )
     {
-        super( elementName, Effects.GRANT );
+        super( elementName, Effect.GRANT );
     }
 }

Modified: directory/authx/trunk/script/src/test/org/apache/authx/script/common/DynamicRuleProxyTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/test/org/apache/authx/script/common/DynamicRuleProxyTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/test/org/apache/authx/script/common/DynamicRuleProxyTest.java (original)
+++ directory/authx/trunk/script/src/test/org/apache/authx/script/common/DynamicRuleProxyTest.java Mon Dec  5 05:23:26 2005
@@ -18,7 +18,7 @@
 
 import junit.framework.TestCase;
 import org.apache.authx.authorization.AuthorizationRequest;
-import org.apache.authx.authorization.effect.Effects;
+import org.apache.authx.authorization.Effect;
 import org.apache.authx.script.ScriptClassLoader;
 import org.apache.authx.script.groovy.GroovyScriptClassLoader;
 import org.apache.authx.script.testmodel.Groups;
@@ -44,13 +44,12 @@
         AuthorizationRequest request = new AuthorizationRequest( Subjects.with( Groups.canadians() ), Permissions.anything() );
         rule.evaluate( request );
 
-        assertEquals( Effects.DENY, request.outcome() );
+        assertEquals( Effect.DENY, request.outcome() );
      }
 
     private Class loadGroovyClass( URL scriptURL ) throws IOException
     {
         ScriptClassLoader loader = new GroovyScriptClassLoader();
-        Class groovyClass = loader.loadClass( scriptURL );
-        return groovyClass;
+        return loader.loadClass( scriptURL );
     }
 }

Modified: directory/authx/trunk/script/src/test/org/apache/authx/script/common/ScriptedRuleSetBuilderTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/test/org/apache/authx/script/common/ScriptedRuleSetBuilderTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/test/org/apache/authx/script/common/ScriptedRuleSetBuilderTest.java (original)
+++ directory/authx/trunk/script/src/test/org/apache/authx/script/common/ScriptedRuleSetBuilderTest.java Mon Dec  5 05:23:26 2005
@@ -19,7 +19,7 @@
 import org.apache.authx.authorization.PrimitiveRule;
 import org.apache.authx.authorization.Rule;
 import org.apache.authx.authorization.RuleSet;
-import org.apache.authx.authorization.effect.Effects;
+import org.apache.authx.authorization.Effect;
 import org.jmock.Mock;
 import org.jmock.MockObjectTestCase;
 
@@ -36,18 +36,16 @@
     public void testLoadsRulesAndBuildsRuleSet() throws IOException
     {
         URL scriptURL = getClass().getResource( "canadians.groovy" );
-        Mock mockLoader = new Mock( ScriptedRuleLoader.class );
-        Rule rule = new PrimitiveRule( Effects.GRANT );
+        Mock mockLoader = mock( ScriptedRuleLoader.class );
+        Rule rule = new PrimitiveRule( Effect.GRANT );
         mockLoader.stubs().method( "load" ).with( eq( scriptURL ) ).will( returnValue( rule ) );
 
         ScriptedRuleSetBuilder builder = new ScriptedRuleSetBuilder( loader( mockLoader ) );
         builder.addScript( scriptURL );
-        Mock mockPolicy = new Mock( RuleSet.class );
+        Mock mockPolicy = mock( RuleSet.class );
         mockPolicy.expects( once() ).method( "addRule" ).with( eq( rule ) );
 
         builder.buildRuleSet( policy( mockPolicy ) );
-
-        mockPolicy.verify();
     }
 
     private RuleSet policy( Mock mockPolicy )

Modified: directory/authx/trunk/script/src/test/org/apache/authx/script/groovy/GroovyRuleLoaderTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/test/org/apache/authx/script/groovy/GroovyRuleLoaderTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/test/org/apache/authx/script/groovy/GroovyRuleLoaderTest.java (original)
+++ directory/authx/trunk/script/src/test/org/apache/authx/script/groovy/GroovyRuleLoaderTest.java Mon Dec  5 05:23:26 2005
@@ -19,7 +19,7 @@
 import junit.framework.TestCase;
 import org.apache.authx.authorization.AuthorizationRequest;
 import org.apache.authx.authorization.Rule;
-import org.apache.authx.authorization.effect.Effects;
+import org.apache.authx.authorization.Effect;
 import org.apache.authx.script.testmodel.Groups;
 import org.apache.authx.script.testmodel.Permissions;
 import org.apache.authx.script.testmodel.Subjects;
@@ -43,7 +43,7 @@
         AuthorizationRequest request = new AuthorizationRequest( Subjects.with( Groups.geeks() ), Permissions.anything() );
         rule.evaluate( request );
         
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
     }
 
 }

Modified: directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JGroupBuilderTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JGroupBuilderTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JGroupBuilderTest.java (original)
+++ directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JGroupBuilderTest.java Mon Dec  5 05:23:26 2005
@@ -37,51 +37,45 @@
     {
         Dom4JGroupBuilder builder = Dom4JGroupBuilder.fromReader( new StringReader( userWithTwoGroups() ) );
 
-        Mock mockProvider = new Mock( MutableInformationProvider.class );
+        Mock mockProvider = mock( MutableInformationProvider.class );
         mockProvider.expects( once() ).method( "addAttribute" ).with( eq( Usernames.joe() ), eq( Groups.men() ) ).will( returnValue( true ) );
         mockProvider.expects( once() ).method( "addAttribute" ).with( eq( Usernames.joe() ), eq( Groups.geeks() ) ).will( returnValue( true ) );
 
         builder.buildProvider( ( MutableInformationProvider ) mockProvider.proxy() );
-
-        mockProvider.verify();
     }
 
     private String userWithTwoGroups()
     {
-        String content = "<?xml version=\"1.0\"?>\n"
+        return "<?xml version=\"1.0\"?>\n"
                 + "<groups>\n"
                 + "    <user username=\"joeblow\" group=\"men\"/>\n"
                 + "    <user username=\"joeblow\" group=\"geeks\"/>\n"
                 + "</groups>";
-        return content;
     }
 
     public void testAddsGroupAttributesToGroups() throws Exception
     {
         Dom4JGroupBuilder builder = Dom4JGroupBuilder.fromReader( new StringReader( groupWithTwoGroups() ) );
 
-        Mock mockProvider = new Mock( MutableInformationProvider.class );
+        Mock mockProvider = mock( MutableInformationProvider.class );
         mockProvider.expects( once() ).method( "addAttribute" ).with( eq( Groups.canadians() ), eq( Groups.men() ) ).will( returnValue( true ) );
         mockProvider.expects( once() ).method( "addAttribute" ).with( eq( Groups.canadians() ), eq( Groups.geeks() ) ).will( returnValue( true ) );
 
         builder.buildProvider( ( MutableInformationProvider ) mockProvider.proxy() );
-
-        mockProvider.verify();
     }
 
     private String groupWithTwoGroups()
     {
-        String content = "<?xml version=\"1.0\"?>\n"
+        return "<?xml version=\"1.0\"?>\n"
                 + "<groups>\n"
                 + "    <group groupname=\"canadians\" group=\"men\"/>\n"
                 + "    <group groupname=\"canadians\" group=\"geeks\"/>\n"
                 + "</groups>";
-        return content;
     }
 
     public void testNotifiesMonitorWhenDuplicateAttributesAreFound() throws Exception
     {
-        Mock mockMonitor = new Mock( InformationProviderBuilderMonitor.class );
+        Mock mockMonitor = mock( InformationProviderBuilderMonitor.class );
         Dom4JGroupBuilder builder = Dom4JGroupBuilder.fromReader( new StringReader( twiceSameAttribute() ),
                 ( InformationProviderBuilderMonitor ) mockMonitor.proxy() );
         AttributeProvider provider = new AttributeProvider();
@@ -89,22 +83,20 @@
         mockMonitor.expects( once() ).method( "duplicateAttribute" ).with( eq( Usernames.joe() ), eq( Groups.men() ) );
 
         builder.buildProvider( provider );
-        mockMonitor.verify();
     }
 
     private String twiceSameAttribute()
     {
-        String content = "<?xml version=\"1.0\"?>\n"
+        return "<?xml version=\"1.0\"?>\n"
                 + "<groups>\n"
                 + "    <user username=\"joeblow\" group=\"men\"/>\n"
                 + "    <user username=\"joeblow\" group=\"men\"/>\n"
                 + "</groups>";
-        return content;
     }
 
     public void testNotifiesMonitorWhenCyclicAssociationsAreFound() throws Exception
     {
-        Mock mockMonitor = new Mock( InformationProviderBuilderMonitor.class );
+        Mock mockMonitor = mock( InformationProviderBuilderMonitor.class );
         Dom4JGroupBuilder builder = Dom4JGroupBuilder.fromReader( new StringReader( withCyclicAssociation() ),
                 ( InformationProviderBuilderMonitor ) mockMonitor.proxy() );
         AttributeProvider provider = new AttributeProvider();
@@ -113,17 +105,15 @@
         mockMonitor.expects( once() ).method( "cyclicAssociation" ).with( new CyclicAssociationExceptionConstraint( expected ) );
 
         builder.buildProvider( provider );
-        mockMonitor.verify();
     }
 
     private String withCyclicAssociation()
     {
-        String content = "<?xml version=\"1.0\"?>\n"
+        return "<?xml version=\"1.0\"?>\n"
                 + "<groups>\n"
                 + "    <group groupname=\"canadians\" group=\"men\"/>\n"
                 + "    <group groupname=\"men\" group=\"canadians\"/>\n"
                 + "</groups>";
-        return content;
     }
 
     public static class CyclicAssociationExceptionConstraint implements Constraint

Modified: directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRealmBuilderTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRealmBuilderTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRealmBuilderTest.java (original)
+++ directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRealmBuilderTest.java Mon Dec  5 05:23:26 2005
@@ -42,45 +42,39 @@
     {
         Dom4JRealmBuilder builder = Dom4JRealmBuilder.fromReader( new StringReader( realmWithTwoIdentities() ) );
 
-        Mock mockRealm = new Mock( MutableRealm.class );
+        Mock mockRealm = mock( MutableRealm.class );
         mockRealm.expects( once() ).method( "addIdentity" ).with( eq( johnCredentials() ) );
         mockRealm.expects( once() ).method( "addIdentity" ).with( eq( janeCredentials() ) );
 
         builder.buildRealm( ( MutableRealm ) mockRealm.proxy() );
-
-        mockRealm.verify();
     }
 
     private String realmWithTwoIdentities()
     {
-        String content = "<?xml version=\"1.0\"?>\n"
+        return "<?xml version=\"1.0\"?>\n"
                 + "<realm>\n"
                 + "    <user username=\"john\" password=\"doe\"/>\n"
                 + "    <user username=\"jane\" password=\"doe\"/>\n"
                 + "</realm>";
-        return content;
     }
 
     public void testNotifiesMonitorIfDuplicateIdentitiesAreFound() throws Exception
     {
-        Mock mockMonitor = new Mock( RealmBuilderMonitor.class );
+        Mock mockMonitor = mock( RealmBuilderMonitor.class );
         Dom4JRealmBuilder builder = Dom4JRealmBuilder.fromReader( new StringReader( realmWithDuplicateIdentity() ),
                 ( RealmBuilderMonitor ) mockMonitor.proxy() );
 
         mockMonitor.expects( once() ).method( "duplicateIdentity" );
         builder.buildRealm( new MemoryRealm( new UsernamePasswordAuthentication() ) );
-
-        mockMonitor.verify();
     }
 
     private String realmWithDuplicateIdentity()
     {
-        String content = "<?xml version=\"1.0\"?>\n"
+        return "<?xml version=\"1.0\"?>\n"
                 + "<realm>\n"
                 + "    <user username=\"john\" password=\"doe\"/>\n"
                 + "    <user username=\"john\" password=\"doe\"/>\n"
                 + "</realm>";
-        return content;
     }
 
     private CredentialSet johnCredentials()

Modified: directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRoleBuilderTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRoleBuilderTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRoleBuilderTest.java (original)
+++ directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRoleBuilderTest.java Mon Dec  5 05:23:26 2005
@@ -31,70 +31,61 @@
     {
         Dom4JRoleBuilder builder = Dom4JRoleBuilder.fromReader( new StringReader( userWithTwoRoles() ) );
 
-        Mock mockProvider = new Mock( MutableInformationProvider.class );
+        Mock mockProvider = mock( MutableInformationProvider.class );
         mockProvider.expects( once() ).method( "addAttribute" ).with( eq( Usernames.joe() ), eq( Roles.user() ) ).will( returnValue( true ) );
         mockProvider.expects( once() ).method( "addAttribute" ).with( eq( Usernames.joe() ), eq( Roles.developer() ) ).will( returnValue( true ) );
 
         builder.buildProvider( ( MutableInformationProvider ) mockProvider.proxy() );
-
-        mockProvider.verify();
     }
 
     private String userWithTwoRoles()
     {
-        String content = "<?xml version=\"1.0\"?>\n"
+        return "<?xml version=\"1.0\"?>\n"
                 + "<roles>\n"
                 + "    <user username=\"joeblow\" role=\"user\"/>\n"
                 + "    <user username=\"joeblow\" role=\"developer\"/>\n"
                 + "</roles>";
-        return content;
     }
 
     public void testAddsRoleAttributesToGroups() throws Exception
     {
         Dom4JRoleBuilder builder = Dom4JRoleBuilder.fromReader( new StringReader( groupsWithRoles() ) );
 
-        Mock mockProvider = new Mock( MutableInformationProvider.class );
+        Mock mockProvider = mock( MutableInformationProvider.class );
         mockProvider.expects( once() ).method( "addAttribute" ).with( eq( Groups.men() ), eq( Roles.user() ) ).will( returnValue( true ) );
         mockProvider.expects( once() ).method( "addAttribute" ).with( eq( Groups.geeks() ), eq( Roles.developer() ) ).will( returnValue( true ) );
         mockProvider.expects( once() ).method( "addAttribute" ).with( eq( Groups.geeks() ), eq( Roles.tester() ) ).will( returnValue( true ) );
 
         builder.buildProvider( ( MutableInformationProvider ) mockProvider.proxy() );
-
-        mockProvider.verify();
     }
 
     private String groupsWithRoles()
     {
-        String content = "<?xml version=\"1.0\"?>\n"
+        return "<?xml version=\"1.0\"?>\n"
                 + "<roles>\n"
                 + "    <group groupname=\"men\" role=\"user\"/>\n"
                 + "    <group groupname=\"geeks\" role=\"developer\"/>\n"
                 + "    <group groupname=\"geeks\" role=\"tester\"/>\n"
                 + "</roles>";
-        return content;
     }
 
     public void testAddsRoleAttributesToRoles() throws Exception
     {
         Dom4JRoleBuilder builder = Dom4JRoleBuilder.fromReader( new StringReader( roleWithTwoRoles() ) );
 
-        Mock mockProvider = new Mock( MutableInformationProvider.class );
+        Mock mockProvider = mock( MutableInformationProvider.class );
         mockProvider.expects( once() ).method( "addAttribute" ).with( eq( Roles.developer() ), eq( Roles.user() ) ).will( returnValue( true ) );
         mockProvider.expects( once() ).method( "addAttribute" ).with( eq( Roles.developer() ), eq( Roles.tester() ) ).will( returnValue( true ) );
 
         builder.buildProvider( ( MutableInformationProvider ) mockProvider.proxy() );
-
-        mockProvider.verify();
     }
 
     private String roleWithTwoRoles()
     {
-        String content = "<?xml version=\"1.0\"?>\n"
+        return "<?xml version=\"1.0\"?>\n"
                 + "<roles>\n"
                 + "    <role rolename=\"developer\" role=\"user\"/>\n"
                 + "    <role rolename=\"developer\" role=\"tester\"/>\n"
                 + "</roles>";
-        return content;
     }
 }

Modified: directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRuleSetBuilderTest.java
URL: http://svn.apache.org/viewcvs/directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRuleSetBuilderTest.java?rev=354061&r1=354060&r2=354061&view=diff
==============================================================================
--- directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRuleSetBuilderTest.java (original)
+++ directory/authx/trunk/script/src/test/org/apache/authx/script/xml/Dom4JRuleSetBuilderTest.java Mon Dec  5 05:23:26 2005
@@ -19,8 +19,8 @@
 import junit.framework.TestCase;
 import org.apache.authx.authorization.Policy;
 import org.apache.authx.authorization.AuthorizationRequest;
+import org.apache.authx.authorization.Effect;
 import org.apache.authx.authorization.effect.DenyOverridesEffect;
-import org.apache.authx.authorization.effect.Effects;
 import org.apache.authx.authorization.effect.PermitOverridesEffect;
 import org.apache.authx.authorization.effect.LastApplicableEffect;
 import org.apache.authx.script.testmodel.Groups;
@@ -62,7 +62,7 @@
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.anybody(), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.DENY, request.outcome() );
+        assertEquals( Effect.DENY, request.outcome() );
     }
 
     public void testHasBuiltInSupportForRulingOnUsernames() throws Exception
@@ -85,7 +85,7 @@
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.joe(), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
     }
 
     public void testHasBuiltInSupportForRulingOnGroups() throws Exception
@@ -108,7 +108,7 @@
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.with( Groups.canadians() ), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
     }
 
     public void testHasBuiltInSupportForRulingOnRoles() throws Exception
@@ -131,7 +131,7 @@
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.with( Roles.developer() ), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
     }
 
     public void testPredicatesCanBeRegisteredToExtendRuling() throws Exception
@@ -155,7 +155,7 @@
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.withGreenEyes(), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
     }
 
     public void testLastRegisteredBuilderWins() throws Exception
@@ -179,7 +179,7 @@
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.anybody(), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.NOT_APPLICABLE, request.outcome() );
+        assertEquals( Effect.NOT_APPLICABLE, request.outcome() );
     }
 
     public void testMultiplePredicatesAreCombinedWithAnOrOperation() throws Exception
@@ -203,15 +203,15 @@
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.joe(), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
 
         request = new AuthorizationRequest( Subjects.with( Groups.canadians() ), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
 
         request = new AuthorizationRequest( Subjects.with( Roles.developer() ), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.NOT_APPLICABLE, request.outcome() );
+        assertEquals( Effect.NOT_APPLICABLE, request.outcome() );
     }
 
     public void testHasBuiltInSupportForAndOperationOnPredicates() throws Exception
@@ -237,15 +237,15 @@
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.joe(), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.NOT_APPLICABLE, request.outcome() );
+        assertEquals( Effect.NOT_APPLICABLE, request.outcome() );
 
         request = new AuthorizationRequest( Subjects.with( Roles.developer() ), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.NOT_APPLICABLE, request.outcome() );
+        assertEquals( Effect.NOT_APPLICABLE, request.outcome() );
 
         request = new AuthorizationRequest( Subjects.with( Usernames.joe(), Roles.developer() ), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
     }
 
     public void testHasBuiltInSupportForOrOperationOnPredicates() throws Exception
@@ -271,15 +271,15 @@
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.joe(), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
 
         request = new AuthorizationRequest( Subjects.with( Groups.geeks() ), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
 
         request = new AuthorizationRequest( Subjects.with( Roles.developer() ), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.NOT_APPLICABLE, request.outcome() );
+        assertEquals( Effect.NOT_APPLICABLE, request.outcome() );
     }
 
     public void testSubjectIsAnAliasForAndOperation() throws Exception
@@ -305,14 +305,14 @@
 
         AuthorizationRequest request = new AuthorizationRequest( Subjects.joe(), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.NOT_APPLICABLE, request.outcome() );
+        assertEquals( Effect.NOT_APPLICABLE, request.outcome() );
 
         request = new AuthorizationRequest( Subjects.with( Roles.developer() ), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.NOT_APPLICABLE, request.outcome() );
+        assertEquals( Effect.NOT_APPLICABLE, request.outcome() );
 
         request = new AuthorizationRequest( Subjects.with( Usernames.joe(), Roles.developer() ), Permissions.anything(), new LastApplicableEffect() );
         policy.evaluate( request );
-        assertEquals( Effects.GRANT, request.outcome() );
+        assertEquals( Effect.GRANT, request.outcome() );
     }
 }



Mime
View raw message