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 2018/01/19 18:05:46 UTC

[cxf] branch 3.1.x-fixes updated (9efb028 -> 33d089e)

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a change to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from 9efb028  Recording .gitmergeinfo Changes
     new 2bfbca8  Adding programmatic example
     new 33d089e  Recording .gitmergeinfo Changes

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitmergeinfo                                      |  1 +
 .../apache/cxf/systest/ws/action/ActionTest.java   | 19 ++++++--
 .../org/apache/cxf/systest/ws/action/UTServer.java | 51 ++++++++++++++++++++++
 .../cxf/systest/ws/action/DoubleItAction.wsdl      |  3 ++
 .../org/apache/cxf/systest/ws/action/client.xml    | 13 ++++++
 5 files changed, 84 insertions(+), 3 deletions(-)
 create mode 100644 systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/UTServer.java

-- 
To stop receiving notification emails like this one, please contact
['"commits@cxf.apache.org" <co...@cxf.apache.org>'].

[cxf] 01/02: Adding programmatic example

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 2bfbca85a60c135d817c8dc6aa51dc6f8e4cf92f
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Fri Jan 19 18:03:13 2018 +0000

    Adding programmatic example
    
    (cherry picked from commit eb190a0151ba1bf78d7e0e4e4067717b41606ff7)
    
    # Conflicts:
    #	systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java
---
 .../apache/cxf/systest/ws/action/ActionTest.java   | 19 ++++++--
 .../org/apache/cxf/systest/ws/action/UTServer.java | 51 ++++++++++++++++++++++
 .../cxf/systest/ws/action/DoubleItAction.wsdl      |  3 ++
 .../org/apache/cxf/systest/ws/action/client.xml    | 13 ++++++
 4 files changed, 83 insertions(+), 3 deletions(-)

diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java
index 3139f74..cab2667 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java
@@ -56,6 +56,12 @@ public class ActionTest extends AbstractBusClientServerTestBase {
                 // set this to false to fork
                 launchServer(Server.class, true)
         );
+        assertTrue(
+                   "Server failed to launch",
+                   // run the server in the same process
+                   // set this to false to fork
+                   launchServer(UTServer.class, true)
+        );
     }
     
     @org.junit.AfterClass
@@ -102,7 +108,7 @@ public class ActionTest extends AbstractBusClientServerTestBase {
         DoubleItPortType port = 
                 service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(port, PORT);
-        
+
         // Successful call
         port.doubleIt(25);
         
@@ -117,8 +123,14 @@ public class ActionTest extends AbstractBusClientServerTestBase {
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
             assertTrue(ex.getMessage().equals(WSSecurityException.UNIFIED_SECURITY_ERR));
         }
-        
-        
+
+        // Here the Server is adding the WSS4JInInterceptor in code
+        portQName = new QName(NAMESPACE, "DoubleItUsernameTokenPort3");
+        port = service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(port, UTServer.PORT);
+
+        port.doubleIt(25);
+
         ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
@@ -426,4 +438,5 @@ public class ActionTest extends AbstractBusClientServerTestBase {
         ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
+
 }
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/UTServer.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/UTServer.java
new file mode 100644
index 0000000..f832e5c
--- /dev/null
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/UTServer.java
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.action;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.jaxws.EndpointImpl;
+import org.apache.cxf.systest.ws.common.DoubleItImpl;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+import org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor;
+
+/**
+ * Test adding the WSS4JInInterceptor in code.
+ */
+public class UTServer extends AbstractBusTestServerBase {
+
+    public static final String PORT = allocatePort(UTServer.class);
+
+    protected void run() {
+        Object implementor = new DoubleItImpl();
+        String address = "http://localhost:" + PORT + "/DoubleItUsernameToken3";
+        EndpointImpl jaxWsEndpoint = (EndpointImpl)Endpoint.publish(address, implementor);
+
+        Map<String, Object> properties = new HashMap<>();
+        properties.put("action", "UsernameToken");
+        properties.put("passwordCallbackClass", "org.apache.cxf.systest.ws.common.UTPasswordCallback");
+        WSS4JInInterceptor wss4jInInterceptor = new WSS4JInInterceptor(properties);
+
+        jaxWsEndpoint.getServer().getEndpoint().getInInterceptors().add(wss4jInInterceptor);
+    }
+}
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl
index ea3409e..9eb6888 100644
--- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl
+++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/DoubleItAction.wsdl
@@ -45,6 +45,9 @@
         <wsdl:port name="DoubleItUsernameTokenPort2" binding="tns:DoubleItNoSecurityBinding">
             <soap:address location="http://localhost:9001/DoubleItUsernameToken2"/>
         </wsdl:port>
+        <wsdl:port name="DoubleItUsernameTokenPort3" binding="tns:DoubleItNoSecurityBinding">
+            <soap:address location="http://localhost:9001/DoubleItUsernameToken3"/>
+        </wsdl:port>
         <wsdl:port name="DoubleItEncryptedPasswordPort" binding="tns:DoubleItNoSecurityBinding">
             <soap:address location="http://localhost:9001/DoubleItEncryptedPassword"/>
         </wsdl:port>
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client.xml b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client.xml
index b1a70ac..0013cb4 100644
--- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client.xml
+++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/action/client.xml
@@ -64,6 +64,19 @@
             </bean>
         </jaxws:outInterceptors>
     </jaxws:client>
+    <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItUsernameTokenPort3" createdFromAPI="true">
+        <jaxws:outInterceptors>
+            <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
+                <constructor-arg>
+                    <map>
+                        <entry key="action" value="UsernameToken"/>
+                        <entry key="passwordCallbackClass" value="org.apache.cxf.systest.ws.common.UTPasswordCallback"/>
+                        <entry key="user" value="Alice"/>
+                    </map>
+                </constructor-arg>
+            </bean>
+        </jaxws:outInterceptors>
+    </jaxws:client>
     <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItEncryptedPasswordPort" createdFromAPI="true">
         <jaxws:outInterceptors>
             <bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">

-- 
To stop receiving notification emails like this one, please contact
"commits@cxf.apache.org" <co...@cxf.apache.org>.

[cxf] 02/02: Recording .gitmergeinfo Changes

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 33d089e44e653fdf08fa6f6c3772c15d27950bf9
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Fri Jan 19 18:03:56 2018 +0000

    Recording .gitmergeinfo Changes
---
 .gitmergeinfo | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitmergeinfo b/.gitmergeinfo
index 0ab4d03..06ae6c9 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -1039,6 +1039,7 @@ M e92e57c1f14de911cd2315a907443c79e91a94de
 M ea6e59b4026408ba195cea6fb55c2163f453e25d
 M ea97f3dd62a3a271faf7f363aca618d921c14abb
 M eb14ce9206bc43371f149f9d0b1c6e8e2682e5c0
+M eb190a0151ba1bf78d7e0e4e4067717b41606ff7
 M eb31ffe4f95c4dc6ac9a2ac56e15ae89b578359e
 M ec7a52968e8e4d9e7727a7798b293389c1a3dd29
 M ed9298066428c0dfc4590a556876d696a4ba13c0

-- 
To stop receiving notification emails like this one, please contact
"commits@cxf.apache.org" <co...@cxf.apache.org>.