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/03/22 12:50:46 UTC

[cxf] branch 3.1.x-fixes updated (7f05b97 -> 5e3855a)

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 7f05b97  Recording .gitmergeinfo Changes
     new 478d777  CXF-7687 - Adding a test
     new 5e3855a  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 +
 .../cxf/systest/ws/basicauth/BasicAuthTest.java    | 37 +++++++++++++++++++++-
 2 files changed, 37 insertions(+), 1 deletion(-)

-- 
To stop receiving notification emails like this one, please contact
coheigea@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 5e3855a543d763aea64bddf5fcd9c31c321e1e52
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Thu Mar 22 12:48:16 2018 +0000

    Recording .gitmergeinfo Changes
---
 .gitmergeinfo                                                       | 1 +
 .../java/org/apache/cxf/systest/ws/basicauth/BasicAuthTest.java     | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.gitmergeinfo b/.gitmergeinfo
index ae3afc6..3b59853 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -939,6 +939,7 @@ M 5188523d89edd94247bbbea70698d64385767a63
 M 52d77470228a3560f464003c68b30ffe8f1e8b9c
 M 530498a452a1445d4b7157f521590296ba45ec75
 M 53479782d9acc56f3b88700941f0b33215661769
+M 535dae33d115154fff71761306ae28b61b187ee5
 M 539c225d3631885349c5c00d81a223dcbe97f8e0
 M 539cbd70fb39676d64d0987e570fe69ff3d485d3
 M 543f7dbc29211e055ec810293dea6140f5812a6b
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/basicauth/BasicAuthTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/basicauth/BasicAuthTest.java
index a8621bf..6176eb3 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/basicauth/BasicAuthTest.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/basicauth/BasicAuthTest.java
@@ -93,8 +93,8 @@ public class BasicAuthTest extends AbstractBusClientServerTestBase {
         URL busFile = BasicAuthTest.class.getResource("client.xml");
 
         Bus bus = bf.createBus(busFile.toString());
-        BusFactory.setDefaultBus(bus);
-        BusFactory.setThreadDefaultBus(bus);
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
 
         URL wsdl = BasicAuthTest.class.getResource("DoubleItBasicAuth.wsdl");
         Service service = Service.create(wsdl, SERVICE_QNAME);
@@ -145,4 +145,4 @@ public class BasicAuthTest extends AbstractBusClientServerTestBase {
         bus.shutdown(true);
     }
 
-}
\ No newline at end of file
+}

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.

[cxf] 01/02: CXF-7687 - Adding a test

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 478d77704b0a035cf5ee5efbf4bd263f8467eaf4
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Thu Mar 22 12:46:15 2018 +0000

    CXF-7687 - Adding a test
    
    (cherry picked from commit 535dae33d115154fff71761306ae28b61b187ee5)
---
 .../cxf/systest/ws/basicauth/BasicAuthTest.java    | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/basicauth/BasicAuthTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/basicauth/BasicAuthTest.java
index 0dceda6..a8621bf 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/basicauth/BasicAuthTest.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/basicauth/BasicAuthTest.java
@@ -26,8 +26,12 @@ import javax.xml.ws.Service;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.configuration.security.AuthorizationPolicy;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.frontend.ClientProxy;
 import org.apache.cxf.systest.ws.common.SecurityTestUtil;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.cxf.transport.http.HTTPConduit;
 import org.example.contract.doubleit.DoubleItPortType;
 
 import org.junit.BeforeClass;
@@ -83,6 +87,37 @@ public class BasicAuthTest extends AbstractBusClientServerTestBase {
     }
 
     @org.junit.Test
+    public void testBasicAuthViaAuthorizationPolicy() throws Exception {
+
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = BasicAuthTest.class.getResource("client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        BusFactory.setDefaultBus(bus);
+        BusFactory.setThreadDefaultBus(bus);
+
+        URL wsdl = BasicAuthTest.class.getResource("DoubleItBasicAuth.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItBasicAuthPort2");
+        DoubleItPortType utPort =
+                service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(utPort, PORT);
+
+        Client client = ClientProxy.getClient(utPort);
+        HTTPConduit http = (HTTPConduit) client.getConduit();
+        AuthorizationPolicy authorizationPolicy = new AuthorizationPolicy();
+        authorizationPolicy.setUserName("Alice");
+        authorizationPolicy.setPassword("ecilA");
+        authorizationPolicy.setAuthorizationType("Basic");
+        http.setAuthorization(authorizationPolicy);
+
+        assertEquals(50, utPort.doubleIt(25));
+
+        ((java.io.Closeable)utPort).close();
+        bus.shutdown(true);
+    }
+
+    @org.junit.Test
     public void testNoBasicAuthCredentials() throws Exception {
 
         SpringBusFactory bf = new SpringBusFactory();

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.