cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashaki...@apache.org
Subject [1/2] git commit: Improved fix of [CXF-5571], enabled broken test
Date Fri, 21 Feb 2014 15:07:18 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 642f2534d -> bb3073ce8


Improved fix of [CXF-5571], enabled broken test


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/94a15246
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/94a15246
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/94a15246

Branch: refs/heads/master
Commit: 94a152462a823b5dd0b4e193c5f4698f018dc237
Parents: 0bbd3da
Author: Andrei Shakirin <andrei.shakirin@gmail.com>
Authored: Fri Feb 21 16:06:15 2014 +0100
Committer: Andrei Shakirin <andrei.shakirin@gmail.com>
Committed: Fri Feb 21 16:06:15 2014 +0100

----------------------------------------------------------------------
 .../policy/selector/BaseAlternativeSelector.java  | 18 ++++++++++++++++--
 .../systest/ws/algsuite/AlgorithmSuiteTest.java   |  2 --
 2 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/94a15246/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/BaseAlternativeSelector.java
----------------------------------------------------------------------
diff --git a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/BaseAlternativeSelector.java
b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/BaseAlternativeSelector.java
index 40e51a0..ed88265 100644
--- a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/BaseAlternativeSelector.java
+++ b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/BaseAlternativeSelector.java
@@ -27,6 +27,7 @@ import javax.xml.namespace.QName;
 
 import org.apache.cxf.ws.policy.AlternativeSelector;
 import org.apache.neethi.Assertion;
+import org.apache.neethi.builders.PrimitiveAssertion;
 
 
 /**
@@ -48,13 +49,26 @@ public abstract class BaseAlternativeSelector implements AlternativeSelector
{
     }
 
     protected boolean isCompatible(List<Assertion> alternative, List<Assertion>
r) {
-        // Workaround until Neethi assertions do not override equals()
         List<QName> rNames = new ArrayList<QName>(r.size());
         for (Assertion ra : r) {
             rNames.add(ra.getName());
         }
+        
         for (Assertion a : alternative) {
-            rNames.remove(a.getName());
+            for (Assertion ra : r) {
+                if (a.equals(ra)) {
+                    rNames.remove(ra.getName());
+                    break;
+                } else {
+                    // Workaround until Neethi assertions implementations do not override
equals(): 
+                    // objects in lists can be different instances
+                    if ((a instanceof PrimitiveAssertion) && (ra instanceof PrimitiveAssertion)

+                        && ((PrimitiveAssertion) a).equal(ra)) {
+                        rNames.remove(ra.getName());
+                        break;
+                    }
+                }
+            }
         }
         return rNames.isEmpty();
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/94a15246/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/algsuite/AlgorithmSuiteTest.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/algsuite/AlgorithmSuiteTest.java
b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/algsuite/AlgorithmSuiteTest.java
index 76ba4d6..2796af4 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/algsuite/AlgorithmSuiteTest.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/algsuite/AlgorithmSuiteTest.java
@@ -137,9 +137,7 @@ public class AlgorithmSuiteTest extends AbstractBusClientServerTestBase
{
         bus.shutdown(true);
     }
     
-    // TODO @Ignore'ing this test due to a recent merge from Andrei
     @org.junit.Test
-    @org.junit.Ignore
     public void testCombinedPolicy() throws Exception {
         
         if (!SecurityTestUtil.checkUnrestrictedPoliciesInstalled()) {


Mime
View raw message