JBossWS SVN: r17980 - in stack/cxf/trunk/modules/testsuite: shared-tests/src/test/java/org/jboss/test/helper and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-04 12:37:48 -0400 (Fri, 04 Oct 2013)
New Revision: 17980
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/wsf/test/TestServlet.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/helper/TestServlet.java
Log:
[JBWS-3714] Fixing test support classes without using jbossws-common utils to avoid having to add dependency to test deployments
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/wsf/test/TestServlet.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/wsf/test/TestServlet.java 2013-10-04 15:30:44 UTC (rev 17979)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/wsf/test/TestServlet.java 2013-10-04 16:37:48 UTC (rev 17980)
@@ -28,6 +28,9 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
@@ -45,6 +48,19 @@
public class TestServlet extends HttpServlet
{
private static final long serialVersionUID = 1L;
+ private static final Pattern VALID_IPV6_PATTERN;
+ private static final String ipv6Pattern = "^([\\dA-F]{1,4}:|((?=.*(::))(?!.*\\3.+\\3))\\3?)([\\dA-F]{1,4}(\\3|:\\b)|\\2){5}(([\\dA-F]{1,4}(\\3|:\\b|$)|\\2){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?\\b){4})\\z";
+ static
+ {
+ try
+ {
+ VALID_IPV6_PATTERN = Pattern.compile(ipv6Pattern, Pattern.CASE_INSENSITIVE);
+ }
+ catch (PatternSyntaxException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
@@ -58,11 +74,7 @@
try
{
ClientHelper helper = (ClientHelper) Class.forName(helperClassName).newInstance();
- String hostName = System.getProperty("jboss.bind.address", "localhost");
- if (hostName.startsWith(":"))
- {
- hostName = "[" + hostName + "]";
- }
+ String hostName = toIPv6URLFormat(System.getProperty("jboss.bind.address", "localhost"));
helper.setTargetEndpoint("http://" + hostName + ":8080" + path);
List<String> failedTests = new LinkedList<String>();
List<String> errorTests = new LinkedList<String>();
@@ -117,6 +129,22 @@
}
}
+ private String toIPv6URLFormat(final String host)
+ {
+ boolean isIPv6URLFormatted = false;
+ //strip out IPv6 URL formatting if already provided...
+ if (host.startsWith("[") && host.endsWith("]")) {
+ isIPv6URLFormatted = true;
+ }
+ //return IPv6 URL formatted address
+ if (isIPv6URLFormatted) {
+ return host;
+ } else {
+ Matcher m = VALID_IPV6_PATTERN.matcher(host);
+ return m.matches() ? "[" + host + "]" : host;
+ }
+ }
+
private void invokeMethod(Method m, ClientHelper helper, List<String> failedTests, List<String> errorTests) throws ServletException
{
try
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/helper/TestServlet.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/helper/TestServlet.java 2013-10-04 15:30:44 UTC (rev 17979)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/helper/TestServlet.java 2013-10-04 16:37:48 UTC (rev 17980)
@@ -28,6 +28,9 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
@@ -45,6 +48,19 @@
public class TestServlet extends HttpServlet
{
private static final long serialVersionUID = 1L;
+ private static final Pattern VALID_IPV6_PATTERN;
+ private static final String ipv6Pattern = "^([\\dA-F]{1,4}:|((?=.*(::))(?!.*\\3.+\\3))\\3?)([\\dA-F]{1,4}(\\3|:\\b)|\\2){5}(([\\dA-F]{1,4}(\\3|:\\b|$)|\\2){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?\\b){4})\\z";
+ static
+ {
+ try
+ {
+ VALID_IPV6_PATTERN = Pattern.compile(ipv6Pattern, Pattern.CASE_INSENSITIVE);
+ }
+ catch (PatternSyntaxException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
@@ -58,11 +74,7 @@
try
{
ClientHelper helper = (ClientHelper) Class.forName(helperClassName).newInstance();
- String jbossBindAddress = System.getProperty("jboss.bind.address", "localhost");
- if (jbossBindAddress.startsWith(":"))
- {
- jbossBindAddress = "[" + jbossBindAddress + "]";
- }
+ String jbossBindAddress = toIPv6URLFormat(System.getProperty("jboss.bind.address", "localhost"));
helper.setTargetEndpoint("http://" + jbossBindAddress + ":8080" + path);
List<String> failedTests = new LinkedList<String>();
List<String> errorTests = new LinkedList<String>();
@@ -117,6 +129,22 @@
}
}
+ private String toIPv6URLFormat(final String host)
+ {
+ boolean isIPv6URLFormatted = false;
+ //strip out IPv6 URL formatting if already provided...
+ if (host.startsWith("[") && host.endsWith("]")) {
+ isIPv6URLFormatted = true;
+ }
+ //return IPv6 URL formatted address
+ if (isIPv6URLFormatted) {
+ return host;
+ } else {
+ Matcher m = VALID_IPV6_PATTERN.matcher(host);
+ return m.matches() ? "[" + host + "]" : host;
+ }
+ }
+
private void invokeMethod(Method m, ClientHelper helper, List<String> failedTests, List<String> errorTests) throws ServletException
{
try
11 years, 3 months
JBossWS SVN: r17979 - in stack/cxf/trunk/modules/testsuite/cxf-tests: src/test/java/org/jboss/test/ws/jaxws/cxf and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-04 11:30:44 -0400 (Fri, 04 Oct 2013)
New Revision: 17979
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/BusCounter.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientBusStrategyTests.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientServlet.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientServletUsignThreadLocal.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloRequest.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloResponse.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloWSImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloWs.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/Helper.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelperUsignThreadLocal.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/InContainerClientBusStrategyTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/TestClient.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseNewBusStrategyTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseTCCLBusStrategyTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseThreadBusStrategyTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/META-INF/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/META-INF/MANIFEST.MF
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello.wsdl
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema1.xsd
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema2.xsd
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema3.xsd
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema4.xsd
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema5.xsd
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
Log:
[JBWS-3713] Adding comprehensive test case
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-10-04 15:28:34 UTC (rev 17978)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-10-04 15:30:44 UTC (rev 17979)
@@ -455,6 +455,35 @@
<include name="org/jboss/test/ws/jaxws/cxf/jbws3679/*.class"/>
</classes>
</war>
+
+ <!-- jaxws-cxf-jbws3713 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-cxf-jbws3713.war" needxmlfile="false">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/cxf/jbws3713/Hello*.class" />
+ </classes>
+ <zipfileset dir="${tests.output.dir}/test-resources/jaxws/cxf/jbws3713/WEB-INF/wsdl" prefix="WEB-INF/wsdl"/>
+ </war>
+ <war warfile="${tests.output.dir}/test-libs/jaxws-cxf-jbws3713-client.war" needxmlfile="false">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/cxf/jbws3713/BusCounter.class" />
+ <include name="org/jboss/test/ws/jaxws/cxf/jbws3713/ClientServlet*.class" />
+ <include name="org/jboss/test/ws/jaxws/cxf/jbws3713/Hello*.class" />
+ <exclude name="org/jboss/test/ws/jaxws/cxf/jbws3713/HelloWSImpl.class" />
+ <include name="org/jboss/test/ws/jaxws/cxf/jbws3713/Helper*.class" />
+ </classes>
+ <manifest>
+ <attribute name="Dependencies" value="org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl"/> <!-- cxf impl required for ClientProxy -->
+ </manifest>
+ </war>
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-cxf-jbws3713-client.jar" manifest="${tests.output.dir}/test-resources/jaxws/cxf/jbws3713/META-INF/MANIFEST.MF">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/cxf/jbws3713/BusCounter.class" />
+ <include name="org/jboss/test/ws/jaxws/cxf/jbws3713/Hello*.class" />
+ <exclude name="org/jboss/test/ws/jaxws/cxf/jbws3713/HelloWSImpl.class" />
+ <include name="org/jboss/test/ws/jaxws/cxf/jbws3713/Helper*.class" />
+ <include name="org/jboss/test/ws/jaxws/cxf/jbws3713/TestClient.class" />
+ </fileset>
+ </jar>
<!-- jaxws-cxf-logging -->
<jar destfile="${tests.output.dir}/test-libs/jaxws-cxf-logging.jar">
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/BusCounter.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/BusCounter.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/BusCounter.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.cxf.Bus;
+
+public class BusCounter
+{
+ private final Set<String> set = new HashSet<String>();
+
+ public void count(final Bus bus)
+ {
+ synchronized (set)
+ {
+ set.add(bus.getId());
+ }
+ }
+
+ public int getCount() {
+ synchronized (set)
+ {
+ return set.size();
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/BusCounter.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientBusStrategyTests.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientBusStrategyTests.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientBusStrategyTests.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.jboss.wsf.stack.cxf.client.Constants;
+import org.jboss.wsf.stack.cxf.client.ProviderImpl;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+
+public class ClientBusStrategyTests extends JBossWSTest //*Tests does not match the configured surefire filter on test classes' names
+{
+ public final String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-cxf-jbws3713/HelloService";
+ private final String FS = System.getProperty("file.separator"); // '/' on unix, '\' on windows
+
+ /**
+ * Verifies jaxws client bus selection strategy controlled by system properties; in order for checking that,
+ * starting a new process is required, as the system property is read once and cached in JBossWS.
+ *
+ * @param strategy
+ * @param wsdlAddress
+ * @param threadPoolSize
+ * @param invocations
+ * @return
+ * @throws Exception
+ */
+ protected List<Integer> runJBossModulesClient(final String strategy,
+ final String wsdlAddress,
+ final int threadPoolSize,
+ final int invocations) throws Exception {
+ File javaFile = new File (System.getProperty("java.home") + FS + "bin" + FS + "java");
+ String javaCmd = javaFile.exists() ? javaFile.getCanonicalPath() : "java";
+
+ final String jbh = System.getProperty("jboss.home");
+ final String jbm = jbh + FS + "modules";
+ final String jbmjar = jbh + FS + "jboss-modules.jar";
+
+ final File f = new File(JBossWSTestHelper.getTestArchiveDir(), "jaxws-cxf-jbws3713-client.jar");
+
+ //java -jar $JBOSS_HOME/jboss-modules.jar -mp $JBOSS_HOME/modules -jar client.jar
+ String props = " -Djavax.xml.ws.spi.Provider=" + ProviderImpl.class.getName() + " -Dlog4j.output.dir=" + System.getProperty("log4j.output.dir") +
+ " -D" + Constants.JBWS_CXF_JAXWS_CLIENT_BUS_STRATEGY + "=" + strategy + " -jar " + jbmjar + " -mp " + jbm;
+ final String command = javaCmd + props + " -jar " + f.getAbsolutePath() + " " + wsdlAddress + " " + threadPoolSize + " " + invocations;
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ executeCommand(command, bout);
+ String res = null;
+ if (bout.toByteArray() != null) {
+ String output = new String(bout.toByteArray());
+ BufferedReader reader = new BufferedReader(new java.io.StringReader(output));
+ res = reader.readLine();
+ }
+ StringTokenizer st = new StringTokenizer(res, " ");
+ List<Integer> list = new LinkedList<Integer>();
+ while (st.hasMoreTokens()) {
+ list.add(Integer.parseInt(st.nextToken()));
+ }
+ return list;
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientBusStrategyTests.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientServlet.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientServlet.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientServlet.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URL;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(name = "ClientServlet", urlPatterns = "/client/*")
+public class ClientServlet extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+ {
+ String strategy = req.getParameter("strategy");
+ if (strategy == null || strategy.length() == 0)
+ throw new ServletException("strategy not specified!");
+ String host = req.getParameter("host");
+ if (host == null || host.length() == 0)
+ throw new ServletException("host not specified!");
+ String threads = req.getParameter("threads");
+ if (threads == null || threads.length() == 0)
+ throw new ServletException("threads not specified!");
+ String calls = req.getParameter("calls");
+ if (calls == null || calls.length() == 0)
+ throw new ServletException("calls not specified!");
+
+ PrintWriter w = res.getWriter();
+ final URL wsdlURL = new URL("http://" + host + ":8080/jaxws-cxf-jbws3713/HelloService?wsdl");
+ Helper helper = new Helper();
+ w.write(helper.run(wsdlURL, strategy, Integer.parseInt(threads), Integer.parseInt(calls)).toString());
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientServlet.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientServletUsignThreadLocal.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientServletUsignThreadLocal.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientServletUsignThreadLocal.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URL;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet(name = "ClientServletUsingThreadLocal", urlPatterns = "/client-using-threadlocal/*")
+public class ClientServletUsignThreadLocal extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+ {
+ String strategy = req.getParameter("strategy");
+ if (strategy == null || strategy.length() == 0)
+ throw new ServletException("strategy not specified!");
+ String host = req.getParameter("host");
+ if (host == null || host.length() == 0)
+ throw new ServletException("host not specified!");
+ String threads = req.getParameter("threads");
+ if (threads == null || threads.length() == 0)
+ throw new ServletException("threads not specified!");
+ String calls = req.getParameter("calls");
+ if (calls == null || calls.length() == 0)
+ throw new ServletException("calls not specified!");
+
+ PrintWriter w = res.getWriter();
+ final URL wsdlURL = new URL("http://" + host + ":8080/jaxws-cxf-jbws3713/HelloService?wsdl");
+ HelperUsignThreadLocal helper = new HelperUsignThreadLocal();
+ w.write(helper.run(wsdlURL, strategy, Integer.parseInt(threads), Integer.parseInt(calls)).toString());
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientServletUsignThreadLocal.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloRequest.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloRequest.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloRequest.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+public class HelloRequest
+{
+ private String input;
+
+ public String getInput()
+ {
+ return input;
+ }
+
+ public void setInput(String input)
+ {
+ this.input = input;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloRequest.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloResponse.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloResponse.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloResponse.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class HelloResponse
+{
+ private List<String> multiHello = new ArrayList<String>();
+
+ public List<String> getMultiHello()
+ {
+ return multiHello;
+ }
+
+ public void setMultiHello(List<String> multiHello)
+ {
+ this.multiHello = multiHello;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloResponse.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloWSImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloWSImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloWSImpl.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+import javax.jws.WebService;
+
+@WebService(wsdlLocation = "WEB-INF/wsdl/Hello.wsdl",
+ name = HelloWs.NAME,
+ serviceName = HelloWs.NAME,
+ targetNamespace = HelloWs.TARGET_NAMESPACE,
+ endpointInterface = "org.jboss.test.ws.jaxws.cxf.jbws3713.HelloWs")
+public class HelloWSImpl implements HelloWs
+{
+
+ public HelloResponse doHello(HelloRequest request)
+ {
+ HelloResponse response = new HelloResponse();
+ response.getMultiHello().add(request.getInput());
+ response.getMultiHello().add("world");
+ return response;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloWSImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloWs.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloWs.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloWs.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+import javax.jws.WebService;
+
+@WebService(name = HelloWs.NAME, targetNamespace = HelloWs.TARGET_NAMESPACE)
+public interface HelloWs
+{
+ public final static String NAME = "HelloService";
+
+ public final static String TARGET_NAMESPACE = "http://hello/test";
+
+ public HelloResponse doHello(HelloRequest request);
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelloWs.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/Helper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/Helper.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/Helper.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.ThreadFactory;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceFeature;
+
+import org.apache.cxf.frontend.ClientProxy;
+import org.jboss.wsf.stack.cxf.client.Constants;
+import org.jboss.wsf.stack.cxf.client.UseNewBusFeature;
+import org.jboss.wsf.stack.cxf.client.UseTCCLBusFeature;
+import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
+
+/**
+ * A helper class creating a pool of JAXWS clients that invoke the test endpoint.
+ * Here each client execution create a new JAXWS services.
+ * Returns the number of Bus instances created to run the clients.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 04-Oct-2013
+ *
+ */
+public class Helper
+{
+ public Integer run(final URL wsdlURL, final int size, final int calls) {
+ return run(wsdlURL, null, size, calls);
+ }
+
+ public Integer run(final URL wsdlURL, final String strategyName, final int size, final int calls) {
+ final WebServiceFeature feature;
+ final String strategy;
+ if (strategyName != null) {
+ feature = convertToFeature(strategyName);
+ strategy = strategyName;
+ } else {
+ feature = null;
+ strategy = System.getProperty(Constants.JBWS_CXF_JAXWS_CLIENT_BUS_STRATEGY, null);
+ }
+ final BusCounter busCounter = new BusCounter();
+ final ThreadFactory threadFactory = new ThreadFactory()
+ {
+ private volatile int i = 0;
+
+ @Override
+ public Thread newThread(Runnable r)
+ {
+ return new Thread(r, "JBWS3373-thread-" + i++ + "-" + strategy);
+ }
+ };
+ ExecutorService es = Executors.newFixedThreadPool(size, threadFactory);
+ List<Client> clients = new ArrayList<Helper.Client>();
+ for (int i = 0; i < calls; i++) {
+ clients.add(new Client(wsdlURL, feature, busCounter));
+ }
+ int count = 0;
+ try
+ {
+ List<Future<Boolean>> futures = es.invokeAll(clients);
+ for (Future<Boolean> f : futures)
+ {
+ if (f.get()) {
+ count++;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ es.shutdown();
+ }
+ if (count != calls) {
+ throw new RuntimeException((calls - count) + " client invocation(s) failed!");
+ }
+ return busCounter.getCount();
+ }
+
+ private static WebServiceFeature convertToFeature(final String strategy) {
+ if (strategy.equals(Constants.NEW_BUS_STRATEGY)) {
+ return new UseNewBusFeature();
+ } else if (strategy.equals(Constants.THREAD_BUS_STRATEGY)) {
+ return new UseThreadBusFeature();
+ } else if (strategy.equals(Constants.TCCL_BUS_STRATEGY)) {
+ return new UseTCCLBusFeature();
+ } else {
+ throw new RuntimeException("Unexpected strategy: " + strategy);
+ }
+ }
+
+ private static class Client implements Callable<Boolean>
+ {
+ private final URL wsdlURL;
+ private final WebServiceFeature feature;
+ private final BusCounter busCounter;
+
+ public Client(final URL wsdlURL, final WebServiceFeature feature, final BusCounter busCounter)
+ {
+ this.wsdlURL = wsdlURL;
+ this.feature = feature;
+ this.busCounter = busCounter;
+ }
+
+ @Override
+ public Boolean call() throws Exception
+ {
+ QName qname = new QName("http://hello/test", "HelloService");
+ Service service = feature != null ? Service.create(wsdlURL, qname, feature) : Service.create(wsdlURL, qname);
+ HelloWs helloPort = service.getPort(HelloWs.class);
+ org.apache.cxf.endpoint.Client cxfClient = ClientProxy.getClient(helloPort);
+ busCounter.count(cxfClient.getBus());
+
+ HelloRequest request = new HelloRequest();
+ request.setInput("hi");
+ HelloResponse response = helloPort.doHello(request);
+ return response.getMultiHello().contains("hi");
+ }
+
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/Helper.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelperUsignThreadLocal.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelperUsignThreadLocal.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelperUsignThreadLocal.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.ThreadFactory;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceFeature;
+
+import org.apache.cxf.frontend.ClientProxy;
+import org.jboss.wsf.stack.cxf.client.Constants;
+import org.jboss.wsf.stack.cxf.client.UseNewBusFeature;
+import org.jboss.wsf.stack.cxf.client.UseTCCLBusFeature;
+import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
+
+/**
+ * A helper class creating a pool of JAXWS clients that invoke the test endpoint.
+ * Here the JAXWS services for the clients are created in a ThreadLocal.
+ * Returns the number of Bus instances created to run the clients.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 04-Oct-2013
+ *
+ */
+public class HelperUsignThreadLocal
+{
+ public Integer run(final URL wsdlURL, final int size, final int calls) {
+ return run(wsdlURL, null, size, calls);
+ }
+
+ public Integer run(final URL wsdlURL, final String strategyName, final int size, final int calls) {
+ final WebServiceFeature feature;
+ final String strategy;
+ if (strategyName != null) {
+ feature = convertToFeature(strategyName);
+ strategy = strategyName;
+ } else {
+ feature = null;
+ strategy = System.getProperty(Constants.JBWS_CXF_JAXWS_CLIENT_BUS_STRATEGY, null);
+ }
+ final BusCounter busCounter = new BusCounter();
+ final ThreadLocal<HelloWs> port = createPortThreadLocal(wsdlURL, feature, busCounter);
+ final ThreadFactory threadFactory = new ThreadFactory()
+ {
+ private volatile int i = 0;
+
+ @Override
+ public Thread newThread(Runnable r)
+ {
+ return new Thread(r, "JBWS3373-TL-thread-" + i++ + "-" + strategy);
+ }
+ };
+ ExecutorService es = Executors.newFixedThreadPool(size, threadFactory);
+ List<Client> clients = new ArrayList<HelperUsignThreadLocal.Client>();
+ for (int i = 0; i < calls; i++) {
+ clients.add(new Client(port));
+ }
+ int count = 0;
+ try
+ {
+ List<Future<Boolean>> futures = es.invokeAll(clients);
+ for (Future<Boolean> f : futures)
+ {
+ if (f.get()) {
+ count++;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ es.shutdown();
+ }
+ if (count != calls) {
+ throw new RuntimeException((calls - count) + " client invocation(s) failed!");
+ }
+ return busCounter.getCount();
+ }
+
+ private static WebServiceFeature convertToFeature(final String strategy) {
+ if (strategy.equals(Constants.NEW_BUS_STRATEGY)) {
+ return new UseNewBusFeature();
+ } else if (strategy.equals(Constants.THREAD_BUS_STRATEGY)) {
+ return new UseThreadBusFeature();
+ } else if (strategy.equals(Constants.TCCL_BUS_STRATEGY)) {
+ return new UseTCCLBusFeature();
+ } else {
+ throw new RuntimeException("Unexpected strategy: " + strategy);
+ }
+ }
+
+ private static ThreadLocal<HelloWs> createPortThreadLocal(final URL wsdlURL, final WebServiceFeature feature, final BusCounter busCounter)
+ {
+ return new ThreadLocal<HelloWs>()
+ {
+ @Override
+ protected HelloWs initialValue()
+ {
+ QName qname = new QName("http://hello/test", "HelloService");
+ Service service = feature != null ? Service.create(wsdlURL, qname, feature) : Service.create(wsdlURL, qname);
+ HelloWs helloPort = service.getPort(HelloWs.class);
+ org.apache.cxf.endpoint.Client cxfClient = ClientProxy.getClient(helloPort);
+ busCounter.count(cxfClient.getBus());
+ return helloPort;
+ }
+ };
+ }
+
+ private static class Client implements Callable<Boolean>
+ {
+ private final ThreadLocal<HelloWs> port;
+
+ public Client(final ThreadLocal<HelloWs> port)
+ {
+ this.port = port;
+ }
+
+ @Override
+ public Boolean call() throws Exception
+ {
+ HelloRequest request = new HelloRequest();
+ request.setInput("hi");
+ HelloResponse response = port.get().doHello(request);
+ return response.getMultiHello().contains("hi");
+ }
+
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelperUsignThreadLocal.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/InContainerClientBusStrategyTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/InContainerClientBusStrategyTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/InContainerClientBusStrategyTestCase.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.stack.cxf.client.Constants;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+public class InContainerClientBusStrategyTestCase extends JBossWSTest
+{
+ public final String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-cxf-jbws3713/HelloService";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(InContainerClientBusStrategyTestCase.class, "jaxws-cxf-jbws3713.war,jaxws-cxf-jbws3713-client.war");
+ }
+
+ public void testEndpoint() throws Exception
+ {
+ HelloWs port = getPort(endpointAddress);
+ HelloRequest request = new HelloRequest();
+ request.setInput("hello");
+ HelloResponse response = port.doHello(request);
+ assertEquals(2, response.getMultiHello().size());
+ assertTrue(response.getMultiHello().contains("hello"));
+ assertTrue(response.getMultiHello().contains("world"));
+ }
+
+ public void testClientWithNewBusStrategy() throws Exception
+ {
+ final int threadPoolSize = 10;
+ final int invocations = 50;
+ int busCount = callServlet("client-using-threadlocal", Constants.NEW_BUS_STRATEGY, threadPoolSize, invocations);
+ assertEquals(threadPoolSize, busCount);
+
+ busCount = callServlet("client", Constants.NEW_BUS_STRATEGY, threadPoolSize, invocations);
+ assertEquals(invocations, busCount);
+ }
+
+ public void testClientWithThreadBusStrategy() throws Exception
+ {
+ final int threadPoolSize = 10;
+ final int invocations = 50;
+ int busCount = callServlet("client-using-threadlocal", Constants.THREAD_BUS_STRATEGY, threadPoolSize, invocations);
+ assertEquals(threadPoolSize, busCount);
+
+ busCount = callServlet("client", Constants.THREAD_BUS_STRATEGY, threadPoolSize, invocations);
+ assertEquals(threadPoolSize, busCount);
+ }
+
+ public void testClientWithTCCLBusStrategy() throws Exception
+ {
+ final int threadPoolSize = 10;
+ final int invocations = 50;
+ int busCount = callServlet("client-using-threadlocal", Constants.TCCL_BUS_STRATEGY, threadPoolSize, invocations);
+ assertEquals(1, busCount);
+
+ busCount = callServlet("client", Constants.TCCL_BUS_STRATEGY, threadPoolSize, invocations);
+ assertEquals(1, busCount);
+ }
+
+ private static int callServlet(String pattern, String strategy, int threads, int calls) throws Exception {
+ URL url = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jbws3713-client/" + pattern + "?strategy="
+ + strategy + "&host=" + getServerHost() + "&threads=" + threads + "&calls=" + calls);
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ String retStr = br.readLine();
+ return Integer.parseInt(retStr);
+ }
+
+ private HelloWs getPort(String publishURL) throws Exception
+ {
+ URL wsdlURL = new URL(publishURL + "?wsdl");
+ QName qname = new QName("http://hello/test", "HelloService");
+ Service service = Service.create(wsdlURL, qname);
+ return service.getPort(HelloWs.class);
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/InContainerClientBusStrategyTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/TestClient.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/TestClient.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/TestClient.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+import java.net.URL;
+
+public class TestClient
+{
+ public static void main(String[] args) throws Exception
+ {
+ final String wsdlAddress = args[0];
+ final String threadPoolSize = args[1];
+ final String invocations = args[2];
+ int ret1 = new HelperUsignThreadLocal().run(new URL(wsdlAddress), Integer.parseInt(threadPoolSize), Integer.parseInt(invocations));
+ int ret2 = new Helper().run(new URL(wsdlAddress), Integer.parseInt(threadPoolSize), Integer.parseInt(invocations));
+ System.out.println(String.valueOf(ret1) + " " + String.valueOf(ret2));
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/TestClient.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseNewBusStrategyTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseNewBusStrategyTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseNewBusStrategyTestCase.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+import java.util.List;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.stack.cxf.client.Constants;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+public class UseNewBusStrategyTestCase extends ClientBusStrategyTests
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(UseNewBusStrategyTestCase.class, "jaxws-cxf-jbws3713.war");
+ }
+
+ public void testClientWithNewBusStrategy() throws Exception
+ {
+ final int threadPoolSize = 4;
+ final int invocations = 5;
+ List<Integer> list = runJBossModulesClient(Constants.NEW_BUS_STRATEGY, endpointAddress + "?wsdl", threadPoolSize, invocations);
+ assertEquals(threadPoolSize, list.get(0).intValue());
+ assertEquals(invocations, list.get(1).intValue());
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseNewBusStrategyTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseTCCLBusStrategyTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseTCCLBusStrategyTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseTCCLBusStrategyTestCase.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+import java.util.List;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.stack.cxf.client.Constants;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+public class UseTCCLBusStrategyTestCase extends ClientBusStrategyTests
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(UseTCCLBusStrategyTestCase.class, "jaxws-cxf-jbws3713.war");
+ }
+
+ public void testClientWithTCCLBusStrategy() throws Exception
+ {
+ final int threadPoolSize = 4;
+ final int invocations = 5;
+ List<Integer> list = runJBossModulesClient(Constants.TCCL_BUS_STRATEGY, endpointAddress + "?wsdl", threadPoolSize, invocations);
+ assertEquals(1, list.get(0).intValue());
+ assertEquals(1, list.get(1).intValue());
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseTCCLBusStrategyTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseThreadBusStrategyTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseThreadBusStrategyTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseThreadBusStrategyTestCase.java 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.jbws3713;
+
+import java.util.List;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.stack.cxf.client.Constants;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+public class UseThreadBusStrategyTestCase extends ClientBusStrategyTests
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(UseThreadBusStrategyTestCase.class, "jaxws-cxf-jbws3713.war");
+ }
+
+ public void testClientWithThreadBusStrategy() throws Exception
+ {
+ final int threadPoolSize = 4;
+ final int invocations = 5;
+ List<Integer> list = runJBossModulesClient(Constants.THREAD_BUS_STRATEGY, endpointAddress + "?wsdl", threadPoolSize, invocations);
+ assertEquals(threadPoolSize, list.get(0).intValue());
+ assertEquals(threadPoolSize, list.get(1).intValue());
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/UseThreadBusStrategyTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/META-INF/MANIFEST.MF
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/META-INF/MANIFEST.MF (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/META-INF/MANIFEST.MF 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: org.jboss.test.ws.jaxws.cxf.jbws3713.TestClient
+Dependencies: org.jboss.ws.cxf.jbossws-cxf-client,org.apache.cxf.impl,org.jboss.ws.jaxws-client
\ No newline at end of file
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello.wsdl (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello.wsdl 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="HelloService" targetNamespace="http://hello/test" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://hello/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ <wsdl:types>
+<schema xmlns="http://www.w3.org/2001/XMLSchema">
+ <import namespace="http://hello/test" schemaLocation="Hello_schema1.xsd"/>
+ <import namespace="http://hello/test2" schemaLocation="Hello_schema2.xsd"/>
+ <import namespace="http://hello/test3" schemaLocation="Hello_schema3.xsd"/>
+ <import namespace="http://hello/test4" schemaLocation="Hello_schema4.xsd"/>
+ <import namespace="http://hello/test5" schemaLocation="Hello_schema5.xsd"/>
+</schema>
+ </wsdl:types>
+ <wsdl:message name="doHello">
+ <wsdl:part name="parameters" element="tns:doHello">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="doHelloResponse">
+ <wsdl:part name="parameters" element="tns:doHelloResponse">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="HelloService">
+ <wsdl:operation name="doHello">
+ <wsdl:input name="doHello" message="tns:doHello">
+ </wsdl:input>
+ <wsdl:output name="doHelloResponse" message="tns:doHelloResponse">
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="HelloServiceSoapBinding" type="tns:HelloService">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="doHello">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="doHello">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="doHelloResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="HelloService">
+ <wsdl:port name="HelloServicePort" binding="tns:HelloServiceSoapBinding">
+ <soap:address location="http://localhost:9090/HelloServicePort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello.wsdl
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema1.xsd
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema1.xsd (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema1.xsd 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?><xs:schema xmlns:tns="http://hello/test" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" targetNamespace="http://hello/test" version="1.0">
+<xs:element name="doHello" type="tns:doHello"/>
+<xs:element name="doHelloResponse" type="tns:doHelloResponse"/>
+<xs:complexType name="doHello">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0" type="tns:helloRequest"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="helloRequest">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="hello" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="doHelloResponse">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="tns:helloResponse"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="helloResponse">
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="multiHello" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema1.xsd
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema2.xsd
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema2.xsd (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema2.xsd 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?><xs:schema xmlns:tns="http://hello/test2" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" targetNamespace="http://hello/test2" version="1.0">
+<xs:element name="doHello" type="tns:doHello"/>
+<xs:element name="doHelloResponse" type="tns:doHelloResponse"/>
+<xs:complexType name="doHello">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0" type="tns:helloRequest"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="helloRequest">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="hello" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="doHelloResponse">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="tns:helloResponse"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="helloResponse">
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="multiHello" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema2.xsd
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema3.xsd
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema3.xsd (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema3.xsd 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?><xs:schema xmlns:tns="http://hello/test3" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" targetNamespace="http://hello/test3" version="1.0">
+<xs:element name="doHello" type="tns:doHello"/>
+<xs:element name="doHelloResponse" type="tns:doHelloResponse"/>
+<xs:complexType name="doHello">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0" type="tns:helloRequest"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="helloRequest">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="hello" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="doHelloResponse">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="tns:helloResponse"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="helloResponse">
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="multiHello" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema3.xsd
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema4.xsd
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema4.xsd (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema4.xsd 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?><xs:schema xmlns:tns="http://hello/test4" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" targetNamespace="http://hello/test4" version="1.0">
+<xs:element name="doHello" type="tns:doHello"/>
+<xs:element name="doHelloResponse" type="tns:doHelloResponse"/>
+<xs:complexType name="doHello">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0" type="tns:helloRequest"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="helloRequest">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="hello" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="doHelloResponse">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="tns:helloResponse"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="helloResponse">
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="multiHello" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema4.xsd
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema5.xsd
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema5.xsd (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema5.xsd 2013-10-04 15:30:44 UTC (rev 17979)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?><xs:schema xmlns:tns="http://hello/test5" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" targetNamespace="http://hello/test5" version="1.0">
+<xs:element name="doHello" type="tns:doHello"/>
+<xs:element name="doHelloResponse" type="tns:doHelloResponse"/>
+<xs:complexType name="doHello">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0" type="tns:helloRequest"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="helloRequest">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="hello" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="doHelloResponse">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="tns:helloResponse"/>
+ </xs:sequence>
+ </xs:complexType>
+<xs:complexType name="helloResponse">
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="multiHello" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3713/WEB-INF/wsdl/Hello_schema5.xsd
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
11 years, 3 months
JBossWS SVN: r17978 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-04 11:28:34 -0400 (Fri, 04 Oct 2013)
New Revision: 17978
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusReuseTestCase.java
Log:
[JBWS-3713] Using new feature in BusReuseTestCase to avoid the test being dependent on the currently set system property
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusReuseTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusReuseTestCase.java 2013-10-03 17:24:54 UTC (rev 17977)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusReuseTestCase.java 2013-10-04 15:28:34 UTC (rev 17978)
@@ -36,6 +36,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.jboss.wsf.stack.cxf.client.UseNewBusFeature;
+import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -71,7 +72,7 @@
Bus bus = BusFactory.newInstance().createBus();
try {
BusFactory.setThreadDefaultBus(bus);
- Endpoint port = getPort(WSDL_ADDRESS, bus); //invalid
+ Endpoint port = getPort(WSDL_ADDRESS, bus, new UseThreadBusFeature()); //invalid
try {
performInvocation(port);
fail("Failure expected, as the wsdl soap:address is not valid!");
@@ -79,7 +80,7 @@
assertTrue(wse.getCause().getMessage().contains("InvalidEndpoint"));
}
- port = getPort(WSDL_ADDRESS, bus); //valid
+ port = getPort(WSDL_ADDRESS, bus, new UseThreadBusFeature()); //valid
try {
performInvocation(port);
fail("Failure expected, as the WSDLManager for the bus will return the invalid wsdl");
@@ -87,7 +88,7 @@
assertTrue(wse.getCause().getMessage().contains("InvalidEndpoint"));
}
- port = getPort(WSDL_ADDRESS, bus); //invalid
+ port = getPort(WSDL_ADDRESS, bus, new UseThreadBusFeature()); //invalid
port = getPort(WSDL_ADDRESS, bus, new UseNewBusFeature()); //valid
//the port should now actually be built against the valid wsdl
@@ -95,7 +96,7 @@
//so the invocation is expected to succeed
performInvocation(port);
- port = getPort(WSDL_ADDRESS, bus); //invalid
+ port = getPort(WSDL_ADDRESS, bus, new UseThreadBusFeature()); //invalid
port = getPort(WSDL_ADDRESS, bus, new UseNewBusFeature(false)); //valid
try {
11 years, 3 months
JBossWS SVN: r17977 - in stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf: gzip and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-03 13:24:54 -0400 (Thu, 03 Oct 2013)
New Revision: 17977
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/Helper.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/Helper.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/ClientServerLifeCycleTestCase.java
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/logging/MessageLoggingTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/policy/PolicyInterceptorProviderTestCase.java
Log:
[JBWS-3713] Using new feature in a bunch of tests to force THREAD_BUS strategy
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java 2013-10-03 17:23:35 UTC (rev 17976)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java 2013-10-03 17:24:54 UTC (rev 17977)
@@ -34,6 +34,7 @@
import org.apache.cxf.BusFactory;
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -62,7 +63,7 @@
URL wsdlURL = new URL(endpointURl + "?wsdl");
QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/fastinfoset", "HelloWorldService");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = Service.create(wsdlURL, serviceName, new UseThreadBusFeature());
QName portQName = new QName("http://org.jboss.ws/jaxws/cxf/fastinfoset", "HelloWorldImplPort");
HelloWorld port = (HelloWorld) service.getPort(portQName, HelloWorld.class);
assertEquals("helloworld", port.echo("helloworld"));
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/Helper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/Helper.java 2013-10-03 17:23:35 UTC (rev 17976)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/gzip/Helper.java 2013-10-03 17:24:54 UTC (rev 17977)
@@ -35,6 +35,7 @@
import org.apache.cxf.transport.common.gzip.GZIPOutInterceptor;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
+import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
import org.jboss.wsf.test.ClientHelper;
public class Helper implements ClientHelper
@@ -167,7 +168,7 @@
{
URL wsdlURL = new URL(gzipFeatureEndpointURL + "?wsdl");
QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/gzip", "HelloWorldService");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = Service.create(wsdlURL, serviceName, new UseThreadBusFeature());
QName portQName = new QName("http://org.jboss.ws/jaxws/cxf/gzip", "HelloWorldImplPort");
return (HelloWorld) service.getPort(portQName, HelloWorld.class);
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/Helper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/Helper.java 2013-10-03 17:23:35 UTC (rev 17976)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jaxbintros/Helper.java 2013-10-03 17:24:54 UTC (rev 17977)
@@ -32,6 +32,7 @@
import org.jboss.jaxb.intros.BindingCustomizationFactory;
import org.jboss.ws.api.binding.BindingCustomization;
import org.jboss.ws.api.binding.JAXBBindingCustomization;
+import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSConfigurer;
import org.jboss.wsf.test.ClientHelper;
@@ -66,7 +67,7 @@
URL wsdlURL = new URL(endpointAddress + "?wsdl");
QName serviceName = new QName("http://org.jboss.ws/cxf/jaxbintros", "EndpointBeanService");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = Service.create(wsdlURL, serviceName, new UseThreadBusFeature());
Endpoint port = service.getPort(Endpoint.class);
UserType user = new UserType();
QName qname = new QName("ns", "local", "prefix");
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/ClientServerLifeCycleTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/ClientServerLifeCycleTestCase.java 2013-10-03 17:23:35 UTC (rev 17976)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/ClientServerLifeCycleTestCase.java 2013-10-03 17:24:54 UTC (rev 17977)
@@ -34,6 +34,7 @@
import org.apache.cxf.endpoint.ClientLifeCycleListener;
import org.apache.cxf.endpoint.ClientLifeCycleManager;
import org.apache.cxf.endpoint.ServerLifeCycleManager;
+import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -80,7 +81,7 @@
try {
URL wsdlOneURL = new URL(endpointOneURL + "?wsdl");
QName serviceOneName = new QName(targetNS, "ServiceOne");
- Service serviceOne = Service.create(wsdlOneURL, serviceOneName);
+ Service serviceOne = Service.create(wsdlOneURL, serviceOneName, new UseThreadBusFeature());
CustomClientLifeCycleListener listener = new CustomClientLifeCycleListener();
ClientLifeCycleManager mgr = bus.getExtension(ClientLifeCycleManager.class);
try {
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 2013-10-03 17:23:35 UTC (rev 17976)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentTestCase.java 2013-10-03 17:24:54 UTC (rev 17977)
@@ -35,6 +35,7 @@
import org.apache.cxf.BusFactory;
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.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -61,7 +62,7 @@
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jbws3648-b/ServiceThree" + "?wsdl");
QName serviceName = new QName("http://org.jboss.ws.jaxws.cxf/jbws3648", "ServiceThree");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = Service.create(wsdlURL, serviceName, new UseThreadBusFeature());
EndpointThree proxy = (EndpointThree)service.getPort(EndpointThree.class);
setupWsse((BindingProvider)proxy);
@@ -86,7 +87,7 @@
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jbws3648-b/ServiceFour" + "?wsdl");
QName serviceName = new QName("http://org.jboss.ws.jaxws.cxf/jbws3648", "ServiceFour");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = Service.create(wsdlURL, serviceName, new UseThreadBusFeature());
EndpointFour proxy = (EndpointFour)service.getPort(EndpointFour.class);
setupWsse((BindingProvider)proxy);
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/logging/MessageLoggingTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/logging/MessageLoggingTestCase.java 2013-10-03 17:23:35 UTC (rev 17976)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/logging/MessageLoggingTestCase.java 2013-10-03 17:24:54 UTC (rev 17977)
@@ -34,6 +34,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -93,7 +94,7 @@
bus.getInInterceptors().add(myLoggingInterceptor);
BusFactory.setThreadDefaultBus(bus);
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = Service.create(wsdlURL, serviceName, new UseThreadBusFeature());
QName portQName = new QName("http://logging.cxf.jaxws.ws.test.jboss.org/", "LoggingFeatureEndpointPort");
port = (LoggingEndpoint)service.getPort(portQName, LoggingEndpoint.class);
String content = "foo";
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/policy/PolicyInterceptorProviderTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/policy/PolicyInterceptorProviderTestCase.java 2013-10-03 17:23:35 UTC (rev 17976)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/policy/PolicyInterceptorProviderTestCase.java 2013-10-03 17:24:54 UTC (rev 17977)
@@ -32,6 +32,7 @@
import org.apache.cxf.BusFactory;
import org.apache.cxf.ws.policy.IgnorablePolicyInterceptorProvider;
import org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry;
+import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -65,7 +66,7 @@
URL wsdlURL = new URL(endpointAddress + "?wsdl");
QName serviceName = new QName("http://policy.cxf.jaxws.ws.test.jboss.org/", "PIPService");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = Service.create(wsdlURL, serviceName, new UseThreadBusFeature());
QName portQName = new QName("http://policy.cxf.jaxws.ws.test.jboss.org/", "PIPEndpointPort");
PIPEndpoint port = (PIPEndpoint)service.getPort(portQName, PIPEndpoint.class);
@@ -86,7 +87,7 @@
URL wsdlURL = new URL(endpointAddress + "?wsdl");
QName serviceName = new QName("http://policy.cxf.jaxws.ws.test.jboss.org/", "PIPService");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = Service.create(wsdlURL, serviceName, new UseThreadBusFeature());
QName portQName = new QName("http://policy.cxf.jaxws.ws.test.jboss.org/", "PIPEndpointPort");
PIPEndpoint port = (PIPEndpoint)service.getPort(portQName, PIPEndpoint.class);
11 years, 3 months
JBossWS SVN: r17976 - in stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf: client and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-03 13:23:35 -0400 (Thu, 03 Oct 2013)
New Revision: 17976
Added:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ClientBusSelector.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/SecurityActions.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/UseTCCLBusFeature.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/UseThreadBusFeature.java
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java
Log:
[JBWS-3713] Adding client bus selector and jaxws features for controlling bus creation
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2013-10-03 09:00:55 UTC (rev 17975)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2013-10-03 17:23:35 UTC (rev 17976)
@@ -204,4 +204,8 @@
@LogMessage(level = INFO)
@Message(id = 24092, value = "Adding %s policy attachment with id='%s' to honor requirement from %s.")
void addingPolicyAttachment(Object placement, String refId, Class<?> cls);
+
+ @LogMessage(level = WARN)
+ @Message(id = 24095, value = "Unknown strategy '%s' requested for selecting the Apache CXF Bus to be used for building JAXWS clients; default strategy will be used.")
+ void unknownJAXWSClientBusStrategy(String strategy);
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java 2013-10-03 09:00:55 UTC (rev 17975)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java 2013-10-03 17:23:35 UTC (rev 17976)
@@ -217,4 +217,7 @@
@Message(id = 24094, value = "Authorization failed, principal=%s")
SecurityException authorizationFailed(String principal);
+ @Message(id = 24096, value = "Multiple incompatible JAXWS client Bus features provided")
+ IllegalArgumentException incompatibleJAXWSClientBusFeatureProvided();
+
}
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ClientBusSelector.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ClientBusSelector.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ClientBusSelector.java 2013-10-03 17:23:35 UTC (rev 17976)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.stack.cxf.client;
+
+import static org.jboss.wsf.stack.cxf.client.Constants.JBWS_CXF_JAXWS_CLIENT_BUS_STRATEGY;
+import static org.jboss.wsf.stack.cxf.client.Constants.NEW_BUS_STRATEGY;
+import static org.jboss.wsf.stack.cxf.client.Constants.TCCL_BUS_STRATEGY;
+import static org.jboss.wsf.stack.cxf.client.Constants.THREAD_BUS_STRATEGY;
+
+import javax.xml.ws.WebServiceFeature;
+
+import org.jboss.wsf.stack.cxf.Loggers;
+import org.jboss.wsf.stack.cxf.Messages;
+
+/**
+ * A class selecting the proper bus to be used for creating a
+ * JAXWS client.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 03-Oct-2013
+ *
+ */
+public abstract class ClientBusSelector
+{
+ private static final String sysPropStrategy;
+ static {
+ final String propValue = SecurityActions.getSystemProperty(JBWS_CXF_JAXWS_CLIENT_BUS_STRATEGY, THREAD_BUS_STRATEGY);
+ if (THREAD_BUS_STRATEGY.equals(propValue) || NEW_BUS_STRATEGY.equals(propValue) || TCCL_BUS_STRATEGY.equals(propValue))
+ {
+ sysPropStrategy = propValue;
+ }
+ else
+ {
+ Loggers.ROOT_LOGGER.unknownJAXWSClientBusStrategy(propValue);
+ sysPropStrategy = THREAD_BUS_STRATEGY;
+ }
+ }
+
+ public static String selectStrategy(WebServiceFeature... features) {
+ boolean createNewBus = false;
+ boolean tcclBoundBus = false;
+ boolean threadBus = false;
+ int count = 0;
+ if (features != null)
+ {
+ for (WebServiceFeature f : features)
+ {
+ final String className = f.getClass().getName();
+ if (UseNewBusFeature.class.getName().equals(className))
+ {
+ createNewBus = f.isEnabled();
+ count++;
+ }
+ else if (UseTCCLBusFeature.class.getName().equals(className))
+ {
+ tcclBoundBus = f.isEnabled();
+ count++;
+ }
+ else if (UseThreadBusFeature.class.getName().equals(className))
+ {
+ threadBus = f.isEnabled();
+ count++;
+ }
+ }
+ }
+ if (count > 1)
+ {
+ throw Messages.MESSAGES.incompatibleJAXWSClientBusFeatureProvided();
+ }
+
+ String featureStrategy = null;
+ if (createNewBus)
+ {
+ featureStrategy = NEW_BUS_STRATEGY;
+ }
+ else if (tcclBoundBus)
+ {
+ featureStrategy = TCCL_BUS_STRATEGY;
+ }
+ else if (threadBus)
+ {
+ featureStrategy = THREAD_BUS_STRATEGY;
+ }
+ return featureStrategy != null ? featureStrategy : sysPropStrategy;
+ }
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ClientBusSelector.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java 2013-10-03 09:00:55 UTC (rev 17975)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java 2013-10-03 17:23:35 UTC (rev 17976)
@@ -43,4 +43,9 @@
public static final String CXF_MANAGEMENT_ENABLED = "cxf.management.enabled";
public static final String CXF_MANAGEMENT_INSTALL_RESPONSE_TIME_INTERCEPTORS = "cxf.management.installResponseTimeInterceptors";
public static final String CXF_WS_DISCOVERY_ENABLED = "cxf.ws-discovery.enabled";
+
+ public static final String JBWS_CXF_JAXWS_CLIENT_BUS_STRATEGY = "org.jboss.ws.cxf.jaxws-client.bus.strategy";
+ public static final String THREAD_BUS_STRATEGY = "THREAD_BUS";
+ public static final String NEW_BUS_STRATEGY = "NEW_BUS";
+ public static final String TCCL_BUS_STRATEGY = "TCCL_BUS";
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-10-03 09:00:55 UTC (rev 17975)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-10-03 17:23:35 UTC (rev 17976)
@@ -21,6 +21,12 @@
*/
package org.jboss.wsf.stack.cxf.client;
+import static org.jboss.wsf.stack.cxf.client.Constants.NEW_BUS_STRATEGY;
+import static org.jboss.wsf.stack.cxf.client.Constants.TCCL_BUS_STRATEGY;
+import static org.jboss.wsf.stack.cxf.client.Constants.THREAD_BUS_STRATEGY;
+import static org.jboss.wsf.stack.cxf.client.SecurityActions.getContextClassLoader;
+import static org.jboss.wsf.stack.cxf.client.SecurityActions.setContextClassLoader;
+
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -37,8 +43,8 @@
import javax.xml.ws.Endpoint;
import javax.xml.ws.EndpointContext;
import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.Service.Mode;
+import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.spi.Invoker;
import javax.xml.ws.spi.ServiceDelegate;
@@ -158,16 +164,19 @@
@Override
public ServiceDelegate createServiceDelegate(URL url, QName qname, Class cls)
{
+ final String busStrategy = ClientBusSelector.selectStrategy();
ClassLoader origClassLoader = getContextClassLoader();
boolean restoreTCCL = false;
+ Bus orig = null;
try
{
restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
- Bus bus = setValidThreadDefaultBus();
- return new JBossWSServiceImpl(bus, url, qname, cls);
+ orig = BusFactory.getThreadDefaultBus(false);
+ return new JBossWSServiceImpl(getOrCreateBus(busStrategy, origClassLoader), url, qname, cls);
}
finally
{
+ restoreThreadDefaultBus(busStrategy, orig);
if (restoreTCCL)
setContextClassLoader(origClassLoader);
}
@@ -178,44 +187,56 @@
public ServiceDelegate createServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class serviceClass,
WebServiceFeature... features)
{
+ //check feature types
+ for (WebServiceFeature f : features) {
+ final String fName = f.getClass().getName();
+ if (!fName.startsWith("javax.xml.ws") && !fName.startsWith("org.jboss.ws")) {
+ throw Messages.MESSAGES.unknownFeature(f.getClass().getName());
+ }
+ }
+
+ final String busStrategy = ClientBusSelector.selectStrategy(features);
ClassLoader origClassLoader = getContextClassLoader();
boolean restoreTCCL = false;
+ Bus orig = null;
try
{
restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
- boolean createNewBus = false;
- for (WebServiceFeature f : features) {
- final String fName = f.getClass().getName();
- if (!fName.startsWith("javax.xml.ws") && !fName.startsWith("org.jboss.ws")) {
- throw Messages.MESSAGES.unknownFeature(f.getClass().getName());
- }
- if (fName.equals(UseNewBusFeature.class.getName())) {
- createNewBus = f.isEnabled();
- }
- }
- if (!createNewBus) {
- Bus bus = setValidThreadDefaultBus();
- return new JBossWSServiceImpl(bus, wsdlDocumentLocation, serviceName, serviceClass, features);
- } else { //honor the UseNewBusFeature
- Bus orig = null;
- try {
- orig = BusFactory.getThreadDefaultBus(false);
- Bus bus = BusFactory.newInstance().createBus();
- return new JBossWSServiceImpl(bus, wsdlDocumentLocation, serviceName, serviceClass, features);
- } finally {
- if (orig != null) {
- BusFactory.setThreadDefaultBus(orig);
- }
- }
- }
+ orig = BusFactory.getThreadDefaultBus(false);
+ return new JBossWSServiceImpl(getOrCreateBus(busStrategy, origClassLoader), wsdlDocumentLocation, serviceName, serviceClass, features);
}
finally
{
+ restoreThreadDefaultBus(busStrategy, orig);
if (restoreTCCL)
setContextClassLoader(origClassLoader);
}
}
+ private static Bus getOrCreateBus(String strategy, ClassLoader threadContextClassLoader) {
+ Bus bus = null;
+ if (THREAD_BUS_STRATEGY.equals(strategy))
+ {
+ bus = ProviderImpl.setValidThreadDefaultBus();
+ }
+ else if (NEW_BUS_STRATEGY.equals(strategy))
+ {
+ bus = new JBossWSBusFactory().createBus();
+ }
+ else if (TCCL_BUS_STRATEGY.equals(strategy))
+ {
+ bus = JBossWSBusFactory.getClassLoaderDefaultBus(threadContextClassLoader);
+ }
+ return bus;
+ }
+
+ private static void restoreThreadDefaultBus(final String busStrategy, final Bus origBus) {
+ if (origBus != null && !busStrategy.equals(Constants.THREAD_BUS_STRATEGY))
+ {
+ BusFactory.setThreadDefaultBus(origBus);
+ }
+ }
+
/**
* Ensure the current context classloader can load this ProviderImpl class.
*
@@ -259,7 +280,7 @@
Bus bus = BusFactory.getThreadDefaultBus(false);
if (bus == null)
{
- bus = BusFactory.newInstance().createBus(); //this also set thread local bus internally as it's not set yet
+ bus = new JBossWSBusFactory().createBus(); //this also set thread local bus internally as it's not set yet
}
return bus;
}
@@ -282,56 +303,8 @@
});
}
}
-
- /**
- * Get context classloader.
- *
- * @return the current context classloader
- */
- static ClassLoader getContextClassLoader()
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm == null)
- {
- return Thread.currentThread().getContextClassLoader();
- }
- else
- {
- return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
- {
- public ClassLoader run()
- {
- return Thread.currentThread().getContextClassLoader();
- }
- });
- }
- }
/**
- * Set context classloader.
- *
- * @param classLoader the classloader
- */
- static void setContextClassLoader(final ClassLoader classLoader)
- {
- if (System.getSecurityManager() == null)
- {
- Thread.currentThread().setContextClassLoader(classLoader);
- }
- else
- {
- AccessController.doPrivileged(new PrivilegedAction<Object>()
- {
- public Object run()
- {
- Thread.currentThread().setContextClassLoader(classLoader);
- return null;
- }
- });
- }
- }
-
- /**
* A javax.xml.ws.Endpoint implementation delegating to a provided one
* that sets the TCCL before doing publish.
*
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/SecurityActions.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/SecurityActions.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/SecurityActions.java 2013-10-03 17:23:35 UTC (rev 17976)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.stack.cxf.client;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 03-Oct-2013
+ *
+ */
+class SecurityActions
+{
+ /**
+ * Get context classloader.
+ *
+ * @return the current context classloader
+ */
+ static ClassLoader getContextClassLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+
+ /**
+ * Set context classloader.
+ *
+ * @param classLoader the classloader
+ */
+ static void setContextClassLoader(final ClassLoader classLoader)
+ {
+ if (System.getSecurityManager() == null)
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ }
+ else
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ return null;
+ }
+ });
+ }
+ }
+
+ /**
+ * Return the current value of the specified system property
+ *
+ * @param name
+ * @param defaultValue
+ * @return
+ */
+ static String getSystemProperty(final String name, final String defaultValue)
+ {
+ PrivilegedAction<String> action = new PrivilegedAction<String>()
+ {
+ public String run()
+ {
+ return System.getProperty(name, defaultValue);
+ }
+ };
+ return AccessController.doPrivileged(action);
+ }
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/SecurityActions.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/UseTCCLBusFeature.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/UseTCCLBusFeature.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/UseTCCLBusFeature.java 2013-10-03 17:23:35 UTC (rev 17976)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.stack.cxf.client;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * A JBossWS-CXF custom WebServiceFeature to be used for building the
+ * JAXWS Service using the Bus associated with the current thread
+ * context classloader.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 03-Oct-2013
+ *
+ */
+public class UseTCCLBusFeature extends WebServiceFeature
+{
+ public UseTCCLBusFeature() {
+ this.enabled = true;
+ }
+
+ public UseTCCLBusFeature(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ @Override
+ public String getID()
+ {
+ return this.getClass().getName();
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/UseTCCLBusFeature.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/UseThreadBusFeature.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/UseThreadBusFeature.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/UseThreadBusFeature.java 2013-10-03 17:23:35 UTC (rev 17976)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.stack.cxf.client;
+
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * A JBossWS-CXF custom WebServiceFeature to be used for building the
+ * JAXWS Service using the Bus associated with the current thread.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 03-Oct-2013
+ *
+ */
+public class UseThreadBusFeature extends WebServiceFeature
+{
+ public UseThreadBusFeature() {
+ this.enabled = true;
+ }
+
+ public UseThreadBusFeature(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ @Override
+ public String getID()
+ {
+ return this.getClass().getName();
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/UseThreadBusFeature.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java 2013-10-03 09:00:55 UTC (rev 17975)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSBusFactory.java 2013-10-03 17:23:35 UTC (rev 17976)
@@ -22,10 +22,14 @@
package org.jboss.wsf.stack.cxf.client.configuration;
import java.net.URL;
+import java.util.Iterator;
import java.util.Map;
+import java.util.WeakHashMap;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.apache.cxf.buslifecycle.BusLifeCycleListener;
+import org.apache.cxf.buslifecycle.BusLifeCycleManager;
import org.jboss.wsf.stack.cxf.client.util.SpringUtils;
/**
@@ -43,6 +47,8 @@
*/
public class JBossWSBusFactory extends BusFactory
{
+ private static final Map<ClassLoader, Bus> classLoaderBusses = new WeakHashMap<ClassLoader, Bus>();
+
private JBossWSSpringBusFactory springBusFactory;
private JBossWSNonSpringBusFactory nonSpringBusFactory;
@@ -118,7 +124,7 @@
return getNonSpringBusFactory().createBus(extensions, properties);
}
- public JBossWSSpringBusFactory getSpringBusFactory()
+ public synchronized JBossWSSpringBusFactory getSpringBusFactory()
{
if (springBusFactory == null)
{
@@ -127,7 +133,7 @@
return springBusFactory;
}
- public JBossWSNonSpringBusFactory getNonSpringBusFactory()
+ public synchronized JBossWSNonSpringBusFactory getNonSpringBusFactory()
{
if (nonSpringBusFactory == null)
{
@@ -158,4 +164,69 @@
SecurityActions.setContextClassLoader(origClassLoader);
}
}
+
+ /**
+ * Gets the default bus for the given classloader
+ *
+ * @param classloader
+ * @return
+ */
+ public static Bus getClassLoaderDefaultBus(final ClassLoader classloader) {
+ Bus classLoaderBus;
+ synchronized (classLoaderBusses) {
+ classLoaderBus = classLoaderBusses.get(classloader);
+ if (classLoaderBus == null) {
+ classLoaderBus = new JBossWSBusFactory().createBus();
+ //register a listener for cleaning up the bus from the classloader association in the JBossWSBusFactory
+ BusLifeCycleListener listener = new ClassLoaderDefaultBusLifeCycleListener(classLoaderBus);
+ classLoaderBus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
+ classLoaderBusses.put(classloader, classLoaderBus);
+ }
+ }
+ return classLoaderBus;
+ }
+
+ /**
+ * Removes a bus from being the default bus for any classloader
+ *
+ * @param bus
+ */
+ public static void clearDefaultBusForAnyClassLoader(final Bus bus) {
+ synchronized (classLoaderBusses) {
+ for (final Iterator<Bus> iterator = classLoaderBusses.values().iterator();
+ iterator.hasNext();) {
+ Bus itBus = iterator.next();
+ if (bus == null || itBus == null|| bus.equals(itBus)) {
+ iterator.remove();
+ }
+ }
+ }
+ }
+
+ private static class ClassLoaderDefaultBusLifeCycleListener implements BusLifeCycleListener {
+
+ private final Bus bus;
+
+ public ClassLoaderDefaultBusLifeCycleListener(final Bus bus) {
+ this.bus = bus;
+ }
+
+ @Override
+ public void initComplete()
+ {
+ // NOOP
+ }
+
+ @Override
+ public void preShutdown()
+ {
+ // NOOP
+ }
+
+ @Override
+ public void postShutdown()
+ {
+ JBossWSBusFactory.clearDefaultBusForAnyClassLoader(this.bus);
+ }
+ }
}
11 years, 3 months
JBossWS SVN: r17975 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-03 05:00:55 -0400 (Thu, 03 Oct 2013)
New Revision: 17975
Modified:
stack/cxf/trunk/pom.xml
Log:
Use released jbossws-common-2.2.2.Final
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2013-10-03 08:48:06 UTC (rev 17974)
+++ stack/cxf/trunk/pom.xml 2013-10-03 09:00:55 UTC (rev 17975)
@@ -61,7 +61,7 @@
<properties>
<jbossws.api.version>1.0.2.Final</jbossws.api.version>
<jbossws.spi.version>2.2.2-SNAPSHOT</jbossws.spi.version>
- <jbossws.common.version>2.2.2-SNAPSHOT</jbossws.common.version>
+ <jbossws.common.version>2.2.2.Final</jbossws.common.version>
<jbossws.common.tools.version>1.2.0.Final</jbossws.common.tools.version>
<jbossws.jboss712.version>4.2.1.Final</jbossws.jboss712.version>
<jbossws.jboss713.version>4.2.1.Final</jbossws.jboss713.version>
11 years, 3 months
JBossWS SVN: r17974 - in stack/cxf/trunk/modules: testsuite/shared-tests/src/test/ant-import and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-10-03 04:48:06 -0400 (Thu, 03 Oct 2013)
New Revision: 17974
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/LogicalSimpleHandler.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/SecureEndpointImpl2.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/handlers2.xml
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/HandlerAuthInterceptor.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/HandlerAuthTestCase.java
Log:
[WFLY-308][JBWS-3378] Also deal with logical handlers
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/HandlerAuthInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/HandlerAuthInterceptor.java 2013-10-02 11:12:29 UTC (rev 17973)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/HandlerAuthInterceptor.java 2013-10-03 08:48:06 UTC (rev 17974)
@@ -24,7 +24,6 @@
import static org.jboss.wsf.stack.cxf.Messages.MESSAGES;
import java.lang.reflect.Method;
-import java.util.LinkedList;
import java.util.List;
import javax.xml.ws.handler.Handler;
@@ -34,6 +33,7 @@
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.jaxws.context.WrappedMessageContext;
import org.apache.cxf.jaxws.handler.HandlerChainInvoker;
+import org.apache.cxf.jaxws.handler.logical.LogicalHandlerInInterceptor;
import org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor;
import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
import org.apache.cxf.message.Exchange;
@@ -61,20 +61,25 @@
{
super(Phase.PRE_PROTOCOL_FRONTEND);
addBefore(SOAPHandlerInterceptor.class.getName());
+ addBefore(LogicalHandlerInInterceptor.class.getName());
}
@Override
public void handleMessage(Message message) throws Fault
{
- Exchange ex = message.getExchange();
+ final Exchange ex = message.getExchange();
HandlerChainInvoker invoker = ex.get(HandlerChainInvoker.class);
if (null == invoker)
{
- org.apache.cxf.endpoint.Endpoint endpoint = ex.getEndpoint();
- if (endpoint instanceof JaxWsEndpointImpl) {
- JaxWsEndpointImpl ep = (JaxWsEndpointImpl)endpoint;
- invoker = new JBossWSHandlerChainInvoker(ep.getJaxwsBinding().getHandlerChain(), isOutbound(message, ex));
- ex.put(HandlerChainInvoker.class, invoker);
+ final org.apache.cxf.endpoint.Endpoint endpoint = ex.getEndpoint();
+ if (endpoint instanceof JaxWsEndpointImpl) { // JAXWS handlers are not assigned to different endpoint types
+ final JaxWsEndpointImpl ep = (JaxWsEndpointImpl)endpoint;
+ @SuppressWarnings("rawtypes")
+ final List<Handler> handlerChain = ep.getJaxwsBinding().getHandlerChain();
+ if (handlerChain != null && !handlerChain.isEmpty()) { //save
+ invoker = new JBossWSHandlerChainInvoker(handlerChain, isOutbound(message, ex));
+ ex.put(HandlerChainInvoker.class, invoker);
+ }
}
}
}
@@ -117,7 +122,7 @@
Endpoint ep = exchange.get(Endpoint.class);
EJBMethodSecurityAttributeProvider attributeProvider = ep
.getAttachment(EJBMethodSecurityAttributeProvider.class);
- if (attributeProvider != null) //ejb endpoints only can associated with this...
+ if (attributeProvider != null) //ejb endpoints only can be associated with this...
{
SecurityContext secCtx = message.get(SecurityContext.class);
BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml 2013-10-02 11:12:29 UTC (rev 17973)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/ant-import/build-jars-jaxws.xml 2013-10-03 08:48:06 UTC (rev 17974)
@@ -176,12 +176,23 @@
<!-- jaxws-handlerauth -->
<jar destfile="${tests.output.dir}/test-libs/jaxws-handlerauth.jar">
<fileset dir="${tests.output.dir}/test-classes">
- <include name="org/jboss/test/ws/jaxws/handlerauth/SecureEndpoint*.class" />
+ <include name="org/jboss/test/ws/jaxws/handlerauth/SecureEndpoint.class" />
+ <include name="org/jboss/test/ws/jaxws/handlerauth/SecureEndpointImpl.class" />
<include name="org/jboss/test/ws/jaxws/handlerauth/SimpleHandler.class" />
<include name="org/jboss/test/ws/jaxws/handlerauth/handlers.xml" />
</fileset>
</jar>
+ <!-- jaxws-handlerauth2 -->
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-handlerauth2.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/handlerauth/SecureEndpoint.class" />
+ <include name="org/jboss/test/ws/jaxws/handlerauth/SecureEndpointImpl2.class" />
+ <include name="org/jboss/test/ws/jaxws/handlerauth/LogicalSimpleHandler.class" />
+ <include name="org/jboss/test/ws/jaxws/handlerauth/handlers2.xml" />
+ </fileset>
+ </jar>
+
<!-- jaxws-handlerscope -->
<war warfile="${tests.output.dir}/test-libs/jaxws-handlerscope.war" webxml="${tests.output.dir}/test-resources/jaxws/handlerscope/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/HandlerAuthTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/HandlerAuthTestCase.java 2013-10-02 11:12:29 UTC (rev 17973)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/HandlerAuthTestCase.java 2013-10-03 08:48:06 UTC (rev 17974)
@@ -44,7 +44,7 @@
{
public static Test suite()
{
- JBossWSTestSetup testSetup = new JBossWSTestSetup(HandlerAuthTestCase.class, "jaxws-handlerauth.jar");
+ JBossWSTestSetup testSetup = new JBossWSTestSetup(HandlerAuthTestCase.class, "jaxws-handlerauth.jar,jaxws-handlerauth2.jar");
Map<String, String> authenticationOptions = new HashMap<String, String>();
authenticationOptions.put("usersProperties",
getResourceFile("jaxws/handlerauth/jbossws-users.properties").getAbsolutePath());
@@ -53,13 +53,23 @@
testSetup.addSecurityDomainRequirement("handlerauth-security-domain", authenticationOptions);
return testSetup;
}
-
- public void testAuth() throws Exception
- {
+
+ public void testAuthSOAPHandler() throws Exception {
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/handlerauth?wsdl");
Service service = Service.create(wsdlURL, new QName("http://ws/", "SecureEndpointImplService"));
SecureEndpoint port = service.getPort(new QName("http://ws/", "SecureEndpointPort"), SecureEndpoint.class);
-
+ testAuth(port);
+ }
+
+ public void testAuthLogicalHandler() throws Exception {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/handlerauth2?wsdl");
+ Service service = Service.create(wsdlURL, new QName("http://ws/", "SecureEndpointImpl2Service"));
+ SecureEndpoint port = service.getPort(new QName("http://ws/", "SecureEndpoint2Port"), SecureEndpoint.class);
+ testAuth(port);
+ }
+
+ private void testAuth(final SecureEndpoint port) throws Exception
+ {
setUser((BindingProvider)port, "John", "foo");
int count = port.getHandlerCounter();
int newCount;
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/LogicalSimpleHandler.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/LogicalSimpleHandler.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/LogicalSimpleHandler.java 2013-10-03 08:48:06 UTC (rev 17974)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.handlerauth;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.LogicalHandler;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.MessageContext;
+
+public class LogicalSimpleHandler implements LogicalHandler<LogicalMessageContext>
+{
+ public static volatile int counter = 0;
+
+ @Override
+ public boolean handleMessage(LogicalMessageContext context)
+ {
+ Boolean isOutbound = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+ String operation = ((QName) context.get(MessageContext.WSDL_OPERATION)).getLocalPart();
+ if (!isOutbound && !operation.equals("getHandlerCounter")) {
+ counter++;
+ }
+ return true;
+ }
+
+ @Override
+ public boolean handleFault(LogicalMessageContext context)
+ {
+ return true;
+ }
+
+ @Override
+ public void close(MessageContext context)
+ {
+ //NOOP
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/LogicalSimpleHandler.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/SecureEndpointImpl2.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/SecureEndpointImpl2.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/SecureEndpointImpl2.java 2013-10-03 08:48:06 UTC (rev 17974)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.handlerauth;
+
+import javax.jws.Oneway;
+import javax.jws.WebService;
+import javax.ejb.Stateless;
+import javax.annotation.security.DeclareRoles;
+import javax.annotation.security.DenyAll;
+import javax.annotation.security.PermitAll;
+import javax.annotation.security.RolesAllowed;
+
+import javax.jws.WebMethod;
+
+import java.util.Enumeration;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.jws.HandlerChain;
+import javax.xml.soap.SOAPMessage;
+import javax.annotation.PostConstruct;
+
+import java.io.PrintStream;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.ws.api.annotation.WebContext;
+import org.jboss.ejb3.annotation.SecurityDomain;
+import org.jboss.logging.Logger;
+
+@WebService(name = "SecureEndpoint2", targetNamespace = "http://ws/")
+@HandlerChain(file = "handlers2.xml")
+@WebContext(contextRoot = "/handlerauth2", urlPattern = "/*", authMethod = "BASIC", transportGuarantee = "NONE", secureWSDLAccess = false)
+@Stateless
+@SecurityDomain("handlerauth-security-domain")
+@RolesAllowed({"user", "friend"})
+@DeclareRoles({"user", "friend"})
+public class SecureEndpointImpl2 implements SecureEndpoint
+{
+ private Logger log = Logger.getLogger(this.getClass());
+
+ @Resource
+ WebServiceContext context;
+
+ @RolesAllowed("user")
+ public String sayHello(String name)
+ {
+ String principalName = context.getUserPrincipal().getName();
+ if (principalName.equals(name)) {
+ log.info("sayHello() invoked : Hello, Mr. " + name);
+ return "Hello, Mr. " + name;
+ } else {
+ return "Mr. " + name + ", you authenticated as \'" + principalName + "\'";
+ }
+ }
+
+ @RolesAllowed("friend")
+ public String sayBye(String name)
+ {
+ String principalName = context.getUserPrincipal().getName();
+ if (principalName.equals(name)) {
+ log.info("sayBye() invoked : Bye, Mr. " + name);
+ return "Bye, Mr. " + name;
+ } else {
+ return "Mr. " + name + ", you authenticated as \'" + principalName + "\'";
+ }
+ }
+
+ public int getHandlerCounter() {
+ return LogicalSimpleHandler.counter;
+ }
+
+
+ @Oneway
+ @RolesAllowed("friend")
+ public void ping() {
+ //NOOP
+ }
+
+ @DenyAll
+ public void deniedMethod() {
+ //NOOP
+ }
+
+ @PermitAll
+ public String echo(String s) {
+ return s;
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/SecureEndpointImpl2.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/handlers2.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/handlers2.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/handlers2.xml 2013-10-03 08:48:06 UTC (rev 17974)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee">
+ <handler-chain>
+ <handler>
+ <handler-name>LogicalSimpleHandler</handler-name>
+ <handler-class>org.jboss.test.ws.jaxws.handlerauth.LogicalSimpleHandler</handler-class>
+ </handler>
+ </handler-chain>
+</handler-chains>
\ No newline at end of file
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/handlers2.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
11 years, 3 months
JBossWS SVN: r17973 - projects/wsi-bp-test/trunk.
by jbossws-commits@lists.jboss.org
Author: rsvoboda(a)redhat.com
Date: 2013-10-02 07:12:29 -0400 (Wed, 02 Oct 2013)
New Revision: 17973
Modified:
projects/wsi-bp-test/trunk/pom.xml
Log:
Creating profile slf4j-log4j12 which is activated by default, I need to disble it when running with EAP dependencies, org.opensaml:openws has dependencies on org.slf4j:log4j-over-slf4j and it colides with slf4j-log4j12 dependency in project -- org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException ... Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jboss.test.ws.jaxws.bp12...TestCase
Modified: projects/wsi-bp-test/trunk/pom.xml
===================================================================
--- projects/wsi-bp-test/trunk/pom.xml 2013-10-02 08:58:47 UTC (rev 17972)
+++ projects/wsi-bp-test/trunk/pom.xml 2013-10-02 11:12:29 UTC (rev 17973)
@@ -100,13 +100,6 @@
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${org.slf4j.version}</version>
- </dependency>
-
-
- <dependency>
<groupId>org.picketlink</groupId>
<artifactId>picketlink-core</artifactId>
<version>${picketlink.version}</version>
@@ -781,6 +774,23 @@
</dependency>
</dependencies>
</profile>
+
+ <profile>
+ <id>slf4j-log4j12</id>
+ <activation>
+ <property>
+ <name>!no-slf4j-log4j12</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${org.slf4j.version}</version>
+ </dependency>
+ </dependencies>
+ </profile>
+
</profiles>
</project>
11 years, 3 months
JBossWS SVN: r17972 - projects/wsi-bp-test/trunk.
by jbossws-commits@lists.jboss.org
Author: rsvoboda(a)redhat.com
Date: 2013-10-02 04:58:47 -0400 (Wed, 02 Oct 2013)
New Revision: 17972
Modified:
projects/wsi-bp-test/trunk/pom.xml
Log:
adding use-eap6-bom profile to use prodictized dependencies
Modified: projects/wsi-bp-test/trunk/pom.xml
===================================================================
--- projects/wsi-bp-test/trunk/pom.xml 2013-10-02 08:20:19 UTC (rev 17971)
+++ projects/wsi-bp-test/trunk/pom.xml 2013-10-02 08:58:47 UTC (rev 17972)
@@ -756,7 +756,31 @@
</properties>
</profile>
+ <profile>
+ <id>use-eap6-bom</id>
+ <properties>
+ <version.eap6-supported-artifacts>6.2.0.Beta1</version.eap6-supported-artifacts>
+ </properties>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.bom</groupId>
+ <artifactId>eap6-supported-artifacts</artifactId>
+ <version>${version.eap6-supported-artifacts}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.ws.cxf</groupId>
+ <artifactId>jbossws-cxf-client</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
</profiles>
</project>
11 years, 3 months