JBossWS SVN: r18067 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf/configuration and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-07 12:00:56 -0500 (Thu, 07 Nov 2013)
New Revision: 18067
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
Log:
[JBWS-3730] Adding support for org.jboss.ws.cxf.disableHandlerAuthCheck prop in jboss-webservices.xml
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-11-07 09:48:04 UTC (rev 18066)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java 2013-11-07 17:00:56 UTC (rev 18067)
@@ -43,6 +43,7 @@
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_DISABLE_HANDLER_AUTH_CHECKS = "org.jboss.ws.cxf.disableHandlerAuthChecks";
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";
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2013-11-07 09:48:04 UTC (rev 18066)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2013-11-07 17:00:56 UTC (rev 18067)
@@ -105,11 +105,11 @@
{
bus.setExtension(configurer, Configurer.class);
}
- setInterceptors(bus);
+ Map<String, String> props = (wsmd == null) ? null : wsmd.getProperties();
+
+ setInterceptors(bus, props);
setResourceResolver(bus, resolver);
- Map<String, String> props = (wsmd == null) ? null : wsmd.getProperties();
-
if (bus.getExtension(PolicyEngine.class) != null)
{
bus.getExtension(PolicyEngine.class).setAlternativeSelector(getAlternativeSelector(props));
@@ -152,14 +152,18 @@
public abstract Configurer createServerConfigurer(BindingCustomization customization,
WSDLFilePublisher wsdlPublisher, List<Endpoint> depEndpoints, UnifiedVirtualFile root, String epConfigName, String epConfigFile);
- protected static void setInterceptors(Bus bus)
+ protected static void setInterceptors(Bus bus, Map<String, String> props)
{
//Install the EndpointAssociationInterceptor for linking every message exchange
//with the proper spi Endpoint retrieved in CXFServletExt
bus.getInInterceptors().add(new EndpointAssociationInterceptor());
bus.getInInterceptors().add(new EnableDecoupledFaultInterceptor());
bus.getInInterceptors().add(new NsCtxSelectorStoreInterceptor());
- bus.getInInterceptors().add(new HandlerAuthInterceptor());
+
+ final String p = (props != null) ? props.get(Constants.JBWS_CXF_DISABLE_HANDLER_AUTH_CHECKS) : null;
+ if (p == null || (!"true".equalsIgnoreCase(p) && !"1".equalsIgnoreCase(p))) {
+ bus.getInInterceptors().add(new HandlerAuthInterceptor());
+ }
}
protected static void setResourceResolver(Bus bus, ResourceResolver resourceResolver)
11 years, 1 month
JBossWS SVN: r18066 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/noIntegration.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-07 04:48:04 -0500 (Thu, 07 Nov 2013)
New Revision: 18066
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/noIntegration/CXFEndpointServlet.java
Log:
[JBWS-3729] free the thread default bus association in the current thread which is serving the servlet init
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/noIntegration/CXFEndpointServlet.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/noIntegration/CXFEndpointServlet.java 2013-11-06 17:10:16 UTC (rev 18065)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/noIntegration/CXFEndpointServlet.java 2013-11-07 09:48:04 UTC (rev 18066)
@@ -24,7 +24,6 @@
import javax.servlet.ServletConfig;
import javax.xml.ws.Endpoint;
-import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.transport.servlet.CXFNonSpringServlet;
@@ -39,8 +38,13 @@
super.loadBus(servletConfig);
// You could add the endpoint publish codes here
- Bus bus = getBus();
- BusFactory.setThreadDefaultBus(bus);
- Endpoint.publish("/Echo1", new EchoImpl());
+ try {
+ Endpoint.publish("/Echo1", new EchoImpl());
+ } finally {
+ //free the thread default bus association in the current thread which
+ //is serving the servlet init, as it can have side effect on other
+ //servlet(s) deployed afterwards
+ BusFactory.setThreadDefaultBus(null);
+ }
}
}
11 years, 1 month
JBossWS SVN: r18065 - common/trunk/src/main/java/org/jboss/ws/common/management.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-06 12:10:16 -0500 (Wed, 06 Nov 2013)
New Revision: 18065
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
Log:
[JBWS-3728] Adding callback handler mechanism to setters
Modified: common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2013-11-06 14:00:26 UTC (rev 18064)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2013-11-06 17:10:16 UTC (rev 18065)
@@ -47,7 +47,13 @@
import org.jboss.wsf.spi.metadata.config.EndpointConfig;
/**
- * Basic implementation of a ServerConfig
+ * Basic implementation of a ServerConfig.
+ *
+ * Instances of AbstractServerConfig allow concurrent read and write access to their
+ * member attributes using getter and setter methods.
+ * A DisabledOperationException is thrown if attribute updates are temporarly or
+ * permanentely disabled. The isModifiable() method can be overwridden to enable / disable
+ * the attribute update.
*
* @author Thomas.Diesler(a)jboss.org
* @author darran.lofthouse(a)jboss.com
@@ -64,16 +70,23 @@
// The MBeanServer
private volatile MBeanServer mbeanServer;
+
// The webservice host name that will be used when updating the wsdl
private volatile String webServiceHost = UNDEFINED_HOSTNAME;
+ private final Object webServiceHostLock = new Object();
+
// The webservice port that will be used when updating the wsdl
private int webServicePort;
private final Object webServicePortLock = new Object();
+
// The webservice port that will be used when updating the wsdl
private int webServiceSecurePort;
private final Object webServiceSecurePortLock = new Object();
+
// Whether we should always modify the soap address to the deployed endpoint location
private volatile boolean modifySOAPAddress;
+ private final Object modifySOAPAddressLock = new Object();
+
//The stack config
protected StackConfig stackConfig;
// The default endpoint configs, if any
@@ -83,7 +96,7 @@
// The server integration classloader' ServerConfig instance reference
private static ServerConfig serverConfig;
-
+
public MBeanServer getMbeanServer()
{
return mbeanServer;
@@ -101,6 +114,11 @@
public void setWebServiceHost(String host) throws UnknownHostException
{
+ setWebServiceHost(host, null);
+ }
+
+ protected void setWebServiceHost(String host, UpdateCallbackHandler uch) throws UnknownHostException
+ {
if (host == null || host.trim().length() == 0)
{
MANAGEMENT_LOGGER.usingUndefinedWebServicesHost(UNDEFINED_HOSTNAME);
@@ -112,7 +130,14 @@
if (MANAGEMENT_LOGGER.isDebugEnabled()) MANAGEMENT_LOGGER.usingLocalHostWebServicesHost(localHost.getHostName());
host = localHost.getHostName();
}
- this.webServiceHost = toIPv6URLFormat("127.0.0.1".equals(host) ? "localhost" : host); // TCK workaround
+ final String wsh = toIPv6URLFormat("127.0.0.1".equals(host) ? "localhost" : host); // TCK workaround
+ synchronized (webServiceHostLock)
+ {
+ if (uch != null) {
+ uch.onBeforeUpdate();
+ }
+ this.webServiceHost = wsh;
+ }
}
private String toIPv6URLFormat(final String host)
@@ -138,16 +163,32 @@
public void setWebServicePort(int port)
{
+ setWebServicePort(port, null);
+ }
+
+ protected void setWebServicePort(int port, UpdateCallbackHandler uch)
+ {
synchronized (webServicePortLock)
{
+ if (uch != null) {
+ uch.onBeforeUpdate();
+ }
this.webServicePort = port;
}
}
public void setWebServiceSecurePort(int port)
{
+ setWebServiceSecurePort(port, null);
+ }
+
+ protected void setWebServiceSecurePort(int port, UpdateCallbackHandler uch)
+ {
synchronized (webServiceSecurePortLock)
{
+ if (uch != null) {
+ uch.onBeforeUpdate();
+ }
this.webServiceSecurePort = port;
}
}
@@ -161,6 +202,17 @@
{
this.modifySOAPAddress = modify;
}
+
+ protected void setModifySOAPAddress(boolean modify, UpdateCallbackHandler uch)
+ {
+ synchronized (modifySOAPAddressLock)
+ {
+ if (uch != null) {
+ uch.onBeforeUpdate();
+ }
+ this.modifySOAPAddress = modify;
+ }
+ }
public int getWebServicePort()
{
@@ -283,4 +335,8 @@
{
return this.clientConfigs;
}
+
+ public interface UpdateCallbackHandler {
+ public void onBeforeUpdate();
+ }
}
\ No newline at end of file
11 years, 1 month
JBossWS SVN: r18064 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2013-11-06 09:00:26 -0500 (Wed, 06 Nov 2013)
New Revision: 18064
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084CxfTestCase.java
Log:
BZ-1016090 file renamed making test name unique.
Copied: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084CxfTestCase.java (from rev 18063, stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084TestCase.java)
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084CxfTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084CxfTestCase.java 2013-11-06 14:00:26 UTC (rev 18064)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.saaj.jbws3084;
+
+import java.net.URL;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPMessage;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * [JBWS-3084] Enable control of chunked encoding when using SOAPConnection.
+ *
+ * @author sberyozk(a)redhat.com
+ */
+public class JBWS3084CxfTestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(JBWS3084CxfTestCase.class, "saaj-soap-connection.war");
+ }
+
+ public void testSoapConnectionGet() throws Exception
+ {
+ final String serviceURL = "http://" + getServerHost() + ":8080/saaj-soap-connection/greetMe";
+ SOAPConnectionFactory conFac = SOAPConnectionFactory.newInstance();
+
+ SOAPConnection con = conFac.createConnection();
+ URL endpoint = new URL(serviceURL);
+ MessageFactory msgFactory = MessageFactory.newInstance();
+ SOAPMessage msg = msgFactory.createMessage();
+ msg.getSOAPBody().addBodyElement(new QName("http://www.jboss.org/jbossws/saaj", "greetMe"));
+ SOAPMessage response = con.call(msg, endpoint);
+ QName greetMeResp = new QName("http://www.jboss.org/jbossws/saaj", "greetMeResponse");
+
+ Iterator<?> sayHiRespIterator = response.getSOAPBody().getChildElements(greetMeResp);
+ SOAPElement soapElement = (SOAPElement) sayHiRespIterator.next();
+ assertNotNull(soapElement);
+
+ assertEquals(1, response.countAttachments());
+ }
+}
11 years, 1 month
JBossWS SVN: r18063 - stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-05 19:15:00 -0500 (Tue, 05 Nov 2013)
New Revision: 18063
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/HandlerAuthInterceptor.java
Log:
[JBWS-3727] Prevent NPE when Principal is not available
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-11-05 23:20:38 UTC (rev 18062)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/HandlerAuthInterceptor.java 2013-11-06 00:15:00 UTC (rev 18063)
@@ -24,6 +24,7 @@
import static org.jboss.wsf.stack.cxf.Messages.MESSAGES;
import java.lang.reflect.Method;
+import java.security.Principal;
import java.util.List;
import javax.xml.ws.handler.Handler;
@@ -147,7 +148,8 @@
}
}
}
- throw MESSAGES.authorizationFailed(secCtx.getUserPrincipal().getName());
+ final Principal p = secCtx.getUserPrincipal();
+ throw MESSAGES.authorizationFailed(p != null ? p.getName() : null);
}
}
}
11 years, 2 months
JBossWS SVN: r18062 - in stack/cxf/trunk/modules/testsuite: shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666 and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-05 18:20:38 -0500 (Tue, 05 Nov 2013)
New Revision: 18062
Modified:
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/TestClient.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestClient.java
Log:
Trying to make the tests relying on System.out from jboss modules based client a bit more robust
Modified: 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 2013-11-05 16:30:12 UTC (rev 18061)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/ClientBusStrategyTests.java 2013-11-05 23:20:38 UTC (rev 18062)
@@ -24,6 +24,7 @@
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
+import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.StringTokenizer;
@@ -68,17 +69,22 @@
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, " ");
+ StringTokenizer st = new StringTokenizer(readFirstLine(bout), " ");
List<Integer> list = new LinkedList<Integer>();
while (st.hasMoreTokens()) {
list.add(Integer.parseInt(st.nextToken()));
}
return list;
}
+
+ private static String readFirstLine(ByteArrayOutputStream bout) throws IOException {
+ bout.flush();
+ final byte[] bytes = bout.toByteArray();
+ if (bytes != null) {
+ BufferedReader reader = new BufferedReader(new java.io.StringReader(new String(bytes)));
+ return reader.readLine();
+ } else {
+ return null;
+ }
+ }
}
Modified: 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 2013-11-05 16:30:12 UTC (rev 18061)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/TestClient.java 2013-11-05 23:20:38 UTC (rev 18062)
@@ -33,5 +33,10 @@
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));
+
+ //wait a bit before returning as the log processing can be aysnch, the test client
+ //relies on the log contents and the log streams are closed by the system when the
+ //process terminates
+ Thread.sleep(1000);
}
}
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java 2013-11-05 16:30:12 UTC (rev 18061)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java 2013-11-05 23:20:38 UTC (rev 18062)
@@ -24,6 +24,7 @@
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
+import java.io.IOException;
import javax.xml.ws.spi.Provider;
@@ -84,13 +85,18 @@
final String command = javaCmd + props + " -jar " + f.getAbsolutePath() + " " + getServerHost();
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();
- }
//check result (includes check on Provider impl, which might be affected by missing javax.xml.ws.api module dependency
- assertEquals(Provider.provider().getClass().getName() + ", " + TestClient.REQ_STR, res);
+ assertEquals(Provider.provider().getClass().getName() + ", " + TestClient.REQ_STR, readFirstLine(bout));
}
+
+ private static String readFirstLine(ByteArrayOutputStream bout) throws IOException {
+ bout.flush();
+ final byte[] bytes = bout.toByteArray();
+ if (bytes != null) {
+ BufferedReader reader = new BufferedReader(new java.io.StringReader(new String(bytes)));
+ return reader.readLine();
+ } else {
+ return null;
+ }
+ }
}
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestClient.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestClient.java 2013-11-05 16:30:12 UTC (rev 18061)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestClient.java 2013-11-05 23:20:38 UTC (rev 18062)
@@ -48,5 +48,10 @@
String serverHost = args[0];
String resStr = testPortAccess(serverHost);
System.out.println(Provider.provider().getClass().getName() + ", " + resStr);
+
+ //wait a bit before returning as the log processing can be aysnch, the test client
+ //relies on the log contents and the log streams are closed by the system when the
+ //process terminates
+ Thread.sleep(1000);
}
}
11 years, 2 months
JBossWS SVN: r18061 - stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3293.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-05 11:30:12 -0500 (Tue, 05 Nov 2013)
New Revision: 18061
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3293/JBWS3293DispatchTestCase.java
Log:
Use same timeout for testInvokeAsynchHandler() as in testInvokeAsynch()
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3293/JBWS3293DispatchTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3293/JBWS3293DispatchTestCase.java 2013-11-04 23:15:16 UTC (rev 18060)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3293/JBWS3293DispatchTestCase.java 2013-11-05 16:30:12 UTC (rev 18061)
@@ -92,7 +92,7 @@
StreamSource reqObj = new StreamSource(new StringReader(reqPayload));
Dispatch<Source> dispatch = createDispatch();
Future<?> future = dispatch.invokeAsync(reqObj, handler);
- future.get(1000, TimeUnit.MILLISECONDS);
+ future.get(3000, TimeUnit.MILLISECONDS);
if (handlerException != null)
throw handlerException;
11 years, 2 months
JBossWS SVN: r18060 - in stack/cxf/trunk/modules/testsuite: shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-04 18:15:16 -0500 (Mon, 04 Nov 2013)
New Revision: 18060
Modified:
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/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/SecureEndpointImpl.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/SimpleHandler.java
Log:
Fixing a bunch of minor potential concurrency issues in the testsuite
Modified: 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 2013-11-04 23:14:06 UTC (rev 18059)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/Helper.java 2013-11-04 23:15:16 UTC (rev 18060)
@@ -29,6 +29,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
@@ -68,12 +69,12 @@
final BusCounter busCounter = new BusCounter();
final ThreadFactory threadFactory = new ThreadFactory()
{
- private volatile int i = 0;
+ private AtomicInteger i = new AtomicInteger(0);
@Override
public Thread newThread(Runnable r)
{
- return new Thread(r, "JBWS3373-thread-" + i++ + "-" + strategy);
+ return new Thread(r, "JBWS3373-thread-" + i.getAndIncrement() + "-" + strategy);
}
};
ExecutorService es = Executors.newFixedThreadPool(size, threadFactory);
Modified: 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 2013-11-04 23:14:06 UTC (rev 18059)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/HelperUsignThreadLocal.java 2013-11-04 23:15:16 UTC (rev 18060)
@@ -29,6 +29,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
@@ -69,12 +70,12 @@
final ThreadLocal<HelloWs> port = createPortThreadLocal(wsdlURL, feature, busCounter);
final ThreadFactory threadFactory = new ThreadFactory()
{
- private volatile int i = 0;
+ private AtomicInteger i = new AtomicInteger(0);
@Override
public Thread newThread(Runnable r)
{
- return new Thread(r, "JBWS3373-TL-thread-" + i++ + "-" + strategy);
+ return new Thread(r, "JBWS3373-TL-thread-" + i.getAndIncrement() + "-" + strategy);
}
};
ExecutorService es = Executors.newFixedThreadPool(size, threadFactory);
Modified: 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 2013-11-04 23:14:06 UTC (rev 18059)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/LogicalSimpleHandler.java 2013-11-04 23:15:16 UTC (rev 18060)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.ws.jaxws.handlerauth;
+import java.util.concurrent.atomic.AtomicInteger;
+
import javax.xml.namespace.QName;
import javax.xml.ws.handler.LogicalHandler;
import javax.xml.ws.handler.LogicalMessageContext;
@@ -28,7 +30,7 @@
public class LogicalSimpleHandler implements LogicalHandler<LogicalMessageContext>
{
- public static volatile int counter = 0;
+ public static AtomicInteger counter = new AtomicInteger(0);
@Override
public boolean handleMessage(LogicalMessageContext context)
@@ -36,7 +38,7 @@
Boolean isOutbound = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
String operation = ((QName) context.get(MessageContext.WSDL_OPERATION)).getLocalPart();
if (!isOutbound && !operation.equals("getHandlerCounter")) {
- counter++;
+ counter.incrementAndGet();
}
return true;
}
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/SecureEndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/SecureEndpointImpl.java 2013-11-04 23:14:06 UTC (rev 18059)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/SecureEndpointImpl.java 2013-11-04 23:15:16 UTC (rev 18060)
@@ -90,7 +90,7 @@
}
public int getHandlerCounter() {
- return SimpleHandler.counter;
+ return SimpleHandler.counter.get();
}
Modified: 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 2013-11-04 23:14:06 UTC (rev 18059)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/SecureEndpointImpl2.java 2013-11-04 23:15:16 UTC (rev 18060)
@@ -90,7 +90,7 @@
}
public int getHandlerCounter() {
- return LogicalSimpleHandler.counter;
+ return LogicalSimpleHandler.counter.get();
}
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/SimpleHandler.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/SimpleHandler.java 2013-11-04 23:14:06 UTC (rev 18059)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/handlerauth/SimpleHandler.java 2013-11-04 23:15:16 UTC (rev 18060)
@@ -22,6 +22,7 @@
package org.jboss.test.ws.jaxws.handlerauth;
import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
import javax.xml.namespace.QName;
import javax.xml.ws.handler.MessageContext;
@@ -30,7 +31,7 @@
public class SimpleHandler implements SOAPHandler<SOAPMessageContext>
{
- public static volatile int counter = 0;
+ public static AtomicInteger counter = new AtomicInteger(0);
@Override
public boolean handleMessage(SOAPMessageContext context)
@@ -38,7 +39,7 @@
Boolean isOutbound = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
String operation = ((QName) context.get(MessageContext.WSDL_OPERATION)).getLocalPart();
if (!isOutbound && !operation.equals("getHandlerCounter")) {
- counter++;
+ counter.incrementAndGet();
}
return true;
}
11 years, 2 months
JBossWS SVN: r18059 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-04 18:14:06 -0500 (Mon, 04 Nov 2013)
New Revision: 18059
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/BusCounter.java
Log:
[JBWS-3726] Fixing failure on IBM JDK6
Modified: 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 2013-11-04 14:51:18 UTC (rev 18058)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3713/BusCounter.java 2013-11-04 23:14:06 UTC (rev 18059)
@@ -28,13 +28,13 @@
public class BusCounter
{
- private final Set<String> set = new HashSet<String>();
+ private final Set<Bus> set = new HashSet<Bus>();
public void count(final Bus bus)
{
synchronized (set)
{
- set.add(bus.getId());
+ set.add(bus);
}
}
@@ -44,4 +44,5 @@
return set.size();
}
}
+
}
11 years, 2 months
JBossWS SVN: r18058 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2013-11-04 09:51:18 -0500 (Mon, 04 Nov 2013)
New Revision: 18058
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
Log:
Be sure the thread default bus is in synch with the specified bus while creating the service
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-11-04 05:11:17 UTC (rev 18057)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-11-04 14:51:18 UTC (rev 18058)
@@ -222,10 +222,18 @@
else if (NEW_BUS_STRATEGY.equals(strategy))
{
bus = new JBossWSBusFactory().createBus();
+ //to prevent issues with CXF code using the default thread bus instead of the one returned here,
+ //set the new bus as thread one, given the line above could have not done this if the current
+ //thread is already assigned a bus
+ BusFactory.setThreadDefaultBus(bus);
}
else if (TCCL_BUS_STRATEGY.equals(strategy))
{
bus = JBossWSBusFactory.getClassLoaderDefaultBus(threadContextClassLoader);
+ //to prevent issues with CXF code using the default thread bus instead of the one returned here,
+ //set the bus as thread one, given the line above could have not done this if we already had a
+ //bus for the classloader and hence we did not create a new one
+ BusFactory.setThreadDefaultBus(bus);
}
return bus;
}
11 years, 2 months