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 B3E9011EDD for ; Mon, 15 Sep 2014 14:31:53 +0000 (UTC) Received: (qmail 55154 invoked by uid 500); 15 Sep 2014 14:31:53 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 55094 invoked by uid 500); 15 Sep 2014 14:31:53 -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 55085 invoked by uid 99); 15 Sep 2014 14:31:53 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2014 14:31:53 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 44D8CA13663; Mon, 15 Sep 2014 14:31:53 +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 Date: Mon, 15 Sep 2014 14:31:54 -0000 Message-Id: In-Reply-To: <579df546cdc047ed98c2221cdf69e132@git.apache.org> References: <579df546cdc047ed98c2221cdf69e132@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] git commit: Another SCT system test + a NPE fix Another SCT system test + a NPE fix Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5ae19059 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5ae19059 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5ae19059 Branch: refs/heads/3.0.x-fixes Commit: 5ae190595f03bab2c9d9e41c7d7d6c4cad59086e Parents: 74e64bf Author: Colm O hEigeartaigh Authored: Mon Sep 15 15:20:00 2014 +0100 Committer: Colm O hEigeartaigh Committed: Mon Sep 15 15:31:43 2014 +0100 ---------------------------------------------------------------------- .../policy/interceptors/NegotiationUtils.java | 10 ++-- .../sts/secure_conv/SecureConversationTest.java | 21 +++++++ .../cxf/systest/sts/secure_conv/DoubleIt.wsdl | 61 ++++++++++++++++++++ .../cxf/systest/sts/secure_conv/cxf-client.xml | 6 ++ .../cxf/systest/sts/secure_conv/cxf-service.xml | 19 ++++++ 5 files changed, 113 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/5ae19059/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java ---------------------------------------------------------------------- diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java index 6d7c0cd..68c05b8 100644 --- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java +++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java @@ -275,11 +275,13 @@ final class NegotiationUtils { getTokenStore(message).add(token); } } - final SecurityContext sc = token.getSecurityContext(); - if (sc != null) { - message.put(SecurityContext.class, sc); + if (token != null) { + final SecurityContext sc = token.getSecurityContext(); + if (sc != null) { + message.put(SecurityContext.class, sc); + } + return true; } - return true; } } } http://git-wip-us.apache.org/repos/asf/cxf/blob/5ae19059/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SecureConversationTest.java ---------------------------------------------------------------------- diff --git a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SecureConversationTest.java b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SecureConversationTest.java index ec88ad8..921998b 100644 --- a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SecureConversationTest.java +++ b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SecureConversationTest.java @@ -110,6 +110,27 @@ public class SecureConversationTest extends AbstractBusClientServerTestBase { bus.shutdown(true); } + @org.junit.Test + public void testSecureConversationSupporting() throws Exception { + SpringBusFactory bf = new SpringBusFactory(); + URL busFile = SecureConversationTest.class.getResource("cxf-client.xml"); + + Bus bus = bf.createBus(busFile.toString()); + SpringBusFactory.setDefaultBus(bus); + SpringBusFactory.setThreadDefaultBus(bus); + + URL wsdl = SecureConversationTest.class.getResource("DoubleIt.wsdl"); + Service service = Service.create(wsdl, SERVICE_QNAME); + QName portQName = new QName(NAMESPACE, "DoubleItTransportSupportingPort"); + DoubleItPortType transportPort = + service.getPort(portQName, DoubleItPortType.class); + updateAddressPort(transportPort, PORT); + + doubleIt(transportPort, 25); + + bus.shutdown(true); + } + private static void doubleIt(DoubleItPortType port, int numToDouble) { int resp = port.doubleIt(numToDouble); assertTrue(resp == 2 * numToDouble); http://git-wip-us.apache.org/repos/asf/cxf/blob/5ae19059/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/DoubleIt.wsdl ---------------------------------------------------------------------- diff --git a/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/DoubleIt.wsdl b/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/DoubleIt.wsdl index 66185cc..d860e53 100644 --- a/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/DoubleIt.wsdl +++ b/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/DoubleIt.wsdl @@ -49,6 +49,21 @@ + + + + + + + + + + + + + + + @@ -56,6 +71,10 @@ + + + @@ -226,6 +245,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/cxf/blob/5ae19059/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-client.xml ---------------------------------------------------------------------- diff --git a/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-client.xml b/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-client.xml index aead21c..2349fb9 100644 --- a/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-client.xml +++ b/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-client.xml @@ -49,6 +49,12 @@ + + + + + + http://git-wip-us.apache.org/repos/asf/cxf/blob/5ae19059/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-service.xml ---------------------------------------------------------------------- diff --git a/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-service.xml b/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-service.xml index e4fc8ef..6ddfd39 100644 --- a/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-service.xml +++ b/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/secure_conv/cxf-service.xml @@ -55,6 +55,25 @@ + + + + + + + + + + + + + + + + + + +