JBossWS SVN: r18278 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-27 10:04:27 -0500 (Mon, 27 Jan 2014)
New Revision: 18278
Modified:
stack/cxf/trunk/pom.xml
Log:
[JBWS-3752] Moving to Apache CXF 2.7.9-SNAPSHOT
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2014-01-27 14:24:58 UTC (rev 18277)
+++ stack/cxf/trunk/pom.xml 2014-01-27 15:04:27 UTC (rev 18278)
@@ -68,7 +68,7 @@
<jboss720.version>7.2.0.Final</jboss720.version>
<wildfly800.version>8.0.0.Final-SNAPSHOT</wildfly800.version>
<ejb.api.version>1.0.2.Final</ejb.api.version>
- <cxf.version>2.7.8</cxf.version>
+ <cxf.version>2.7.9-SNAPSHOT</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
<cxf.xjcplugins.version>2.6.1</cxf.xjcplugins.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
10 years, 11 months
JBossWS SVN: r18277 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-27 09:24:58 -0500 (Mon, 27 Jan 2014)
New Revision: 18277
Modified:
stack/cxf/trunk/pom.xml
Log:
Upgrading to Undertow 1.0.0.Beta33 to solve some regressions against WFLY next
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2014-01-27 14:19:12 UTC (rev 18276)
+++ stack/cxf/trunk/pom.xml 2014-01-27 14:24:58 UTC (rev 18277)
@@ -79,9 +79,9 @@
<picketbox.version>4.0.17.Final</picketbox.version>
<picketlink.version>2.1.7.Final</picketlink.version>
<jaxws-jboss-httpserver-httpspi.version>1.0.1.GA</jaxws-jboss-httpserver-httpspi.version>
- <jaxws-undertow-httpspi.version>1.0.0.Beta1</jaxws-undertow-httpspi.version>
+ <jaxws-undertow-httpspi.version>1.0.1-SNAPSHOT</jaxws-undertow-httpspi.version>
<httpserver.version>1.0.0.Final</httpserver.version>
- <io.undertow.version>1.0.0.Beta30</io.undertow.version>
+ <io.undertow.version>1.0.0.Beta33</io.undertow.version>
<jaxb.api.version>1.0.4.Final</jaxb.api.version>
<jaxb.impl.version>2.2.6</jaxb.impl.version>
<jaxrpc.api.version>1.0.1.Final</jaxrpc.api.version>
10 years, 11 months
JBossWS SVN: r18276 - in projects/jaxws-undertow-httpspi/trunk: src/main/java/org/jboss/ws/undertow_httpspi and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-27 09:19:12 -0500 (Mon, 27 Jan 2014)
New Revision: 18276
Modified:
projects/jaxws-undertow-httpspi/trunk/pom.xml
projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHeaderMap.java
projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHttpContext.java
projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHttpExchange.java
projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHttpHandler.java
projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowServer.java
Log:
Upgrading to Undertow Beta33 and making some fields final
Modified: projects/jaxws-undertow-httpspi/trunk/pom.xml
===================================================================
--- projects/jaxws-undertow-httpspi/trunk/pom.xml 2014-01-26 21:35:31 UTC (rev 18275)
+++ projects/jaxws-undertow-httpspi/trunk/pom.xml 2014-01-27 14:19:12 UTC (rev 18276)
@@ -30,7 +30,7 @@
<junit.version>4.8.1</junit.version>
<cxf.version>2.7.8</cxf.version>
<servlet-api.version>1.0.2.Final</servlet-api.version>
- <io.undertow.version>1.0.0.Beta30</io.undertow.version>
+ <io.undertow.version>1.0.0.Beta33</io.undertow.version>
</properties>
<!-- Dependencies -->
Modified: projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHeaderMap.java
===================================================================
--- projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHeaderMap.java 2014-01-26 21:35:31 UTC (rev 18275)
+++ projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHeaderMap.java 2014-01-27 14:19:12 UTC (rev 18276)
@@ -37,9 +37,8 @@
public class UndertowHeaderMap implements Map<String, List<String>>
{
+ private final HeaderMap headerMap;
- private HeaderMap headerMap;
-
public UndertowHeaderMap(HeaderMap headerMap) {
this.headerMap = headerMap;
}
Modified: projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHttpContext.java
===================================================================
--- projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHttpContext.java 2014-01-26 21:35:31 UTC (rev 18275)
+++ projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHttpContext.java 2014-01-27 14:19:12 UTC (rev 18276)
@@ -35,9 +35,9 @@
//TODO:Look at HttpHandlerImpl - avoid to create duplicate UndertowHttpContext to publish endpoint
public class UndertowHttpContext extends HttpContext
{
- private String handlerpath;
- private PathHandler pathHandler;
- private String path;
+ private final String handlerpath;
+ private final PathHandler pathHandler;
+ private final String path;
public UndertowHttpContext(PathHandler pathHandler, String contextPath, String path)
{
Modified: projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHttpExchange.java
===================================================================
--- projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHttpExchange.java 2014-01-26 21:35:31 UTC (rev 18275)
+++ projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHttpExchange.java 2014-01-27 14:19:12 UTC (rev 18276)
@@ -44,7 +44,7 @@
*/
public class UndertowHttpExchange extends HttpExchange
{
- private HttpServerExchange undertowExchange;
+ private final HttpServerExchange undertowExchange;
private UndertowHttpContext context;
Modified: projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHttpHandler.java
===================================================================
--- projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHttpHandler.java 2014-01-26 21:35:31 UTC (rev 18275)
+++ projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowHttpHandler.java 2014-01-27 14:19:12 UTC (rev 18276)
@@ -31,7 +31,7 @@
public class UndertowHttpHandler implements HttpHandler
{
- private javax.xml.ws.spi.http.HttpHandler spihandler;
+ private final javax.xml.ws.spi.http.HttpHandler spihandler;
public UndertowHttpHandler(javax.xml.ws.spi.http.HttpHandler handler)
{
Modified: projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowServer.java
===================================================================
--- projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowServer.java 2014-01-26 21:35:31 UTC (rev 18275)
+++ projects/jaxws-undertow-httpspi/trunk/src/main/java/org/jboss/ws/undertow_httpspi/UndertowServer.java 2014-01-27 14:19:12 UTC (rev 18276)
@@ -32,13 +32,13 @@
*/
public class UndertowServer
{
- private Builder builder;
- private PathHandler pathHandler;
+ private final Builder builder;
+ private final PathHandler pathHandler;
private Undertow undertow;
public UndertowServer(int port, String host)
{
- builder = Undertow.builder().addListener(port, host);
+ builder = Undertow.builder().addHttpListener(port, host);
pathHandler = new PathHandler();
}
10 years, 11 months
JBossWS SVN: r18275 - in stack/cxf/trunk/modules/testsuite/cxf-tests: src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-01-26 16:35:31 -0500 (Sun, 26 Jan 2014)
New Revision: 18275
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsCallbackHandler.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsOutInterceptor.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceIface.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasstore.jks
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java
Log:
[JBWS-3738] component pieces for ActAs test. Test not yet fully functional.
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2014-01-23 09:58:50 UTC (rev 18274)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2014-01-26 21:35:31 UTC (rev 18275)
@@ -465,25 +465,65 @@
</metainf>
</jar>
+
+ <!-- jaxws-samples-wsse-policy-trust-actas -->
+ <war
+ warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-trust-actas.war"
+ needxmlfile='false'>
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
+ name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceIface.class"/>
+ <include
+ name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceImpl.class"/>
+ <include
+ name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsOutInterceptor.class"/>
+ <include
+ name="org/jboss/test/ws/jaxws/samples/wsse/policy/jaxws/Say*.class"/>
+ <include
+ name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsCallbackHandler.class"/>
+ </classes>
+ <webinf
+ dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/trust/WEB-INF">
+ <include name="wsdl/ActAs*"/>
+ </webinf>
+ <zipfileset
+ dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/trust/WEB-INF"
+ prefix="WEB-INF/classes">
+ <include name="actasstore.jks"/>
+ <include name="actasKeystore.properties"/>
+ </zipfileset>
+ <manifest>
+ <attribute name="Dependencies"
+ value="org.jboss.ws.cxf.jbossws-cxf-client"/>
+ </manifest>
+ </war>
+
<!-- jaxws-samples-wsse-policy-trustPicketLink-sts -->
<war
- warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-trustPicketLink-sts.war" needxmlfile='false'>
- <classes dir="${tests.output.dir}/test-classes">
- <include name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/PicketLinkSTService.class"/>
- <include name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/STSCallbackHandler.class"/>
- </classes>
- <webinf dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/trust/WEB-INF">
- <include name="wsdl/PicketLinkSTS.wsdl"/>
- <include name="jboss-web.xml"/>
- </webinf>
- <zipfileset dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/trust/WEB-INF" prefix="WEB-INF/classes">
- <include name="stsstore.jks" />
- <include name="picketlink-sts.xml" />
- <include name="stsKeystore.properties" />
- </zipfileset>
- <manifest>
- <attribute name="Dependencies" value="org.jboss.ws.cxf.jbossws-cxf-client,org.picketlink"/>
- </manifest>
+ warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-trustPicketLink-sts.war"
+ needxmlfile='false'>
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
+ name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/PicketLinkSTService.class"/>
+ <include
+ name="org/jboss/test/ws/jaxws/samples/wsse/policy/trust/STSCallbackHandler.class"/>
+ </classes>
+ <webinf
+ dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/trust/WEB-INF">
+ <include name="wsdl/PicketLinkSTS.wsdl"/>
+ <include name="jboss-web.xml"/>
+ </webinf>
+ <zipfileset
+ dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/trust/WEB-INF"
+ prefix="WEB-INF/classes">
+ <include name="stsstore.jks"/>
+ <include name="picketlink-sts.xml"/>
+ <include name="stsKeystore.properties"/>
+ </zipfileset>
+ <manifest>
+ <attribute name="Dependencies"
+ value="org.jboss.ws.cxf.jbossws-cxf-client,org.picketlink"/>
+ </manifest>
</war>
<!-- jaxws-samples-wsse-policy-username-unsecure-transport -->
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsCallbackHandler.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsCallbackHandler.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsCallbackHandler.java 2014-01-26 21:35:31 UTC (rev 18275)
@@ -0,0 +1,55 @@
+/**
+ * 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.jboss.test.ws.jaxws.samples.wsse.policy.trust;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import java.io.IOException;
+
+/**
+ * User: rsearls(a)redhat.com
+ * Date: 1/26/14
+ */
+public class ActAsCallbackHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ if (callbacks[i] instanceof WSPasswordCallback) {
+ WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
+ if ("myclientkey".equals(pc.getIdentifier())) {
+ pc.setPassword("ckpass");
+ break;
+ } else if ("alice".equals(pc.getIdentifier())) {
+ pc.setPassword("clarinet");
+ break;
+ } else if ("bob".equals(pc.getIdentifier())) {
+ pc.setPassword("trombone");
+ break;
+ } else if ("eve".equals(pc.getIdentifier())) {
+ pc.setPassword("evekpass");
+ break;
+ }
+ }
+ }
+ }
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsOutInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsOutInterceptor.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsOutInterceptor.java 2014-01-26 21:35:31 UTC (rev 18275)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.trust;
+
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.interceptor.Fault;
+
+/**
+ * User: rsearls(a)redhat.com
+ * Date: 1/26/14
+ */
+public class ActAsOutInterceptor extends AbstractPhaseInterceptor<Message> {
+
+ public ActAsOutInterceptor () {
+ // This can be in any stage before the WS-SP interceptors
+ // setup the STS client and issued token interceptor.
+ super(Phase.SETUP);
+ }
+
+ @Override
+ public void handleMessage(Message message) throws Fault {
+ String tmpStr = "<wst:ActAs xmlns:wst=\"http://docs.oasis-open.org/ws-sx/ws-trust/200512\">eve</wst:ActAs>";
+ message.put(SecurityConstants.STS_TOKEN_ACT_AS, tmpStr);
+ }
+
+ @Override
+ public void handleFault(Message message) {
+ }
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceIface.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceIface.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceIface.java 2014-01-26 21:35:31 UTC (rev 18275)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.trust;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+/**
+ * User: rsearls(a)redhat.com
+ * Date: 1/26/14
+ */
+@WebService
+(
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy"
+)
+public interface ActAsServiceIface
+{
+ @WebMethod
+ String sayHello();
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/ActAsServiceImpl.java 2014-01-26 21:35:31 UTC (rev 18275)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.trust;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.apache.cxf.interceptor.InInterceptors;
+
+import javax.jws.WebService;
+
+/**
+ * User: rsearls(a)redhat.com
+ * Date: 1/26/14
+ */
+
+@WebService
+(
+ portName = "ActAsServicePort",
+ serviceName = "ActAsService",
+ wsdlLocation = "WEB-INF/wsdl/ActAsService.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.ActAsServiceIface"
+)
+//TODO: fix endpointProperties
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.username", value = "myservicekey"),
+ @EndpointProperty(key = "ws-security.signature.properties", value = "serviceKeystore.properties"),
+ @EndpointProperty(key = "ws-security.encryption.properties", value = "serviceKeystore.properties"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.trust.ActAsCallbackHandler")
+})
+@InInterceptors(interceptors = {"org.jboss.test.ws.jaxws.samples.wsse.policy.trust.ActAsOutInterceptor"})
+public class ActAsServiceImpl implements ActAsServiceIface
+{
+ public String sayHello()
+ {
+ return "ActAs WS-Trust Hello World!";
+ }
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustActAsTestCase.java 2014-01-26 21:35:31 UTC (rev 18275)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.trust;
+
+import junit.framework.Test;
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.jboss.wsf.test.JBossWSTest;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import java.net.URL;
+
+/**
+ * A demo of using WS-Trust ActAs extension.
+ *
+ * User: rsearls(a)redhat.com
+ * Date: 1/26/14
+ */
+public class WSTrustActAsTestCase extends JBossWSTest
+{
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-trust/SecurityService";
+ private final String stsURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService";
+
+ public static Test suite()
+ {
+ //deploy client, STS and service; start a security domain to be used by the STS for authenticating client
+ return WSTrustTestUtils.getTestSetup(WSTrustActAsTestCase.class,
+ "jaxws-samples-wsse-policy-trust-client.jar jaxws-samples-wsse-policy-trust-sts.war jaxws-samples-wsse-policy-trust.war jaxws-samples-wsse-policy-trust-actas.war");
+ }
+
+ /**
+ * Request a security token that allows it to act as if it were somebody else.
+ *
+ * @throws Exception
+ */
+ public void testActAs() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
+ final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
+
+ final QName stsServiceName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "SecurityTokenService");
+ final QName stsPortName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "UT_Port");
+ WSTrustTestUtils.setupWsseAndSTSClientActAs(proxy, bus, stsURL + "?wsdl", stsServiceName, stsPortName);
+
+ assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
+}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java 2014-01-23 09:58:50 UTC (rev 18274)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java 2014-01-26 21:35:31 UTC (rev 18275)
@@ -127,11 +127,58 @@
ctx.put(SecurityConstants.STS_CLIENT, createSTSClient(bus, stsWsdlLocation, stsService, stsPort));
}
+ /**
+ * Request a security token that allows it to act as if it were somebody else.
+ *
+ * @param proxy
+ * @param bus
+ * @param stsWsdlLocation
+ * @param stsService
+ * @param stsPort
+ */
+ public static void setupWsseAndSTSClientActAs(ServiceIface proxy, Bus bus, String stsWsdlLocation, QName stsService, QName stsPort) {
+ Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
+
+ ctx.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
+ ctx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myservicekey");
+ // the 2 following are required here.
+ ctx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(SecurityConstants.SIGNATURE_USERNAME, "myclientkey");
+
+ STSClient stsClient = new STSClient(bus);
+ Map<String, Object> props = stsClient.getProperties();
+ props.put(SecurityConstants.USERNAME, "alice");
+ props.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
+
+ props.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ props.put(SecurityConstants.ENCRYPT_USERNAME, "mystskey");
+
+ props.put(SecurityConstants.STS_TOKEN_USERNAME, "myclientkey");
+ props.put(SecurityConstants.STS_TOKEN_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ props.put(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO, "true");
+
+ ctx.put(SecurityConstants.STS_CLIENT, stsClient);
+ }
+
private static String appendIssuedTokenSuffix(String prop)
{
return prop + ".it";
}
+ /**
+ * Create and configure an STSClient for use by service ServiceImpl.
+ *
+ * Whenever an "<sp:IssuedToken>" policy is configured on a WSDL port, as is the
+ * case for ServiceImpl, a STSClient must be created and configured in
+ * order for the service to connect to the STS-server to obtain a token.
+ *
+ * @param bus
+ * @param stsWsdlLocation
+ * @param stsService
+ * @param stsPort
+ * @return
+ */
private static STSClient createSTSClient(Bus bus, String stsWsdlLocation, QName stsService, QName stsPort){
STSClient stsClient = new STSClient(bus);
if (stsWsdlLocation != null) {
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasKeystore.properties
===================================================================
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/actasstore.jks
===================================================================
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService.wsdl 2014-01-26 21:35:31 UTC (rev 18275)
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy" name="ActAsService"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsaws="http://www.w3.org/2005/08/addressing"
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
+ xmlns:t="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy" schemaLocation="ActAsService_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="sayHello">
+ <part name="parameters" element="tns:sayHello"/>
+ </message>
+ <message name="sayHelloResponse">
+ <part name="parameters" element="tns:sayHelloResponse"/>
+ </message>
+ <portType name="ActAsServiceIface">
+ <operation name="sayHello">
+ <input message="tns:sayHello"/>
+ <output message="tns:sayHelloResponse"/>
+ </operation>
+ </portType>
+ <binding name="ActAsServicePortBinding" type="tns:ActAsServiceIface">
+ <wsp:PolicyReference URI="#AsymmetricSAML2Policy" />
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#Input_Policy" />
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#Output_Policy" />
+ </output>
+ </operation>
+ </binding>
+ <service name="ActAsService">
+ <port name="ActAsServicePort" binding="tns:ActAsServicePortBinding">
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust/ActAsService"/>
+ </port>
+ </service>
+
+ <wsp:Policy wsu:Id="AsymmetricSAML2Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsam:Addressing wsp:Optional="false">
+ <wsp:Policy />
+ </wsam:Addressing>
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:IssuedToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <sp:RequestSecurityTokenTemplate>
+ <t:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</t:TokenType>
+ <t:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey</t:KeyType>
+ </sp:RequestSecurityTokenTemplate>
+ <wsp:Policy>
+ <sp:RequireInternalReference />
+ </wsp:Policy>
+ <sp:Issuer>
+ <wsaws:Address>http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService</wsaws:Address>
+ <wsaws:Metadata xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ wsdli:wsdlLocation="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-trust-sts/SecurityTokenService?wsdl">
+ <wsaw:ServiceName xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+ xmlns:stsns="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+ EndpointName="UT_Port">stsns:SecurityTokenService</wsaw:ServiceName>
+ </wsaws:Metadata>
+ </sp:Issuer>
+ </sp:IssuedToken>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V3Token10 />
+ <sp:RequireIssuerSerialReference />
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax />
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp />
+ <sp:OnlySignEntireHeadersAndBody />
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256 />
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefIssuerSerial />
+ <sp:MustSupportRefThumbprint />
+ <sp:MustSupportRefEncryptedKey />
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust13>
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens />
+ <sp:RequireClientEntropy />
+ <sp:RequireServerEntropy />
+ </wsp:Policy>
+ </sp:Trust13>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+ <wsp:Policy wsu:Id="Input_Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body />
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body />
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+ <wsp:Policy wsu:Id="Output_Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body />
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body />
+ <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
+ <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+</definitions>
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/trust/WEB-INF/wsdl/ActAsService_schema1.xsd 2014-01-26 21:35:31 UTC (rev 18275)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/actaswssecuritypolicy"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="sayHello" type="tns:sayHello"/>
+
+ <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
+
+ <xs:complexType name="sayHello">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="sayHelloResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
10 years, 11 months
JBossWS SVN: r18274 - in stack/cxf/trunk/modules/testsuite: cxf-spring-tests/scripts and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2014-01-23 04:58:50 -0500 (Thu, 23 Jan 2014)
New Revision: 18274
Added:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/HelloWorldService.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/HelloWorldServiceI.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/JBWS3670TestCase.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/TestBean.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/jbws3670/
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/jbws3670/WEB-INF/
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/jbws3670/WEB-INF/jbossws-cxf.xml
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/jbws3670/WEB-INF/web.xml
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-jars-jaxws.xml
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3670]:Add test case
Modified: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-jars-jaxws.xml 2014-01-23 09:57:29 UTC (rev 18273)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/scripts/cxf-jars-jaxws.xml 2014-01-23 09:58:50 UTC (rev 18274)
@@ -152,6 +152,16 @@
<attribute name="Dependencies" value="org.apache.cxf,org.jboss.ws.cxf.jbossws-cxf-server"/>
</manifest>
</war>
+ <!-- jaxws-cxf-jbws-3670-->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-cxf-jbws3670.war" webxml="${tests.output.dir}/test-resources/jaxws/cxf/jbws3670/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/cxf/jbws3670/HelloWorldService*.class"/>
+ <include name="org/jboss/test/ws/jaxws/cxf/jbws3670/TestBean.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/cxf/jbws3670/WEB-INF">
+ <include name="jbossws-cxf.xml"/>
+ </webinf>
+ </war>
<!-- jaxws-cxf-jms-api -->
<war warfile="${tests.output.dir}/test-libs/jaxws-cxf-jms-api.war"
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/HelloWorldService.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/HelloWorldService.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/HelloWorldService.java 2014-01-23 09:58:50 UTC (rev 18274)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jbws3670;
+import javax.jws.WebService;
+
+
+@WebService(serviceName = "HelloWorldService", endpointInterface = "org.jboss.test.ws.jaxws.cxf.jbws3670.HelloWorldServiceI", targetNamespace = "http://jbossws.jboss.org/helloworld", portName = "HelloWorldServicePort")
+public class HelloWorldService implements HelloWorldServiceI
+{
+ private TestBean testBean;
+
+ public HelloWorldService () {
+
+ }
+ public HelloWorldService(TestBean testBean)
+ {
+ this.testBean = testBean;
+ }
+
+ @Override
+ public String sayHello(String username)
+ {
+ if (testBean == null) {
+ return "";
+ }
+ return "Hello " + username ;
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/HelloWorldService.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/HelloWorldServiceI.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/HelloWorldServiceI.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/HelloWorldServiceI.java 2014-01-23 09:58:50 UTC (rev 18274)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jbws3670;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+
+@WebService(name = "HelloWorldServicePortType", targetNamespace = "http://jbossws.jboss.org/helloworld")
+public interface HelloWorldServiceI
+{
+ @WebMethod
+ public String sayHello(@WebParam(name = "username") String username);
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/HelloWorldServiceI.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/JBWS3670TestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/JBWS3670TestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/JBWS3670TestCase.java 2014-01-23 09:58:50 UTC (rev 18274)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jbws3670;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+public class JBWS3670TestCase extends JBossWSTest
+{
+ private String endpointURL = "http://" + getServerHost() + ":8080/jaxws-cxf-jbws3670/helloworld";
+ private String targetNS = "http://jbossws.jboss.org/helloworld";
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(JBWS3670TestCase.class, "jaxws-cxf-jbws3670.war");
+ }
+
+ public void testAccess() throws Exception
+ {
+ URL wsdlURL = new URL(endpointURL + "?wsdl");
+ QName serviceName = new QName(targetNS, "HelloWorldService");
+ Service service = Service.create(wsdlURL, serviceName);
+ HelloWorldServiceI port = service.getPort(HelloWorldServiceI.class);
+ assertEquals("TestBean is not injected", "Hello jbossws", port.sayHello("jbossws"));
+ }
+
+
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/JBWS3670TestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/TestBean.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/TestBean.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/TestBean.java 2014-01-23 09:58:50 UTC (rev 18274)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jbws3670;
+
+public class TestBean
+{
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3670/TestBean.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/jbws3670/WEB-INF/jbossws-cxf.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/jbws3670/WEB-INF/jbossws-cxf.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/jbws3670/WEB-INF/jbossws-cxf.xml 2014-01-23 09:58:50 UTC (rev 18274)
@@ -0,0 +1,25 @@
+<beans xmlns='http://www.springframework.org/schema/beans'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:beans='http://www.springframework.org/schema/beans'
+ xmlns:jaxws='http://cxf.apache.org/jaxws'
+ xmlns:cxf='http://cxf.apache.org/core'
+ xsi:schemaLocation='http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://cxf.apache.org/jaxws
+ http://cxf.apache.org/schemas/jaxws.xsd
+ http://cxf.apache.org/core
+ http://cxf.apache.org/schemas/core.xsd'>
+
+ <jaxws:endpoint id="helloWorldServiceEndpoint"
+ address="http://@jboss.bind.address@:8080/jaxws-cxf-jbws3670/helloworld"
+ implementor="#helloWorldServiceBean">
+
+ </jaxws:endpoint>
+
+ <bean id="testBean" class="org.jboss.test.ws.jaxws.cxf.jbws3670.TestBean" />
+
+ <bean id="helloWorldServiceBean" class="org.jboss.test.ws.jaxws.cxf.jbws3670.HelloWorldService">
+ <constructor-arg ref="testBean" />
+ </bean>
+
+</beans>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/jbws3670/WEB-INF/jbossws-cxf.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/jbws3670/WEB-INF/web.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/jbws3670/WEB-INF/web.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/jbws3670/WEB-INF/web.xml 2014-01-23 09:58:50 UTC (rev 18274)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+
+ <servlet>
+ <servlet-name>HelloWorldService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.cxf.jbws3670.HelloWorldService</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>HelloWorldService</servlet-name>
+ <url-pattern>/helloworld</url-pattern>
+ </servlet-mapping>
+</web-app>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/resources/jaxws/cxf/jbws3670/WEB-INF/web.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2014-01-23 09:57:29 UTC (rev 18273)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2014-01-23 09:58:50 UTC (rev 18274)
@@ -737,6 +737,9 @@
<!-- Manually setup KDC before run this test-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/kerberos/*TestCase*</exclude>
+
+ <!-- # [JBWS-3620]:Enable it after the fix merged to upstream-->
+ <exclude>org/jboss/test/ws/jaxws/cxf/jbws3670/*TestCase*</exclude>
</excludes>
</configuration>
</plugin>
10 years, 11 months
JBossWS SVN: r18273 - in container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices: invocation and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2014-01-23 04:57:29 -0500 (Thu, 23 Jan 2014)
New Revision: 18273
Modified:
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/injection/WSComponent.java
container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java
Log:
[JBWS-3670]:Set reference in the WSComponent to avoid duplicate targetBean construction
Modified: container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/injection/WSComponent.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/injection/WSComponent.java 2014-01-22 14:53:45 UTC (rev 18272)
+++ container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/injection/WSComponent.java 2014-01-23 09:57:29 UTC (rev 18273)
@@ -23,6 +23,7 @@
import org.jboss.as.ee.component.BasicComponent;
import org.jboss.as.ee.component.BasicComponentInstance;
+import org.jboss.as.naming.ManagedReference;
/**
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
@@ -30,6 +31,7 @@
public final class WSComponent extends BasicComponent {
private volatile BasicComponentInstance wsComponentInstance;
+ private volatile ManagedReference reference;
/**
* We can't lock on <code>this</code> because the
@@ -43,16 +45,24 @@
}
public BasicComponentInstance getComponentInstance() {
- if (wsComponentInstance == null) {
- synchronized (lock) {
- if (wsComponentInstance == null) {
- wsComponentInstance = (BasicComponentInstance) createInstance();
- }
- }
- }
- return wsComponentInstance;
+ if (wsComponentInstance == null) {
+ synchronized (lock) {
+ if (wsComponentInstance == null && reference == null) {
+ wsComponentInstance = (BasicComponentInstance) createInstance();
+ }
+ if (wsComponentInstance == null && reference != null) {
+ wsComponentInstance = (BasicComponentInstance) this.createInstance(reference.getInstance());
+ }
+ }
+ }
+ return wsComponentInstance;
}
+
+ public void setReference(ManagedReference reference) {
+ this.reference = reference;
+ }
+
@Override
public void stop() {
if (wsComponentInstance == null) return;
Modified: container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java
===================================================================
--- container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java 2014-01-22 14:53:45 UTC (rev 18272)
+++ container/jboss72/branches/jbossws-jboss720/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java 2014-01-23 09:57:29 UTC (rev 18273)
@@ -36,6 +36,7 @@
import org.jboss.as.ee.component.Component;
import org.jboss.as.ee.component.ComponentView;
import org.jboss.as.naming.ManagedReference;
+import org.jboss.as.webservices.injection.WSComponent;
import org.jboss.invocation.InterceptorContext;
import org.jboss.msc.service.ServiceName;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -69,18 +70,20 @@
protected ComponentView getComponentView() {
// we need to check both, otherwise it is possible for
// componentView to be initialized before reference
- if (componentView == null || reference == null) {
+ if (componentView == null) {
synchronized(this) {
if (componentView == null) {
componentView = getMSCService(componentViewName, ComponentView.class);
if (componentView == null) {
throw MESSAGES.cannotFindComponentView(componentViewName);
}
- try {
- reference = componentView.createInstance();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
+ if (reference == null) {
+ try {
+ reference = componentView.createInstance();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
}
}
}
@@ -98,8 +101,22 @@
try {
// prepare for invocation
onBeforeInvocation(wsInvocation);
+ //for spring integration we don't need to go into ee's interceptors
+ if(wsInvocation.getInvocationContext().getTargetBean() != null) {
+ this.reference = new ManagedReference() {
+ public void release() {
+ }
+ public Object getInstance()
+ {
+ return wsInvocation.getInvocationContext().getTargetBean();
+ }
+ };
+ }
// prepare invocation data
final ComponentView componentView = getComponentView();
+ if (reference != null) {
+ ((WSComponent)componentView.getComponent()).setReference(reference);
+ }
final Method method = getComponentViewMethod(wsInvocation.getJavaMethod(), componentView.getViewMethods());
final InterceptorContext context = new InterceptorContext();
prepareForInvocation(context, wsInvocation);
@@ -108,7 +125,7 @@
context.setTarget(reference.getInstance());
context.putPrivateData(Component.class, componentView.getComponent());
context.putPrivateData(ComponentView.class, componentView);
- // invoke method
+ // invoke method
final Object retObj = componentView.invoke(context);
// set return value
wsInvocation.setReturnValue(retObj);
10 years, 11 months
JBossWS SVN: r18272 - stack/cxf/trunk/modules/client.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-22 09:53:45 -0500 (Wed, 22 Jan 2014)
New Revision: 18272
Modified:
stack/cxf/trunk/modules/client/pom.xml
Log:
[JBWS-3722] Explicitly set JAXB impl / xjc dependencies in jbossws-cxf-client to be sure the dependencyManagement blocks from jbossws-cxf main pom.xml are used to choose the version. This prevent different versions (2.1 vs 2.2) from being used depending on the current JDK (Apache CXF has a maven profile that sets jaxb version depending on current jdk)
Modified: stack/cxf/trunk/modules/client/pom.xml
===================================================================
--- stack/cxf/trunk/modules/client/pom.xml 2014-01-22 14:51:18 UTC (rev 18271)
+++ stack/cxf/trunk/modules/client/pom.xml 2014-01-22 14:53:45 UTC (rev 18272)
@@ -220,6 +220,16 @@
<groupId>org.jboss.spec.javax.xml.soap</groupId>
<artifactId>jboss-saaj-api_1.3_spec</artifactId>
</dependency>
+
+ <!-- [JBWS-3722] Explicit JAXB dependencies to ensure the dependency management from jbossws-cxf pom.xml applies -->
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-xjc</artifactId>
+ </dependency>
<!-- jboss provided -->
<dependency>
10 years, 11 months
JBossWS SVN: r18271 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-22 09:51:18 -0500 (Wed, 22 Jan 2014)
New Revision: 18271
Modified:
stack/cxf/trunk/pom.xml
Log:
Moving to JAXB 2.2.6 (sync with cxf)
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2014-01-22 14:32:26 UTC (rev 18270)
+++ stack/cxf/trunk/pom.xml 2014-01-22 14:51:18 UTC (rev 18271)
@@ -83,7 +83,7 @@
<httpserver.version>1.0.0.Final</httpserver.version>
<io.undertow.version>1.0.0.Beta30</io.undertow.version>
<jaxb.api.version>1.0.4.Final</jaxb.api.version>
- <jaxb.impl.version>2.2.5</jaxb.impl.version>
+ <jaxb.impl.version>2.2.6</jaxb.impl.version>
<jaxrpc.api.version>1.0.1.Final</jaxrpc.api.version>
<jaxws.api.version>2.0.2.Final</jaxws.api.version>
<jsr181.api.version>1.0-MR1</jsr181.api.version>
10 years, 11 months
JBossWS SVN: r18270 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-01-22 09:32:26 -0500 (Wed, 22 Jan 2014)
New Revision: 18270
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java
Log:
JBWS-3738: Added tests for CallbackHander and Signaturename attributes
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java 2014-01-21 14:44:00 UTC (rev 18269)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java 2014-01-22 14:32:26 UTC (rev 18270)
@@ -116,4 +116,60 @@
bus.shutdown(true);
}
}
+
+ /**
+ * No CallbackHandler is provided in STSCLient. Username and password provided instead.
+ *
+ * @throws Exception
+ */
+ public void testNoClientCallback() throws Exception {
+ Bus bus = BusFactory.newInstance().createBus();
+ try {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
+ final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
+
+ final QName stsServiceName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "SecurityTokenService");
+ final QName stsPortName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "UT_Port");
+ WSTrustTestUtils.setupWsseAndSTSClientNoCallbackHandler(proxy, bus, stsURL + "?wsdl", stsServiceName, stsPortName);
+
+ assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ } finally {
+ bus.shutdown(true);
+ }
+ }
+
+ /**
+ * No SIGNATURE_USERNAME is provided to the service. Service will use the
+ * client's keystore alias in its place.
+ *
+ * @throws Exception
+ */
+ public void testNoSignatureUsername() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try
+ {
+ BusFactory.setThreadDefaultBus(bus);
+
+ final QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "SecurityService");
+ final URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
+
+ final QName stsServiceName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "SecurityTokenService");
+ final QName stsPortName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "UT_Port");
+ WSTrustTestUtils.setupWsseAndSTSClientNoSignatureUsername(proxy, bus, stsURL + "?wsdl", stsServiceName, stsPortName);
+
+ assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
+
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java 2014-01-21 14:44:00 UTC (rev 18269)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestUtils.java 2014-01-22 14:32:26 UTC (rev 18270)
@@ -56,11 +56,83 @@
public static void setupWsseAndSTSClient(ServiceIface proxy, Bus bus, String stsWsdlLocation, QName stsService, QName stsPort)
{
Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
+ setServiceContextAttributes(ctx);
+ ctx.put(SecurityConstants.STS_CLIENT, createSTSClient(bus, stsWsdlLocation, stsService, stsPort));
+ }
+
+ public static void setupWsse(ServiceIface proxy, Bus bus)
+ {
+ Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
+ setServiceContextAttributes(ctx);
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.USERNAME), "alice");
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.CALLBACK_HANDLER), new ClientCallbackHandler());
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.ENCRYPT_PROPERTIES), Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.ENCRYPT_USERNAME), "mystskey");
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_USERNAME), "myclientkey");
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_PROPERTIES), Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO), "true");
+ }
+
+
+ /**
+ * A PASSWORD is provided in place of the ClientCallbackHandler in the
+ * STSClient. A USERNAME and PASSWORD is required by CXF in the msg.
+ *
+ * @param proxy
+ * @param bus
+ * @param stsWsdlLocation
+ * @param stsService
+ * @param stsPort
+ * @see org.apache.cxf.ws.security.SecurityConstants#PASSWORD
+ */
+ public static void setupWsseAndSTSClientNoCallbackHandler(ServiceIface proxy, Bus bus, String stsWsdlLocation, QName stsService, QName stsPort) {
+ Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
+ setServiceContextAttributes(ctx);
+
+ STSClient stsClient = new STSClient(bus);
+ if (stsWsdlLocation != null) {
+ stsClient.setWsdlLocation(stsWsdlLocation);
+ stsClient.setServiceQName(stsService);
+ stsClient.setEndpointQName(stsPort);
+ }
+ Map<String, Object> props = stsClient.getProperties();
+ props.put(SecurityConstants.USERNAME, "alice");
+ props.put(SecurityConstants.PASSWORD, "clarinet");
+ props.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ props.put(SecurityConstants.ENCRYPT_USERNAME, "mystskey");
+ props.put(SecurityConstants.STS_TOKEN_USERNAME, "myclientkey");
+ props.put(SecurityConstants.STS_TOKEN_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
+ props.put(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO, "true");
+ ctx.put(SecurityConstants.STS_CLIENT, stsClient);
+ }
+
+ /**
+ * Uses the SIGNATURE_PROPERTIES keystore's "alias name" as the SIGNATURE_USERNAME when
+ * USERNAME and SIGNATURE_USERNAME is not provided.
+ *
+ * @param proxy
+ * @param bus
+ * @param stsWsdlLocation
+ * @param stsService
+ * @param stsPort
+ * @see org.apache.cxf.ws.security.SecurityConstants#SIGNATURE_PROPERTIES
+ */
+ public static void setupWsseAndSTSClientNoSignatureUsername(ServiceIface proxy, Bus bus, String stsWsdlLocation, QName stsService, QName stsPort) {
+ Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
ctx.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
ctx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
ctx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
- ctx.put(SecurityConstants.SIGNATURE_USERNAME, "myclientkey");
ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myservicekey");
+
+ ctx.put(SecurityConstants.STS_CLIENT, createSTSClient(bus, stsWsdlLocation, stsService, stsPort));
+ }
+
+ private static String appendIssuedTokenSuffix(String prop)
+ {
+ return prop + ".it";
+ }
+
+ private static STSClient createSTSClient(Bus bus, String stsWsdlLocation, QName stsService, QName stsPort){
STSClient stsClient = new STSClient(bus);
if (stsWsdlLocation != null) {
stsClient.setWsdlLocation(stsWsdlLocation);
@@ -75,28 +147,14 @@
props.put(SecurityConstants.STS_TOKEN_USERNAME, "myclientkey");
props.put(SecurityConstants.STS_TOKEN_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
props.put(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO, "true");
- ctx.put(SecurityConstants.STS_CLIENT, stsClient);
+ return stsClient;
}
-
- public static void setupWsse(ServiceIface proxy, Bus bus)
- {
- Map<String, Object> ctx = ((BindingProvider) proxy).getRequestContext();
+
+ private static void setServiceContextAttributes(Map<String, Object> ctx){
ctx.put(SecurityConstants.CALLBACK_HANDLER, new ClientCallbackHandler());
ctx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
ctx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
ctx.put(SecurityConstants.SIGNATURE_USERNAME, "myclientkey");
ctx.put(SecurityConstants.ENCRYPT_USERNAME, "myservicekey");
- ctx.put(appendIssuedTokenSuffix(SecurityConstants.USERNAME), "alice");
- ctx.put(appendIssuedTokenSuffix(SecurityConstants.CALLBACK_HANDLER), new ClientCallbackHandler());
- ctx.put(appendIssuedTokenSuffix(SecurityConstants.ENCRYPT_PROPERTIES), Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
- ctx.put(appendIssuedTokenSuffix(SecurityConstants.ENCRYPT_USERNAME), "mystskey");
- ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_USERNAME), "myclientkey");
- ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_PROPERTIES), Thread.currentThread().getContextClassLoader().getResource("META-INF/clientKeystore.properties"));
- ctx.put(appendIssuedTokenSuffix(SecurityConstants.STS_TOKEN_USE_CERT_FOR_KEYINFO), "true");
}
-
- private static String appendIssuedTokenSuffix(String prop)
- {
- return prop + ".it";
- }
}
10 years, 11 months
JBossWS SVN: r18269 - in stack/cxf/trunk/modules/testsuite: cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648 and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-01-21 09:44:00 -0500 (Tue, 21 Jan 2014)
New Revision: 18269
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/wsf/test/CryptoHelper.java
stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/CryptoCheckMain.java
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptHelper.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java
stack/cxf/trunk/modules/testsuite/test-utils/pom.xml
Log:
[JBWS-3662] Improving checks on availability of BouncyCastle and JCE unlimited strength crypto; also adding a check before running tests (and hence before any client side automatic registration of security provider).
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2014-01-21 11:04:21 UTC (rev 18268)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2014-01-21 14:44:00 UTC (rev 18269)
@@ -389,6 +389,7 @@
<war warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-sign-encrypt-client.war" needxmlfile='false'>
<classes dir="${tests.output.dir}/test-classes">
<include name="org/jboss/wsf/test/ClientHelper.class"/>
+ <include name="org/jboss/wsf/test/CryptoHelper.class"/>
<include name="org/jboss/wsf/test/TestServlet.class"/>
<include name="org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptHelper.class"/>
<include name="org/jboss/test/ws/jaxws/samples/wsse/policy/basic/ServiceIface.class"/>
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentTestCase.java 2014-01-21 11:04:21 UTC (rev 18268)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentTestCase.java 2014-01-21 14:44:00 UTC (rev 18269)
@@ -36,6 +36,7 @@
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.ws.security.SecurityConstants;
import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
+import org.jboss.wsf.test.CryptoHelper;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -91,7 +92,11 @@
EndpointFour proxy = (EndpointFour)service.getPort(EndpointFour.class);
setupWsse((BindingProvider)proxy);
- assertEquals("Foo4", proxy.echo("Foo4"));
+ try {
+ assertEquals("Foo4", proxy.echo("Foo4"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
final String m = bos.toString();
assertTrue("WS-Addressing was not enabled!", m.contains("http://www.w3.org/2005/08/addressing") && m.contains("http://www.w3.org/2005/08/addressing/anonymous"));
assertTrue("WS-Security was not enabled!", m.contains("http://www.w3.org/2001/04/xmlenc#rsa-1_5") && m.contains("http://www.w3.org/2001/04/xmlenc#aes256-cbc"));
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java 2014-01-21 11:04:21 UTC (rev 18268)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/AnnotatedSignEncryptTestCase.java 2014-01-21 14:44:00 UTC (rev 18269)
@@ -32,6 +32,7 @@
import junit.framework.Test;
import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.wsf.test.CryptoHelper;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -69,12 +70,16 @@
public void test() throws Exception
{
- QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "AnnotatedSecurityService");
- URL wsdlURL = new URL(serviceURL + "?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- AnnotatedServiceIface proxy = (AnnotatedServiceIface)service.getPort(AnnotatedServiceIface.class);
- setupWsse(proxy);
- assertEquals("Secure Hello World!", proxy.sayHello());
+ try {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "AnnotatedSecurityService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ AnnotatedServiceIface proxy = (AnnotatedServiceIface)service.getPort(AnnotatedServiceIface.class);
+ setupWsse(proxy);
+ assertEquals("Secure Hello World!", proxy.sayHello());
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
private void setupWsse(AnnotatedServiceIface proxy)
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptHelper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptHelper.java 2014-01-21 11:04:21 UTC (rev 18268)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/basic/SignEncryptHelper.java 2014-01-21 14:44:00 UTC (rev 18269)
@@ -34,6 +34,7 @@
import org.apache.cxf.ws.security.SecurityConstants;
import org.jboss.ws.api.configuration.ClientConfigUtil;
import org.jboss.wsf.test.ClientHelper;
+import org.jboss.wsf.test.CryptoHelper;
public class SignEncryptHelper implements ClientHelper
{
@@ -91,7 +92,7 @@
}
catch (SOAPFaultException e)
{
- throw new Exception("Please check that the Bouncy Castle provider is installed.", e);
+ throw CryptoHelper.checkAndWrapException(e);
}
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java 2014-01-21 11:04:21 UTC (rev 18268)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java 2014-01-21 14:44:00 UTC (rev 18269)
@@ -31,6 +31,7 @@
import org.apache.cxf.ws.security.SecurityConstants;
import org.jboss.test.ws.jaxws.samples.wsse.policy.basic.KeystorePasswordCallback;
+import org.jboss.wsf.test.CryptoHelper;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -68,7 +69,11 @@
Service service = Service.create(new URL(serviceURL + "SecurityService221?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService221Port"), ServiceIface.class);
setupWsse(proxy);
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) X.509 Certificates, Sign, Encrypt"));
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) X.509 Certificates, Sign, Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
/**
@@ -86,7 +91,11 @@
Service service = Service.create(new URL(serviceURL + "SecurityService222?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService222Port"), ServiceIface.class);
setupWsse(proxy);
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) Mutual Authentication with X.509 Certificates, Sign, Encrypt"));
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) Mutual Authentication with X.509 Certificates, Sign, Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
/**
@@ -104,7 +113,11 @@
Service service = Service.create(new URL(serviceURL + "SecurityService223?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService223Port"), ServiceIface.class);
setupWsse(proxy);
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) Anonymous with X.509 Certificates, Sign, Encrypt"));
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) Anonymous with X.509 Certificates, Sign, Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
/**
@@ -122,7 +135,11 @@
Service service = Service.create(new URL(serviceURL + "SecurityService224?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService224Port"), ServiceIface.class);
setupWsse(proxy);
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) Mutual Authentication with X.509 Certificates, Sign, Encrypt"));
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) Mutual Authentication with X.509 Certificates, Sign, Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
private void setupWsse(ServiceIface proxy)
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java 2014-01-21 11:04:21 UTC (rev 18268)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java 2014-01-21 14:44:00 UTC (rev 18269)
@@ -32,6 +32,7 @@
import junit.framework.Test;
import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.wsf.test.CryptoHelper;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -155,7 +156,11 @@
reqCtx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
reqCtx.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Sender Vouches with X.509 Certificates, Sign, Optional Encrypt"));
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Sender Vouches with X.509 Certificates, Sign, Optional Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
/**
@@ -177,7 +182,11 @@
reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
reqCtx.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
reqCtx.put(SecurityConstants.SELF_SIGN_SAML_ASSERTION, "true");
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Holder of Key, Sign, Optional Encrypt"));
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Holder of Key, Sign, Optional Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
/**
@@ -257,6 +266,10 @@
reqCtx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
reqCtx.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
- assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) SAML1.1/2.0 Sender Vouches with X.509 Certificate, Sign, Encrypt"));
+ try {
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) SAML1.1/2.0 Sender Vouches with X.509 Certificate, Sign, Encrypt"));
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase.java 2014-01-21 11:04:21 UTC (rev 18268)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustPicketLinkTestCase.java 2014-01-21 14:44:00 UTC (rev 18269)
@@ -30,6 +30,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.jboss.wsf.test.CryptoHelper;
import org.jboss.wsf.test.JBossWSTest;
/**
@@ -66,7 +67,11 @@
final QName stsPortName = new QName("urn:picketlink:identity-federation:sts", "PicketLinkSTSPort");
WSTrustTestUtils.setupWsseAndSTSClient(proxy, bus, stsURL + "?wsdl", stsServiceName, stsPortName);
- assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ try {
+ assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
finally
{
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java 2014-01-21 11:04:21 UTC (rev 18268)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/trust/WSTrustTestCase.java 2014-01-21 14:44:00 UTC (rev 18269)
@@ -30,6 +30,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.jboss.wsf.test.CryptoHelper;
import org.jboss.wsf.test.JBossWSTest;
/**
@@ -72,8 +73,12 @@
final QName stsServiceName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "SecurityTokenService");
final QName stsPortName = new QName("http://docs.oasis-open.org/ws-sx/ws-trust/200512/", "UT_Port");
WSTrustTestUtils.setupWsseAndSTSClient(proxy, bus, stsURL + "?wsdl", stsServiceName, stsPortName);
-
- assertEquals("WS-Trust Hello World!", proxy.sayHello());
+
+ try {
+ assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
finally
{
@@ -100,7 +105,11 @@
WSTrustTestUtils.setupWsse(proxy, bus);
- assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ try {
+ assertEquals("WS-Trust Hello World!", proxy.sayHello());
+ } catch (Exception e) {
+ throw CryptoHelper.checkAndWrapException(e);
+ }
}
finally
{
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/wsf/test/CryptoHelper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/wsf/test/CryptoHelper.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/wsf/test/CryptoHelper.java 2014-01-21 14:44:00 UTC (rev 18269)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.test;
+
+import java.security.NoSuchAlgorithmException;
+
+import org.apache.cxf.binding.soap.SoapFault;
+
+public final class CryptoHelper
+{
+ public static Exception checkAndWrapException(Exception e) throws Exception {
+ if (!isBouncyCastleAvailable()) {
+ return new Exception("Bouncy Castle JCE provider does not seem to be properly installed; either install it " +
+ "or run the testuite with -Dexclude-integration-tests-BC-related=true to exclude this test.", e);
+ } else if(!isUnlimitedStrengthCryptographyAvailable()) {
+ return new Exception("JCE unlimited strength cryptography extension does not seem to be properly installed; either install it " +
+ "or run the testuite with '-Dexclude-integration-tests-unlimited-strength-related=true' to exclude this test.", e);
+ } else if (e.getCause() != null && e.getCause() instanceof SoapFault && e.getMessage() != null && e.getMessage().contains("algorithm")) {
+ return new Exception("Please check for Bouncy Castle JCE provider and JCE unlimited strenght cryptography extension availability on server side.", e);
+ } else {
+ return e;
+ }
+ }
+
+ public static boolean isBouncyCastleAvailable() {
+ return java.security.Security.getProvider("BC") != null;
+ }
+
+ public static boolean isUnlimitedStrengthCryptographyAvailable() {
+ try {
+ return (javax.crypto.Cipher.getMaxAllowedKeyLength("RC5") >= 256);
+ } catch (NoSuchAlgorithmException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/wsf/test/CryptoHelper.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/test-utils/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-utils/pom.xml 2014-01-21 11:04:21 UTC (rev 18268)
+++ stack/cxf/trunk/modules/testsuite/test-utils/pom.xml 2014-01-21 14:44:00 UTC (rev 18269)
@@ -32,4 +32,26 @@
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <id>check-bc-and-unlimited-crypto</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>org.jboss.wsf.test.CryptoCheckMain</mainClass>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
Added: stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/CryptoCheckMain.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/CryptoCheckMain.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/CryptoCheckMain.java 2014-01-21 14:44:00 UTC (rev 18269)
@@ -0,0 +1,19 @@
+package org.jboss.wsf.test;
+
+/**
+ *
+ * @author Rostislav Svoboda
+ */
+public class CryptoCheckMain
+{
+
+ public static void main(String[] args) throws Exception
+ {
+ System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
+ System.out.println("JCE unlimited strength cryptography: " + ((javax.crypto.Cipher.getMaxAllowedKeyLength("RC5") < 256)?"NOT ":"") + "INSTALLED" );
+ System.out.println("Bouncy Castle JCE Provider: " + ((java.security.Security.getProvider("BC") == null)?"NOT ":"") + "INSTALLED" );
+ System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
+ }
+
+}
+
Property changes on: stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/CryptoCheckMain.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
10 years, 11 months