Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 76CD2200A5B for ; Wed, 25 May 2016 16:29:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 75C97160A34; Wed, 25 May 2016 14:29:15 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BF663160A2E for ; Wed, 25 May 2016 16:29:14 +0200 (CEST) Received: (qmail 33395 invoked by uid 500); 25 May 2016 14:29:13 -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 33353 invoked by uid 99); 25 May 2016 14:29:13 -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, 25 May 2016 14:29:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A8A20DFABB; Wed, 25 May 2016 14:29:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dkulp@apache.org To: commits@cxf.apache.org Date: Wed, 25 May 2016 14:29:14 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/3] cxf git commit: Updating policies annotation test archived-at: Wed, 25 May 2016 14:29:15 -0000 Updating policies annotation test Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2e89c38c Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2e89c38c Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2e89c38c Branch: refs/heads/3.1.x-fixes Commit: 2e89c38ccfddf8097dbcb874b64c5b2ed8805d72 Parents: 3f248e1 Author: Colm O hEigeartaigh Authored: Wed May 25 11:36:28 2016 +0100 Committer: Daniel Kulp Committed: Wed May 25 10:23:34 2016 -0400 ---------------------------------------------------------------------- .../ws/fault/DoubleItPortTypeImplJavaFirst.java | 17 ++++++++--------- .../org/apache/cxf/systest/ws/fault/FaultTest.java | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/2e89c38c/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java ---------------------------------------------------------------------- diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java index fbbf957..5e20524 100644 --- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java +++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/DoubleItPortTypeImplJavaFirst.java @@ -24,7 +24,9 @@ import javax.annotation.Resource; import javax.jws.WebService; import javax.xml.ws.WebServiceContext; +import org.apache.cxf.annotations.Policies; import org.apache.cxf.annotations.Policy; +import org.apache.cxf.annotations.Policy.Placement; import org.apache.cxf.feature.Features; import org.example.contract.doubleit.DoubleItFault; import org.example.contract.doubleit.DoubleItPortType; @@ -35,22 +37,19 @@ import org.example.contract.doubleit.DoubleItPortType; name = "DoubleItSoap11NoPolicyBinding", endpointInterface = "org.example.contract.doubleit.DoubleItPortType") @Features(features = "org.apache.cxf.feature.LoggingFeature") -// @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml") public class DoubleItPortTypeImplJavaFirst implements DoubleItPortType { @Resource WebServiceContext wsContext; - //@Policies({ - // @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml") - //@Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SignedEncryptedPolicy.xml", - // placement = Placement.BINDING_OPERATION) - //}) - - @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml") + @Policies({ + @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SymmetricUTPolicy.xml"), + @Policy(uri = "classpath:/org/apache/cxf/systest/ws/fault/SignedEncryptedPolicy.xml", + placement = Placement.BINDING_OPERATION_OUTPUT) + }) public int doubleIt(int numberToDouble) throws DoubleItFault { Principal pr = wsContext.getUserPrincipal(); - if (pr == null || "alice".equals(pr.getName())) { + if ("alice".equals(pr.getName())) { return numberToDouble * 2; } http://git-wip-us.apache.org/repos/asf/cxf/blob/2e89c38c/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 e34a511..471f07c 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 @@ -280,7 +280,7 @@ public class FaultTest extends AbstractBusClientServerTestBase { // 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"); @@ -290,7 +290,7 @@ public class FaultTest extends AbstractBusClientServerTestBase { } catch (Exception ex) { assertTrue(ex.getMessage().contains("This is a fault")); } - */ + ((java.io.Closeable)utPort).close(); bus.shutdown(true); }