cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1330531 - in /cxf/branches/2.4.x-fixes: ./ rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/
Date Wed, 25 Apr 2012 20:11:30 GMT
Author: dkulp
Date: Wed Apr 25 20:11:29 2012
New Revision: 1330531

URL: http://svn.apache.org/viewvc?rev=1330531&view=rev
Log:
Merged revisions 1330527 via  svn merge from
https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes

........
  r1330527 | dkulp | 2012-04-25 16:10:22 -0400 (Wed, 25 Apr 2012) | 9 lines
  
  Merged revisions 1330522 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1330522 | dkulp | 2012-04-25 15:59:50 -0400 (Wed, 25 Apr 2012) | 2 lines
  
    [CXF-4258] Disabling policy doesn't remove all the policy interceptors
  
  ........
........

Added:
    cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/disable-policy-bus.xml
      - copied unchanged from r1330527, cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/disable-policy-bus.xml
Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
    cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java?rev=1330531&r1=1330530&r2=1330531&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
Wed Apr 25 20:11:29 2012
@@ -376,7 +376,7 @@ public class PolicyEngineImpl implements
         bus.getOutInterceptors().remove(PolicyOutInterceptor.INSTANCE);
         bus.getInFaultInterceptors().remove(ClientPolicyInFaultInterceptor.INSTANCE);
         bus.getOutFaultInterceptors().remove(ServerPolicyOutFaultInterceptor.INSTANCE);
-        bus.getInFaultInterceptors().add(PolicyVerificationInFaultInterceptor.INSTANCE);
+        bus.getInFaultInterceptors().remove(PolicyVerificationInFaultInterceptor.INSTANCE);
         addedBusInterceptors = false;
     }
 

Modified: cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java?rev=1330531&r1=1330530&r2=1330531&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java
Wed Apr 25 20:11:29 2012
@@ -20,6 +20,7 @@
 package org.apache.cxf.ws.policy;
 
 import java.util.Collection;
+import java.util.List;
 
 import javax.xml.namespace.QName;
 
@@ -28,6 +29,8 @@ import org.w3c.dom.Element;
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.message.Message;
 import org.apache.cxf.ws.policy.attachment.ServiceModelPolicyProvider;
 import org.apache.cxf.ws.policy.attachment.external.DomainExpressionBuilder;
 import org.apache.cxf.ws.policy.attachment.external.DomainExpressionBuilderRegistry;
@@ -50,7 +53,39 @@ public class PolicyExtensionsTest extend
         = new QName("http://www.w3.org/2005/08/addressing", "EndpointReference");
     
     private static final QName UNKNOWN = new QName("http://cxf.apache.org/test/policy", "unknown");
-    
+
+    @Test
+    public void testCXF4258() {
+        Bus bus = null;
+        try {
+            bus = new SpringBusFactory().createBus("/org/apache/cxf/ws/policy/disable-policy-bus.xml",
false);
+
+            AssertionBuilderRegistry abr = bus.getExtension(AssertionBuilderRegistry.class);
+            assertNotNull(abr);
+
+            PolicyEngine e = bus.getExtension(PolicyEngine.class);
+            assertNotNull(e);
+            
+            assertNoPolicyInterceptors(bus.getInInterceptors());
+            assertNoPolicyInterceptors(bus.getInFaultInterceptors());
+            assertNoPolicyInterceptors(bus.getOutFaultInterceptors());
+            assertNoPolicyInterceptors(bus.getOutInterceptors());
+            
+        } finally {
+            if (null != bus) {
+                bus.shutdown(true);
+                BusFactory.setDefaultBus(null);
+            }
+        }
+    }
+
+    private void assertNoPolicyInterceptors(List<Interceptor<? extends Message>>
ints) {
+        for (Interceptor<? extends Message> m : ints) {
+            assertFalse("Found " + m.getClass().getName(),
+                        m.getClass().getName().contains("org.apache.cxf.ws.policy"));
+        }
+    }
+
     @Test
     public void testExtensions() {
         Bus bus = null;



Mime
View raw message