Author: alessio.soldano(a)jboss.com
Date: 2013-01-08 04:36:33 -0500 (Tue, 08 Jan 2013)
New Revision: 17189
Modified:
stack/cxf/branches/jbossws-cxf-4.0.x/
stack/cxf/branches/jbossws-cxf-4.0.x/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernameTestCase.java
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084TestCase.java
Log:
Merged revisions 16997,17042,17061 via svnmerge from
https://svn.jboss.org/repos/jbossws/stack/cxf/trunk
.......
r16997 | alessio.soldano(a)jboss.com | 2012-11-15 10:45:52 +0100 (Thu, 15 Nov 2012) | 2
lines
Adding testcase for UT auth without callbackhandler
.......
r17042 | richard.opalka(a)jboss.com | 2012-11-27 10:49:36 +0100 (Tue, 27 Nov 2012) | 1
line
fixing test case
.......
r17061 | alessio.soldano(a)jboss.com | 2012-12-10 10:14:13 +0100 (Mon, 10 Dec 2012) | 2
lines
Use SecurityActions to get system props
.......
Property changes on: stack/cxf/branches/jbossws-cxf-4.0.x
___________________________________________________________________
Modified: svnmerge-integrated
-
https://svn.jboss.org/repos/jbossws/stack/cxf/trunk:1-15635,15658,15668,1...
+
https://svn.jboss.org/repos/jbossws/stack/cxf/trunk:1-15635,15658,15668,1...
Modified: svn:mergeinfo
- /stack/cxf/branches/asoldano:14032-14050,14068
/stack/cxf/trunk:15658,15668,15674-15675,15682,15695-15697,15708,15711,15713,15719,15723-15730,15738,15743,15748,15750-15751,15754-15757,15765-15766,15768,15773,15780-15781,15784,15794,15806-15808,15824,15835,15837-15857,15859,15866,15879-15881,15886-15889,15896,15900-15920,15936,15965,15967,15973,16067,16071,16086-16087,16096,16176,16183,16204-16205,16227,16230,16244-16245,16306,16315,16323,16407-16408,16412,16418,16516,16530-16532,16619,16636-16644,16691,16729-16730,16738,16782,16817,16914,16943-16944,16951,16996
+ /stack/cxf/branches/asoldano:14032-14050,14068
/stack/cxf/trunk:15658,15668,15674-15675,15682,15695-15697,15708,15711,15713,15719,15723-15730,15738,15743,15748,15750-15751,15754-15757,15765-15766,15768,15773,15780-15781,15784,15794,15806-15808,15824,15835,15837-15857,15859,15866,15879-15881,15886-15889,15896,15900-15920,15936,15965,15967,15973,16067,16071,16086-16087,16096,16176,16183,16204-16205,16227,16230,16244-16245,16306,16315,16323,16407-16408,16412,16418,16516,16530-16532,16619,16636-16644,16691,16729-16730,16738,16782,16817,16914,16943-16944,16951,16996-16997,17042,17061
Modified:
stack/cxf/branches/jbossws-cxf-4.0.x/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.0.x/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2013-01-08
09:29:13 UTC (rev 17188)
+++
stack/cxf/branches/jbossws-cxf-4.0.x/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2013-01-08
09:36:33 UTC (rev 17189)
@@ -73,8 +73,8 @@
{
try
{
- String userCfgFile =
System.getProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME);
- String sysCfgFileUrl =
System.getProperty(Configurer.USER_CFG_FILE_PROPERTY_URL);
+ String userCfgFile =
SecurityActions.getSystemProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME, null);
+ String sysCfgFileUrl =
SecurityActions.getSystemProperty(Configurer.USER_CFG_FILE_PROPERTY_URL, null);
Resource r =
BusApplicationContext.findResource(Configurer.DEFAULT_USER_CFG_FILE);
if (!customContextProvided && userCfgFile == null && cfgFiles ==
null && sysCfgFileUrl == null
&& (r == null || !r.exists()) && includeDefaults)
Modified:
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernameTestCase.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernameTestCase.java 2013-01-08
09:29:13 UTC (rev 17188)
+++
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/UsernameTestCase.java 2013-01-08
09:36:33 UTC (rev 17189)
@@ -77,6 +77,26 @@
}
}
+ public void testNoCBH() throws Exception
+ {
+ QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
"SecurityService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsseNoCBH((BindingProvider)proxy, "kermit", "thefrog");
+ assertEquals("Secure Hello World!", proxy.sayHello());
+ setupWsseNoCBH((BindingProvider)proxy, "kermit",
"wrongpassword");
+ try
+ {
+ proxy.sayHello();
+ fail("User snoopy shouldn't be authenticated.");
+ }
+ catch (Exception e)
+ {
+ //OK
+ }
+ }
+
public void testJavaFirst() throws Exception
{
QName serviceName = new
QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
"JavaFirstSecurityService");
@@ -110,4 +130,10 @@
proxy.getRequestContext().put(SecurityConstants.USERNAME, username);
proxy.getRequestContext().put(SecurityConstants.CALLBACK_HANDLER,
"org.jboss.test.ws.jaxws.samples.wsse.policy.basic.UsernamePasswordCallback");
}
+
+ private void setupWsseNoCBH(BindingProvider proxy, String username, String password)
+ {
+ proxy.getRequestContext().put(SecurityConstants.USERNAME, username);
+ proxy.getRequestContext().put(SecurityConstants.PASSWORD, password);
+ }
}
Modified:
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084TestCase.java
===================================================================
---
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084TestCase.java 2013-01-08
09:29:13 UTC (rev 17188)
+++
stack/cxf/branches/jbossws-cxf-4.0.x/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084TestCase.java 2013-01-08
09:36:33 UTC (rev 17189)
@@ -22,22 +22,19 @@
package org.jboss.test.ws.saaj.jbws3084;
import java.net.URL;
-import java.util.Arrays;
import java.util.Iterator;
import javax.xml.namespace.QName;
-import javax.xml.soap.AttachmentPart;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPFactory;
import javax.xml.soap.SOAPMessage;
import junit.framework.Test;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
/**
* [JBWS-3084] Enable control of chunked encoding when using SOAPConnection.
@@ -58,7 +55,10 @@
SOAPConnection con = conFac.createConnection();
URL endpoint = new URL(serviceURL);
- SOAPMessage response = con.get(endpoint);
+ MessageFactory msgFactory = MessageFactory.newInstance();
+ SOAPMessage msg = msgFactory.createMessage();
+ msg.getSOAPBody().addBodyElement(new
QName("http://www.jboss.org/jbossws/saaj", "greetMe"));
+ SOAPMessage response = con.call(msg, endpoint);
QName greetMeResp = new
QName("http://www.jboss.org/jbossws/saaj",
"greetMeResponse");
Iterator<?> sayHiRespIterator =
response.getSOAPBody().getChildElements(greetMeResp);