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 2012/04/25 22:10:22 UTC
svn commit: r1330527 - in /cxf/branches/2.5.x-fixes/rt/ws/policy/src:
main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java
test/java/org/apache/cxf/ws/policy/disable-policy-bus.xml
Author: dkulp
Date: Wed Apr 25 20:10:22 2012
New Revision: 1330527
URL: http://svn.apache.org/viewvc?rev=1330527&view=rev
Log:
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.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/disable-policy-bus.xml (with props)
Modified:
cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java
Modified: cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java?rev=1330527&r1=1330526&r2=1330527&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java (original)
+++ cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java Wed Apr 25 20:10:22 2012
@@ -386,7 +386,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.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java?rev=1330527&r1=1330526&r2=1330527&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java (original)
+++ cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java Wed Apr 25 20:10:22 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;
Added: cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/disable-policy-bus.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/disable-policy-bus.xml?rev=1330527&view=auto
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/disable-policy-bus.xml (added)
+++ cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/disable-policy-bus.xml Wed Apr 25 20:10:22 2012
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:cxf="http://cxf.apache.org/core" xmlns:p="http://cxf.apache.org/policy"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+ <cxf:bus>
+ <cxf:features>
+ <p:policies enabled="false" />
+ </cxf:features>
+ </cxf:bus>
+</beans>
Propchange: cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/disable-policy-bus.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/disable-policy-bus.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/disable-policy-bus.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml