[java-identity-provider COMMIT] in /trunk/idp-attribute-filter-impl/src: main/java/net/shibboleth/idp/attribute/filte...

noreply at shibboleth.net noreply at shibboleth.net
Mon Mar 26 11:09:10 BST 2012


Author: rdw
Date: Mon Mar 26 11:09:10 2012
New Revision: 4136

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4136&view=rev
Log:
Update and extend tests to use the helper classes (Function/Predicate/Component) in java-support.

Modified:
    trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filtering/impl/matcher/AttributeValuePredicateMatcher.java
    trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filtering/impl/matcher/AbstractComposedMatcherTest.java
    trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filtering/impl/matcher/AttributeValuePredicateMatcherTest.java
    trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filtering/impl/matcher/NotMatcherTest.java

Modified: trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filtering/impl/matcher/AttributeValuePredicateMatcher.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filtering/impl/matcher/AttributeValuePredicateMatcher.java?rev=4136&r1=4135&r2=4136&view=diff
==============================================================================
--- trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filtering/impl/matcher/AttributeValuePredicateMatcher.java (original)
+++ trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filtering/impl/matcher/AttributeValuePredicateMatcher.java Mon Mar 26 11:09:10 2012
@@ -67,7 +67,6 @@
                     matchedValues.add(value);
                 }
             } catch (Exception e) {
-                // TODO RDW Work out how to provoke this path when nothing inside throws an exception, just errors
                 log.debug("Attribute value '{}' of type '{}' caused an error while being evaluated '{}':\n{}",
                         new Object[] {value, value.getClass().getName(), valuePredicate.getClass().getName(), e});
                 throw new AttributeFilteringException("Unable to apply predicate to attribute value", e);

Modified: trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filtering/impl/matcher/AbstractComposedMatcherTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filtering/impl/matcher/AbstractComposedMatcherTest.java?rev=4136&r1=4135&r2=4136&view=diff
==============================================================================
--- trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filtering/impl/matcher/AbstractComposedMatcherTest.java (original)
+++ trunk/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filtering/impl/matcher/AbstractComposedMatcherTest.java Mon Mar 26 11:09:10 2012
@@ -30,10 +30,12 @@
 import net.shibboleth.idp.attribute.filtering.AttributeValueMatcher;
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 import net.shibboleth.utilities.java.support.component.ComponentValidationException;
+import net.shibboleth.utilities.java.support.component.CountingDestructableInitializableValidatableComponent;
 import net.shibboleth.utilities.java.support.component.DestroyedComponentException;
 import net.shibboleth.utilities.java.support.component.DestructableComponent;
 import net.shibboleth.utilities.java.support.component.InitializableComponent;
 import net.shibboleth.utilities.java.support.component.ValidatableComponent;
+import net.shibboleth.utilities.java.support.logic.CountingDestructableInitializableValidatableFunction;
 
 import org.testng.Assert;
 import org.testng.annotations.Test;
@@ -47,7 +49,7 @@
         ComposedMatcher matcher = new ComposedMatcher(Collections.EMPTY_LIST);
         
         for (int i = 0; i < 2;i++) {
-            firstList.add(new MyMatcher());
+            firstList.add(new TestMatcher());
         }
         
         matcher.destroy();
@@ -70,7 +72,7 @@
         Assert.assertTrue(thrown, "Initialize after destroy");
 
         for (int i = 0; i < 2;i++) {
-            firstList.add(new MyMatcher());
+            firstList.add(new TestMatcher());
         }
         firstList.add(null);
         matcher = new ComposedMatcher(firstList);
@@ -87,7 +89,7 @@
 
         thrown = false;
         try {
-            matcher.getComposedMatchers().add(new MyMatcher());
+            matcher.getComposedMatchers().add(new TestMatcher());
         } catch (UnsupportedOperationException e) {
             thrown = true;
         }
@@ -98,16 +100,16 @@
         for (int i = 0; i < 2;i++) {
             Assert.assertTrue(((InitializableComponent)firstList.get(i)).isInitialized(), "Element should be initialized");
             Assert.assertFalse(((DestructableComponent)firstList.get(i)).isDestroyed(), "Element should not be destroyed");
-            Assert.assertFalse(((MyMatcher)firstList.get(i)).isValidated(), "Element should not be validated");

[... 176 lines stripped ...]


More information about the commits mailing list