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 BF58BEF7A for ; Tue, 15 Jan 2013 10:53:29 +0000 (UTC) Received: (qmail 45586 invoked by uid 500); 15 Jan 2013 10:53:29 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 45465 invoked by uid 500); 15 Jan 2013 10:53:28 -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 45428 invoked by uid 99); 15 Jan 2013 10:53:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Jan 2013 10:53:26 +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; Tue, 15 Jan 2013 10:53:24 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2F99423888D2; Tue, 15 Jan 2013 10:53:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1433349 - in /cxf/branches/2.7.x-fixes: ./ systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java Date: Tue, 15 Jan 2013 10:53:04 -0000 To: commits@cxf.apache.org From: ay@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130115105304.2F99423888D2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ay Date: Tue Jan 15 10:53:03 2013 New Revision: 1433349 URL: http://svn.apache.org/viewvc?rev=1433349&view=rev Log: Merged revisions 1433347 via svn merge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1433347 | ay | 2013-01-15 11:48:50 +0100 (Tue, 15 Jan 2013) | 1 line an adjustment to the change made with CXF-4511 ........ Modified: cxf/branches/2.7.x-fixes/ (props changed) cxf/branches/2.7.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java Propchange: cxf/branches/2.7.x-fixes/ ('svn:mergeinfo' removed) Propchange: cxf/branches/2.7.x-fixes/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Tue Jan 15 10:53:03 2013 @@ -1 +1 @@ -/cxf/trunk:1-1430398,1430564,1430881-1430882,1430905,1430965,1430976,1431315,1431604-1431607,1432070,1432236,1432798,1433007,1433033,1433135,1433305 +/cxf/trunk:1-1430398,1430564,1430881-1430882,1430905,1430965,1430976,1431315,1431604-1431607,1432070,1432236,1432798,1433007,1433033,1433135,1433305,1433347 Modified: cxf/branches/2.7.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java?rev=1433349&r1=1433348&r2=1433349&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java (original) +++ cxf/branches/2.7.x-fixes/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ProtocolVariationsTest.java Tue Jan 15 10:53:03 2013 @@ -267,7 +267,7 @@ public class ProtocolVariationsTest exte } @Test - public void testInvalidWRMOnReceive() throws Exception { + public void testInvalidWSRMMustUnderstandOnReceive() throws Exception { init("org/apache/cxf/systest/ws/rm/rminterceptors.xml", false); // WS-RM 1.0 using the WS-A 1.0 namespace @@ -288,15 +288,45 @@ public class ProtocolVariationsTest exte } catch (Exception e) { assertTrue(e.getCause() instanceof SoapFault); // verify a partial error text match to exclude an unexpected exception - // (see WSRM_REQUIRED_EXC in Messages.properties) - //because the ws-rm namespace isn't correct, can't detect it's a ws-rm message - //so can't understand ws-rm header + // because there is a mustUnderstand header that is not understood, + // the corresponding error is returned. final String text = "MustUnderstand headers: " + "[{http://cxf.apache.org/invalid}Sequence] are not understood."; assertTrue(e.getCause().getMessage() != null && e.getCause().getMessage().indexOf(text) >= 0); } } + + @Test + public void testInvalidWSRMOnReceive() throws Exception { + init("org/apache/cxf/systest/ws/rm/rminterceptors.xml", false); + + // WS-RM 1.0 using the WS-A 1.0 namespace + Client client = ClientProxy.getClient(greeter); + client.getRequestContext().put(RMManager.WSRM_VERSION_PROPERTY, RM10Constants.NAMESPACE_URI); + client.getRequestContext().put(RMManager.WSRM_WSA_VERSION_PROPERTY, Names200408.WSA_NAMESPACE_NAME); + + // remove the outgoing message's WS-RM header + TransformOutInterceptor trans = new TransformOutInterceptor(); + Map outElements = new HashMap(); + outElements.put("{" + RM10Constants.NAMESPACE_URI + "}Sequence", ""); + trans.setOutTransformElements(outElements); + + client.getOutInterceptors().add(trans); + try { + greeter.greetMe("one"); + fail("invalid wsrm header"); + } catch (Exception e) { + assertTrue(e.getCause() instanceof SoapFault); + // verify a partial error text match to exclude an unexpected exception + // (see WSRM_REQUIRED_EXC in Messages.properties) + final String text = "WS-ReliableMessaging is required"; + assertTrue(e.getCause().getMessage() != null + && e.getCause().getMessage().indexOf(text) >= 0); + } + } + + @Test public void testDefaultDecoupled() throws Exception {