You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2013/02/11 21:47:22 UTC

svn commit: r1444958 - in /cxf/trunk: rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java

Author: dkulp
Date: Mon Feb 11 20:47:21 2013
New Revision: 1444958

URL: http://svn.apache.org/r1444958
Log:
Get one of Jason's tests working.

Modified:
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java?rev=1444958&r1=1444957&r2=1444958&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java (original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java Mon Feb 11 20:47:21 2013
@@ -110,8 +110,14 @@ public class EffectivePolicyImpl impleme
                     PolicyEngineImpl engine, 
                     boolean requestor, boolean request) {
         Assertor assertor = initialisePolicy(ei, boi, engine, requestor, request, null);
-        chooseAlternative(engine, assertor);
-        initialiseInterceptors(engine, requestor);  
+        if (requestor || !request) {
+            chooseAlternative(engine, assertor);
+            initialiseInterceptors(engine, requestor);
+        } else {
+            //incoming server should not choose an alternative, need to include all the policies
+            Collection<Assertion> alternative = engine.getAssertions(this.policy, true);
+            this.setChosenAlternative(alternative);
+        }
     }
     
     public void initialise(EndpointInfo ei, 

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java?rev=1444958&r1=1444957&r2=1444958&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java Mon Feb 11 20:47:21 2013
@@ -299,7 +299,6 @@ public class JavaFirstPolicyServiceTest 
     }
 
     @Test
-    @Ignore
     public void testOperationNoClientCertAlternativePolicy() {
         System.setProperty("testutil.ports.JavaFirstPolicyServer.3", PORT3);
 
@@ -369,6 +368,7 @@ public class JavaFirstPolicyServiceTest 
         Client client = ClientProxy.getClient(svc);
         WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor();
         client.getEndpoint().getOutInterceptors().add(wssOut);
+        client.getOutInterceptors().add(wssOut);
         return wssOut;
     }