Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D04E491BA for ; Wed, 25 Apr 2012 20:11:11 +0000 (UTC) Received: (qmail 59082 invoked by uid 500); 25 Apr 2012 20:11:11 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 58954 invoked by uid 500); 25 Apr 2012 20:11:11 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 58942 invoked by uid 99); 25 Apr 2012 20:11:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2012 20:11:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2012 20:10:51 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0B2D823888EA; Wed, 25 Apr 2012 20:10:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 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 Date: Wed, 25 Apr 2012 20:10:22 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120425201023.0B2D823888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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> ints) { + for (Interceptor 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 @@ + + + + + + + + + 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