You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2016/05/25 10:36:54 UTC

cxf git commit: Updating policies annotation test

Repository: cxf
Updated Branches:
  refs/heads/master 0182a2902 -> 39b19384a


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/39b19384
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/39b19384
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/39b19384

Branch: refs/heads/master
Commit: 39b19384a6031968b86dda0f49283dda712a067c
Parents: 0182a29
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed May 25 11:36:28 2016 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed May 25 11:36:49 2016 +0100

----------------------------------------------------------------------
 .../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/39b19384/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/39b19384/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);
     }