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 9F39110F28 for ; Tue, 27 Jan 2015 12:18:01 +0000 (UTC) Received: (qmail 18773 invoked by uid 500); 27 Jan 2015 12:18:01 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 18706 invoked by uid 500); 27 Jan 2015 12:18:01 -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 18697 invoked by uid 99); 27 Jan 2015 12:18:01 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jan 2015 12:18:01 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B64F4E03F8; Tue, 27 Jan 2015 12:18:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: coheigea@apache.org To: commits@cxf.apache.org Message-Id: <87809e87b4db437bae0cdf35b77109cd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: More work on unifying error messages Date: Tue, 27 Jan 2015 12:18:01 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/master 7cd4cf67b -> 27b3b6998 More work on unifying error messages Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/27b3b699 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/27b3b699 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/27b3b699 Branch: refs/heads/master Commit: 27b3b6998c0295172a9c613dafc24ffc4b35e726 Parents: 7cd4cf6 Author: Colm O hEigeartaigh Authored: Tue Jan 27 12:16:57 2015 +0000 Committer: Colm O hEigeartaigh Committed: Tue Jan 27 12:17:11 2015 +0000 ---------------------------------------------------------------------- .../security/wss4j/StaxActionInInterceptor.java | 38 ++------- .../security/wss4j/WSS4JStaxInInterceptor.java | 28 +------ .../security/wss4j/StaxRoundTripActionTest.java | 19 ++--- .../systest/ws/fault/ModifiedRequestTest.java | 81 ++++++++++++++++---- .../ws/security/WSSecurityClientTest.java | 2 - .../cxf/systest/ws/fault/modified-server.xml | 10 +++ 6 files changed, 92 insertions(+), 86 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/27b3b699/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/StaxActionInInterceptor.java ---------------------------------------------------------------------- diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/StaxActionInInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/StaxActionInInterceptor.java index 5c9473b..e64a71c 100644 --- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/StaxActionInInterceptor.java +++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/StaxActionInInterceptor.java @@ -21,9 +21,7 @@ package org.apache.cxf.ws.security.wss4j; import java.util.List; import java.util.logging.Logger; -import org.apache.cxf.binding.soap.SoapFault; import org.apache.cxf.binding.soap.SoapMessage; -import org.apache.cxf.binding.soap.SoapVersion; import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.message.MessageUtils; @@ -69,8 +67,8 @@ public class StaxActionInInterceptor extends AbstractPhaseInterceptor subcodeIterator = fault.getFaultSubcodes(); - assertTrue(subcodeIterator.hasNext()); - Object subcode = subcodeIterator.next(); - assertEquals(WSSecurityException.SECURITY_ERROR, subcode); - assertFalse(subcodeIterator.hasNext()); + if (streaming) { + assertTrue("soap:Sender".equals(fault.getFaultCode()) + || "soap:Receiver".equals(fault.getFaultCode())); + assertTrue(fault.getFaultString().contains(WSSecurityException.UNIFIED_SECURITY_ERR)); + Iterator subcodeIterator = fault.getFaultSubcodes(); + assertFalse(subcodeIterator.hasNext()); + } else { + assertEquals("soap:Sender", fault.getFaultCode()); + assertEquals(fault.getFaultString(), WSSecurityException.UNIFIED_SECURITY_ERR); + Iterator subcodeIterator = fault.getFaultSubcodes(); + assertTrue(subcodeIterator.hasNext()); + Object subcode = subcodeIterator.next(); + assertEquals(WSSecurityException.SECURITY_ERROR, subcode); + assertFalse(subcodeIterator.hasNext()); + } } } http://git-wip-us.apache.org/repos/asf/cxf/blob/27b3b699/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/WSSecurityClientTest.java ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/WSSecurityClientTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/WSSecurityClientTest.java index 0be1b58..b738986 100644 --- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/WSSecurityClientTest.java +++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/WSSecurityClientTest.java @@ -327,9 +327,7 @@ public class WSSecurityClientTest extends AbstractBusClientServerTestBase { assertTrue(result.indexOf("Fault") != -1); } - // TODO @Test - @org.junit.Ignore public void testDecoupledFaultFromSecurity() throws Exception { Dispatch dispatcher = null; java.io.InputStream is = null; http://git-wip-us.apache.org/repos/asf/cxf/blob/27b3b699/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/modified-server.xml ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/modified-server.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/modified-server.xml index 84390e7..6db8500 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/modified-server.xml +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/modified-server.xml @@ -35,4 +35,14 @@ + + + + + + + + + +