cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashaki...@apache.org
Subject git commit: Improved fix of [CXF-5571], enabled broken test
Date Fri, 21 Feb 2014 15:19:43 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes d7cde0232 -> 7b8cf2deb


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/7b8cf2de
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7b8cf2de
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7b8cf2de

Branch: refs/heads/2.7.x-fixes
Commit: 7b8cf2deb14bd9227d68f48c22f0a7cb3109a07c
Parents: d7cde02
Author: Andrei Shakirin <andrei.shakirin@gmail.com>
Authored: Fri Feb 21 16:19:27 2014 +0100
Committer: Andrei Shakirin <andrei.shakirin@gmail.com>
Committed: Fri Feb 21 16:19:27 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/7b8cf2de/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/7b8cf2de/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 7faa934..91e6b02 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
@@ -111,9 +111,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