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 496B81892C for ; Wed, 23 Dec 2015 17:08:45 +0000 (UTC) Received: (qmail 16540 invoked by uid 500); 23 Dec 2015 17:08:45 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 16478 invoked by uid 500); 23 Dec 2015 17:08:45 -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 16469 invoked by uid 99); 23 Dec 2015 17:08:45 -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; Wed, 23 Dec 2015 17:08:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0A1DEDFFED; Wed, 23 Dec 2015 17:08:45 +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: <71248ff090724f45a0c5ef67ec8c8047@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: Adding an MTOM fault test Date: Wed, 23 Dec 2015 17:08:45 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/master 1d9e4a307 -> 309f0c9fa Adding an MTOM fault test Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/309f0c9f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/309f0c9f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/309f0c9f Branch: refs/heads/master Commit: 309f0c9fa9cc9216d6fae183ee1cab66ca208b13 Parents: 1d9e4a3 Author: Colm O hEigeartaigh Authored: Wed Dec 23 17:05:03 2015 +0000 Committer: Colm O hEigeartaigh Committed: Wed Dec 23 17:05:03 2015 +0000 ---------------------------------------------------------------------- .../apache/cxf/systest/ws/fault/FaultTest.java | 36 +++++++++++++++++++- .../cxf/systest/ws/fault/DoubleItFault.wsdl | 3 ++ .../org/apache/cxf/systest/ws/fault/client.xml | 8 +++++ .../org/apache/cxf/systest/ws/fault/server.xml | 7 ++++ 4 files changed, 53 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/309f0c9f/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java index 5429b7b..4bc825b 100644 --- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java +++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/FaultTest.java @@ -135,6 +135,41 @@ public class FaultTest extends AbstractBusClientServerTestBase { bus.shutdown(true); } + // TODO + @org.junit.Test + @org.junit.Ignore + public void testSoap12Mtom() throws Exception { + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = FaultTest.class.getResource("client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = FaultTest.class.getResource("DoubleItFault.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItSoap12MtomPort"); + DoubleItPortType utPort = + service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(utPort, PORT); + + // Make a successful invocation + ((BindingProvider)utPort).getRequestContext().put("security.username", "alice"); + utPort.doubleIt(25); + + // Now make an invocation using another username + ((BindingProvider)utPort).getRequestContext().put("security.username", "bob"); + ((BindingProvider)utPort).getRequestContext().put("security.password", "password"); + try { + utPort.doubleIt(25); + fail("Expected failure on bob"); + } catch (Exception ex) { + assertTrue(ex.getMessage().contains("This is a fault")); + } + ((java.io.Closeable)utPort).close(); + bus.shutdown(true); + } + @org.junit.Test public void testSoap12Dispatch() throws Exception { createBus(); @@ -190,5 +225,4 @@ public class FaultTest extends AbstractBusClientServerTestBase { client.destroy(); } - } http://git-wip-us.apache.org/repos/asf/cxf/blob/309f0c9f/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl index 2e388f5..2d4bf02 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/DoubleItFault.wsdl @@ -103,6 +103,9 @@ + + + http://git-wip-us.apache.org/repos/asf/cxf/blob/309f0c9f/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml index 7f7ebf0..8863d41 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/client.xml @@ -38,6 +38,14 @@ + + + + + + + + http://git-wip-us.apache.org/repos/asf/cxf/blob/309f0c9f/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server.xml ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server.xml index d89a8d2..3362cab 100644 --- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server.xml +++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/fault/server.xml @@ -43,4 +43,11 @@ + + + + + + +