JBossWS SVN: r17319 - in stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules: testsuite and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: klape
Date: 2013-02-13 11:59:21 -0500 (Wed, 13 Feb 2013)
New Revision: 17319
Modified:
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeWebServiceContext.java
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextEJB.java
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/…
[View More]org/jboss/wsf/stack/jbws/WebServiceContextFactoryImpl.java
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextJSE.java
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/testsuite/pom.xml
Log:
[JBPAPP-10637] The WebServiceContext injection needs to be maintained using a ThreadLocal
Modified: stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeWebServiceContext.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeWebServiceContext.java 2013-02-13 16:58:36 UTC (rev 17318)
+++ stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeWebServiceContext.java 2013-02-13 16:59:21 UTC (rev 17319)
@@ -21,6 +21,8 @@
*/
package org.jboss.wsf.stack.jbws;
+import java.security.Principal;
+
import javax.xml.ws.EndpointReference;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.MessageContext;
@@ -35,24 +37,24 @@
import org.w3c.dom.Element;
/**
- * An ExtensibileWebServiceContext implementing the getEndpointReference jaxws 2.1 methods
+ * A WebServiceContext implementing the getEndpointReference jaxws methods.
*
* @author alessio.soldano(a)jboss.com
- * @since 27-Jan-2009
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
-public abstract class NativeWebServiceContext extends ExtensibleWebServiceContext
+public final class NativeWebServiceContext extends ExtensibleWebServiceContext
{
- public NativeWebServiceContext(MessageContext messageContext)
+ public NativeWebServiceContext(final MessageContext messageContext)
{
super(messageContext);
}
- public EndpointReference getEndpointReference(Element... referenceParameters)
+ public EndpointReference getEndpointReference(final Element... referenceParameters)
{
- return getEndpointReference(W3CEndpointReference.class, referenceParameters);
+ return this.getEndpointReference(W3CEndpointReference.class, referenceParameters);
}
- public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters)
+ public <T extends EndpointReference> T getEndpointReference(final Class<T> clazz, final Element... referenceParameters)
{
EndpointMetaData epMetaData = ((CommonMessageContext)getMessageContext()).getEndpointMetaData();
if (epMetaData == null)
@@ -75,4 +77,16 @@
}
return EndpointReferenceUtil.transform(clazz, builder.build());
}
+
+ @Override
+ public Principal getUserPrincipal()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isUserInRole(String role)
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified: stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextEJB.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextEJB.java 2013-02-13 16:58:36 UTC (rev 17318)
+++ stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextEJB.java 2013-02-13 16:59:21 UTC (rev 17319)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.jbws;
-
-import java.security.Principal;
-
-import javax.ejb.EJBContext;
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * A WebServiceContext implementation that delegates to the EJBContext.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jan-2007
- */
-public class WebServiceContextEJB extends NativeWebServiceContext
-{
- public WebServiceContextEJB(MessageContext msgContext)
- {
- super(msgContext);
- }
-
- public Principal getUserPrincipal()
- {
- EJBContext ejbContext = getAttachment(EJBContext.class);
- Principal principal = ejbContext.getCallerPrincipal();
- return principal;
- }
-
- public boolean isUserInRole(String role)
- {
- EJBContext ejbContext = getAttachment(EJBContext.class);
- boolean isUserInRole = ejbContext.isCallerInRole(role);
- return isUserInRole;
- }
-}
Modified: stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextFactoryImpl.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextFactoryImpl.java 2013-02-13 16:58:36 UTC (rev 17318)
+++ stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextFactoryImpl.java 2013-02-13 16:59:21 UTC (rev 17319)
@@ -23,6 +23,8 @@
import javax.xml.ws.handler.MessageContext;
+import org.jboss.wsf.common.invocation.WebServiceContextEJB;
+import org.jboss.wsf.common.invocation.WebServiceContextJSE;
import org.jboss.wsf.spi.invocation.ExtensibleWebServiceContext;
import org.jboss.wsf.spi.invocation.InvocationType;
import org.jboss.wsf.spi.invocation.WebServiceContextFactory;
@@ -39,9 +41,9 @@
ExtensibleWebServiceContext context = null;
if(type.toString().indexOf("EJB")!=-1 || type.toString().indexOf("MDB")!=-1)
- context = new WebServiceContextEJB(messageContext);
+ context = new WebServiceContextEJB(new NativeWebServiceContext(messageContext));
else
- context = new WebServiceContextJSE(messageContext);
+ context = new WebServiceContextJSE(new NativeWebServiceContext(messageContext));
return context;
}
Modified: stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextJSE.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextJSE.java 2013-02-13 16:58:36 UTC (rev 17318)
+++ stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WebServiceContextJSE.java 2013-02-13 16:59:21 UTC (rev 17319)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.jbws;
-
-import java.security.Principal;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * A WebServiceContext implementation that delegates to the HttpServletRequest.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jan-2007
- */
-public class WebServiceContextJSE extends NativeWebServiceContext
-{
- private HttpServletRequest httpRequest;
-
- public WebServiceContextJSE(MessageContext msgContext)
- {
- super(msgContext);
- httpRequest = (HttpServletRequest)msgContext.get(MessageContext.SERVLET_REQUEST);
- if (httpRequest == null)
- throw new IllegalStateException("Cannot obtain HTTPServletRequest from message context");
- }
-
- @Override
- public Principal getUserPrincipal()
- {
- Principal principal = httpRequest.getUserPrincipal();
- return principal;
- }
-
- @Override
- public boolean isUserInRole(String role)
- {
- boolean isUserInRole = httpRequest.isUserInRole(role);
- return isUserInRole;
- }
-}
Modified: stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/testsuite/pom.xml
===================================================================
--- stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/testsuite/pom.xml 2013-02-13 16:58:36 UTC (rev 17318)
+++ stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/modules/testsuite/pom.xml 2013-02-13 16:59:21 UTC (rev 17319)
@@ -53,7 +53,7 @@
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
- <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ <systemPath>${java.home}/../Classes/classes.jar</systemPath>
</dependency>
<dependency>
<groupId>javax.ejb</groupId>
[View Less]
12 years, 2 months
JBossWS SVN: r17318 - in framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test: java/org/jboss/test/ws/jaxws and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: klape
Date: 2013-02-13 11:58:36 -0500 (Wed, 13 Feb 2013)
New Revision: 17318
Added:
framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/
framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractEndpoint.java
framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractTestCase.java
framework/…
[View More]branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/Endpoint.java
framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/EndpointEJB.java
framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/EndpointJSE.java
framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/JBWS2934EJBTestCase.java
framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/JBWS2934JSETestCase.java
framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/resources/jaxws/jbws2934/
framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/resources/jaxws/jbws2934/WEB-INF/
framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/resources/jaxws/jbws2934/WEB-INF/web.xml
Modified:
framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/ant-import/build-jars-jaxws.xml
Log:
[JBPAPP-10637] Checking in test case (WebServiceContext ThreadLocal issue)
Modified: framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/ant-import/build-jars-jaxws.xml 2013-02-13 16:55:28 UTC (rev 17317)
+++ framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/ant-import/build-jars-jaxws.xml 2013-02-13 16:58:36 UTC (rev 17318)
@@ -764,6 +764,23 @@
<fileset file="${tests.output.dir}/test-libs/jaxws-jbws2634-pojo.war"/>
</ear>
+ <!-- jaxws-jbws2934 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2934.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws2934/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2934/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws2934/EndpointEJB.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws2934/*TestCase*.class"/>
+ </classes>
+ </war>
+
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-jbws2934.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2934/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws2934/EndpointJSE.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/jbws2934/*TestCase*.class"/>
+ </fileset>
+ </jar>
+
<!-- jaxws namespace -->
<war warfile="${tests.output.dir}/test-libs/jaxws-namespace.war" webxml="${tests.output.dir}/test-resources/jaxws/namespace/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added: framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractEndpoint.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractEndpoint.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractEndpoint.java 2013-02-13 16:58:36 UTC (rev 17318)
@@ -0,0 +1,86 @@
+/*
+ * 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.jaxws.jbws2934;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * Abstract endpoint implementation reused in both JSE and EJB endpoint.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+abstract class AbstractEndpoint implements Endpoint
+{
+
+ protected AbstractEndpoint()
+ {
+ super();
+ }
+
+ @Resource
+ WebServiceContext wsCtx1;
+ WebServiceContext wsCtx2;
+
+ @Resource
+ void setWebServiceContext(WebServiceContext wsCtx)
+ {
+ this.wsCtx2 = wsCtx;
+ }
+
+ @PostConstruct
+ private void init()
+ {
+ this.assertWebServiceContexts();
+ }
+
+ protected int getQueryParameterInternal(String key)
+ {
+ this.assertWebServiceContexts();
+ int ctx1Value = this.getValue(this.wsCtx1, key);
+ int ctx2Value = this.getValue(this.wsCtx2, key);
+ if (ctx1Value != ctx2Value)
+ throw new WebServiceException("Values have to be equivalent, they're comming from the same request");
+
+ return ++ctx1Value;
+ }
+
+ protected int getValue(WebServiceContext wsCtx, String queryKey)
+ {
+ HttpServletRequest servletReq = (HttpServletRequest)wsCtx.getMessageContext().get(MessageContext.SERVLET_REQUEST);
+ String queryString = servletReq.getQueryString();
+ int equalsSignPosition = queryString.indexOf('=');
+ return Integer.valueOf(queryString.substring(equalsSignPosition + 1));
+ }
+
+ protected void assertWebServiceContexts()
+ {
+ if (this.wsCtx1 == null)
+ throw new WebServiceException("Web service context 1 is null");
+ if (this.wsCtx2 == null)
+ throw new WebServiceException("Web service context 2 is null");
+ }
+}
Added: framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractTestCase.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractTestCase.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/AbstractTestCase.java 2013-02-13 16:58:36 UTC (rev 17318)
@@ -0,0 +1,129 @@
+/*
+ * 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.jaxws.jbws2934;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * [JBWS-2934] WebServiceContext implementation have to be ThreadLocal aware.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+abstract class AbstractTestCase extends JBossWSTest
+{
+ private static final int THREADS_COUNT = 20;
+ private static final int REQUESTS_COUNT = 20;
+ private static final String ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws2934";
+ private final Endpoint[] proxies = new Endpoint[THREADS_COUNT];
+ private final Thread[] threads = new Thread[THREADS_COUNT];
+ private final TestJob[] jobs = new TestJob[THREADS_COUNT];
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ QName serviceName = new QName("http://jboss.org/jbws2934", "EndpointService");
+ URL wsdlURL = new URL(ENDPOINT_ADDRESS + "?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ for (int i = 0; i < THREADS_COUNT; i++)
+ proxies[i] = service.getPort(Endpoint.class);
+ }
+
+ public void testEndpointConcurrently() throws Exception
+ {
+ for (int i = 0; i < THREADS_COUNT; i++)
+ {
+ System.out.println("Creating thread " + (i + 1));
+ jobs[i] = new TestJob(proxies[i], REQUESTS_COUNT, "TestJob" + i);
+ threads[i] = new Thread(jobs[i]);
+ }
+ for (int i = 0; i < THREADS_COUNT; i++)
+ {
+ System.out.println("Starting thread " + (i + 1));
+ threads[i].start();
+ }
+ Exception e = null;
+ for (int i = 0; i < THREADS_COUNT; i++)
+ {
+ System.out.println("Joining thread " + (i + 1));
+ threads[i].join();
+ if (e == null)
+ e = jobs[i].getException();
+ }
+ if (e != null) throw e;
+ }
+
+ private static final class TestJob implements Runnable
+ {
+ private final String jobName;
+ private final Endpoint proxy;
+ private final int countOfRequests;
+ private Exception exception;
+
+ TestJob(Endpoint proxy, int countOfRequests, String jobName)
+ {
+ this.proxy = proxy;
+ this.countOfRequests = countOfRequests;
+ this.jobName = jobName;
+ }
+
+ public void run()
+ {
+ try
+ {
+ for (int i = 0; i < this.countOfRequests; i++)
+ {
+ this.setQueryParameter(proxy, i);
+ int retVal = proxy.getQueryParameter(jobName);
+ System.out.println("Thread=" + this.jobName + ", iteration=" + i);
+ if (retVal != (i + 1))
+ throw new RuntimeException("Thread=" + this.jobName + ", iteration=" + i + ", received=" + retVal);
+ }
+ }
+ catch (Exception e)
+ {
+ System.out.println("Exception caught: " + e.getMessage());
+ this.exception = e;
+ }
+ }
+
+ private void setQueryParameter(Endpoint proxy, int value)
+ {
+ BindingProvider bp = (BindingProvider)proxy;
+ String queryString = "?" + this.jobName + "=" + value;
+ bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, ENDPOINT_ADDRESS + queryString);
+ }
+
+ Exception getException()
+ {
+ return this.exception;
+ }
+ }
+}
Added: framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/Endpoint.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/Endpoint.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/Endpoint.java 2013-02-13 16:58:36 UTC (rev 17318)
@@ -0,0 +1,37 @@
+/*
+ * 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.jaxws.jbws2934;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+/**
+ * Endpoint interface.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@WebService(name="Endpoint", targetNamespace="http://jboss.org/jbws2934")
+public interface Endpoint
+{
+ @WebMethod
+ public int getQueryParameter(String key);
+}
Added: framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/EndpointEJB.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/EndpointEJB.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/EndpointEJB.java 2013-02-13 16:58:36 UTC (rev 17318)
@@ -0,0 +1,60 @@
+/*
+ * 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.jaxws.jbws2934;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.ws.WebServiceException;
+
+import javax.ejb.Stateless;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
+import org.jboss.wsf.spi.annotation.WebContext;
+
+/**
+ * Endpoint EJB implementation.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@Stateless
+@WebService
+(
+ name = "Endpoint",
+ serviceName = "EndpointService",
+ targetNamespace="http://jboss.org/jbws2934",
+ endpointInterface="org.jboss.test.ws.jaxws.jbws2934.Endpoint"
+)
+@WebContext
+(
+ contextRoot = "/jaxws-jbws2934",
+ urlPattern = "/*"
+)
+public class EndpointEJB extends AbstractEndpoint
+{
+ @WebMethod
+ public int getQueryParameter(String key)
+ {
+ return super.getQueryParameterInternal(key);
+ }
+}
Added: framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/EndpointJSE.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/EndpointJSE.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/EndpointJSE.java 2013-02-13 16:58:36 UTC (rev 17318)
@@ -0,0 +1,46 @@
+/*
+ * 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.jaxws.jbws2934;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+/**
+ * Endpoint JSE implementation.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@WebService
+(
+ name = "Endpoint",
+ serviceName = "EndpointService",
+ targetNamespace="http://jboss.org/jbws2934",
+ endpointInterface="org.jboss.test.ws.jaxws.jbws2934.Endpoint"
+)
+public class EndpointJSE extends AbstractEndpoint
+{
+ @WebMethod
+ public int getQueryParameter(String key)
+ {
+ return super.getQueryParameterInternal(key);
+ }
+}
Added: framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/JBWS2934EJBTestCase.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/JBWS2934EJBTestCase.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/JBWS2934EJBTestCase.java 2013-02-13 16:58:36 UTC (rev 17318)
@@ -0,0 +1,39 @@
+/*
+ * 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.jaxws.jbws2934;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2934] WebServiceContext implementation have to be ThreadLocal aware - EJB version.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class JBWS2934EJBTestCase extends AbstractTestCase
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS2934EJBTestCase.class, "jaxws-jbws2934.jar");
+ }
+}
Added: framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/JBWS2934JSETestCase.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/JBWS2934JSETestCase.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2934/JBWS2934JSETestCase.java 2013-02-13 16:58:36 UTC (rev 17318)
@@ -0,0 +1,39 @@
+/*
+ * 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.jaxws.jbws2934;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-2934] WebServiceContext implementation have to be ThreadLocal aware - JSE version.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class JBWS2934JSETestCase extends AbstractTestCase
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS2934JSETestCase.class, "jaxws-jbws2934.war");
+ }
+}
Added: framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/resources/jaxws/jbws2934/WEB-INF/web.xml
===================================================================
--- framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/resources/jaxws/jbws2934/WEB-INF/web.xml (rev 0)
+++ framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/testsuite/test/resources/jaxws/jbws2934/WEB-INF/web.xml 2013-02-13 16:58:36 UTC (rev 17318)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
+
+ <servlet>
+ <servlet-name>TestEndpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws2934.EndpointJSE</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
[View Less]
12 years, 2 months
JBossWS SVN: r17317 - stack/native/branches.
by jbossws-commits@lists.jboss.org
Author: klape
Date: 2013-02-13 11:55:28 -0500 (Wed, 13 Feb 2013)
New Revision: 17317
Added:
stack/native/branches/jbossws-native-3.1.2.SP3-patch-02_JBPAPP-10637/
Log:
Creating one-off branch
12 years, 2 months
JBossWS SVN: r17316 - framework/branches.
by jbossws-commits@lists.jboss.org
Author: klape
Date: 2013-02-13 11:48:44 -0500 (Wed, 13 Feb 2013)
New Revision: 17316
Added:
framework/branches/jbossws-framework-3.1.2.SP4_JBPAPP-10637/
Log:
Creating one-off branch
12 years, 2 months
JBossWS SVN: r17314 - projects/plugins/maven/jaxws-tools/tags.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-13 10:29:53 -0500 (Wed, 13 Feb 2013)
New Revision: 17314
Added:
projects/plugins/maven/jaxws-tools/tags/jaxws-tools-1.1.1.Final/
Log:
Tagging jaxws-tools-1.1.1.Final
12 years, 2 months
JBossWS SVN: r17312 - projects/plugins/maven/jaxws-tools/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-13 10:27:51 -0500 (Wed, 13 Feb 2013)
New Revision: 17312
Modified:
projects/plugins/maven/jaxws-tools/trunk/pom.xml
Log:
Preparing for tagging
Modified: projects/plugins/maven/jaxws-tools/trunk/pom.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/pom.xml 2013-02-13 15:22:51 UTC (rev 17311)
+++ projects/plugins/maven/jaxws-tools/trunk/pom.xml 2013-02-13 15:27:51 UTC (rev …
[View More]17312)
@@ -7,7 +7,7 @@
<artifactId>maven-jaxws-tools-plugin</artifactId>
<packaging>maven-plugin</packaging>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.1.1.Final</version>
<!-- Parent -->
<parent>
[View Less]
12 years, 2 months
JBossWS SVN: r17311 - in projects/plugins/maven/jaxws-tools/trunk/src: test/java/org/jboss/test/ws/plugins/tools/helpers and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-13 10:22:51 -0500 (Wed, 13 Feb 2013)
New Revision: 17311
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestEndorseHelper.java
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestProvidedScopeHelper.java
projects/plugins/…
[View More]maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsConsumeHelper.java
Log:
[JBWS-3295] changing default output dir for wsconsume mojo to "${project.build.directory}/generated-sources/wsconsume" to be in synch with Maven conventions
Modified: projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java 2013-02-13 14:45:18 UTC (rev 17310)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java 2013-02-13 15:22:51 UTC (rev 17311)
@@ -72,7 +72,7 @@
* Sets the source directory. This directory will contain any generated Java source.
* If the directory does not exist, it will be created.
*
- * @parameter default-value="${project.build.directory}/wsconsume/java"
+ * @parameter default-value="${project.build.directory}/generated-sources/wsconsume"
*/
protected File sourceDirectory;
Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestEndorseHelper.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestEndorseHelper.java 2013-02-13 14:45:18 UTC (rev 17310)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestEndorseHelper.java 2013-02-13 15:22:51 UTC (rev 17311)
@@ -46,7 +46,7 @@
public boolean verify(File basedir, File localRepositoryPath, Map<?, ?> context) throws Exception
{
//fist execution checks
- File endpointServiceFile = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsconsume" + File.separator + "java" +
+ File endpointServiceFile = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "generated-sources" + File.separator + "wsconsume" +
File.separator + "foo" + File.separator + "bar" + File.separator + "EndpointService.java");
if (!endpointServiceFile.exists())
{
@@ -65,7 +65,7 @@
}
//second execution checks
- File endpointServiceFile2 = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsconsume" + File.separator + "java" +
+ File endpointServiceFile2 = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "generated-sources" + File.separator + "wsconsume" +
File.separator + "foo" + File.separator + "test" + File.separator + "bar" + File.separator + "EndpointService.java");
if (!endpointServiceFile2.exists())
{
@@ -134,7 +134,7 @@
public void setup(File basedir, File localRepositoryPath, Map<?, ?> context) throws Exception
{
//first execution
- File endpointServiceFile = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsconsume" + File.separator + "java" +
+ File endpointServiceFile = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "generated-sources" + File.separator + "wsconsume" +
File.separator + "foo" + File.separator + "bar" + File.separator + "EndpointService.java");
if (endpointServiceFile.exists())
{
@@ -142,7 +142,7 @@
}
//second execution
- File endpointServiceFile2 = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsconsume" + File.separator + "java" +
+ File endpointServiceFile2 = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "generated-sources" + File.separator + "wsconsume" +
File.separator + "foo" + File.separator + "test" + File.separator + "bar" + File.separator + "EndpointService.java");
if (endpointServiceFile2.exists())
{
Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestProvidedScopeHelper.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestProvidedScopeHelper.java 2013-02-13 14:45:18 UTC (rev 17310)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestProvidedScopeHelper.java 2013-02-13 15:22:51 UTC (rev 17311)
@@ -42,7 +42,7 @@
public boolean verify(File basedir, File localRepositoryPath, Map<?, ?> context) throws Exception
{
//fist execution checks
- File endpointServiceFile = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsconsume" + File.separator + "java" +
+ File endpointServiceFile = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "generated-sources" + File.separator + "wsconsume" +
File.separator + "foo" + File.separator + "bar" + File.separator + "EndpointService.java");
if (!endpointServiceFile.exists())
{
@@ -56,7 +56,7 @@
}
//second execution checks
- File endpointServiceFile2 = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsconsume" + File.separator + "java" +
+ File endpointServiceFile2 = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "generated-sources" + File.separator + "wsconsume" +
File.separator + "foo" + File.separator + "test" + File.separator + "bar" + File.separator + "EndpointService.java");
if (!endpointServiceFile2.exists())
{
@@ -120,7 +120,7 @@
public void setup(File basedir, File localRepositoryPath, Map<?, ?> context) throws Exception
{
//first execution
- File endpointServiceFile = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsconsume" + File.separator + "java" +
+ File endpointServiceFile = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "generated-sources" + File.separator + "wsconsume" +
File.separator + "foo" + File.separator + "bar" + File.separator + "EndpointService.java");
if (endpointServiceFile.exists())
{
@@ -128,7 +128,7 @@
}
//second execution
- File endpointServiceFile2 = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsconsume" + File.separator + "java" +
+ File endpointServiceFile2 = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "generated-sources" + File.separator + "wsconsume" +
File.separator + "foo" + File.separator + "test" + File.separator + "bar" + File.separator + "EndpointService.java");
if (endpointServiceFile2.exists())
{
Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsConsumeHelper.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsConsumeHelper.java 2013-02-13 14:45:18 UTC (rev 17310)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsConsumeHelper.java 2013-02-13 15:22:51 UTC (rev 17311)
@@ -40,7 +40,7 @@
public boolean verify(File basedir, File localRepositoryPath, Map<?, ?> context) throws Exception
{
//fist execution checks
- File endpointFile = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsconsume" + File.separator + "java" +
+ File endpointFile = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "generated-sources" + File.separator + "wsconsume" +
File.separator + "foo" + File.separator + "bar" + File.separator + "Endpoint.java");
if (!endpointFile.exists())
{
@@ -87,7 +87,7 @@
@Override
public void setup(File basedir, File localRepositoryPath, Map<?, ?> context) throws Exception
{
- File endpointFile = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsconsume" + File.separator + "java" +
+ File endpointFile = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "generated-sources" + File.separator + "wsconsume" +
File.separator + "foo" + File.separator + "bar" + File.separator + "Endpoint.java");
if (endpointFile.exists())
{
[View Less]
12 years, 2 months
JBossWS SVN: r17310 - in projects/plugins/maven/jaxws-tools/trunk/src: test/java/org/jboss/test/ws/plugins/tools and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2013-02-13 09:45:18 -0500 (Wed, 13 Feb 2013)
New Revision: 17310
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/main/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint3.java
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint4.java
Modified:
projects/plugins/maven/jaxws-tools/…
[View More]trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsProvideMojo.java
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractProviderParams.java
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/ArgumentTest.java
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsprovide-plugin-config.xml
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-cxf.xml
Log:
[JBWS-3546] Applying patch from Rebecca Searls
Modified: projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsProvideMojo.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsProvideMojo.java 2013-02-13 12:04:40 UTC (rev 17309)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsProvideMojo.java 2013-02-13 14:45:18 UTC (rev 17310)
@@ -66,7 +66,15 @@
* @required
*/
private String endpointClass;
-
+
+ /**
+ * Sets the soap:address to be used for the generated port in the wsdl.
+ *
+ * @parameter
+ */
+ private String portSoapAddress;
+
+
public void execute() throws MojoExecutionException
{
Log log = getLog();
@@ -101,6 +109,7 @@
params.setSourceDirectory(sourceDirectory);
params.setFork(fork);
params.setArgLine(argLine);
+ params.setPortSoapAddress(portSoapAddress);
WSContractDelegate delegate = new WSContractDelegate(getLog());
delegate.runProvider(params);
@@ -136,4 +145,9 @@
{
return endpointClass;
}
+
+ public String getPortSoapAddress()
+ {
+ return portSoapAddress;
+ }
}
Modified: projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java 2013-02-13 12:04:40 UTC (rev 17309)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java 2013-02-13 14:45:18 UTC (rev 17310)
@@ -258,6 +258,10 @@
{
commandList.add("-e");
}
+ if(params.getPortSoapAddress() != null){
+ commandList.add("-a");
+ commandList.add(params.getPortSoapAddress());
+ }
commandList.add(params.getEndpointClass());
StringBuilder command = new StringBuilder();
for (String s : commandList)
@@ -353,6 +357,10 @@
{
callMethod(providerClass, provider, "setSourceDirectory", params.getSourceDirectory());
}
+ if (params.getPortSoapAddress() != null)
+ {
+ callMethod(providerClass, provider, "setPortSoapAddress", params.getPortSoapAddress());
+ }
}
}
Modified: projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractProviderParams.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractProviderParams.java 2013-02-13 12:04:40 UTC (rev 17309)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractProviderParams.java 2013-02-13 14:45:18 UTC (rev 17310)
@@ -37,6 +37,7 @@
private File resourceDirectory;
private File sourceDirectory;
private String argLine;
+ private String portSoapAddress;
public boolean isFork()
{
@@ -118,4 +119,13 @@
{
this.sourceDirectory = sourceDirectory;
}
+
+ public String getPortSoapAddress()
+ {
+ return portSoapAddress;
+ }
+ public void setPortSoapAddress(String portSoapAddress)
+ {
+ this.portSoapAddress = portSoapAddress;
+ }
}
Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/ArgumentTest.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/ArgumentTest.java 2013-02-13 12:04:40 UTC (rev 17309)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/ArgumentTest.java 2013-02-13 14:45:18 UTC (rev 17310)
@@ -91,6 +91,7 @@
assertThat(mojo.getClasspathElements(), hasItems(new String[] { "cp1", "cp2" }));
assertTrue(mojo.isFork());
assertEquals("-Dfoo=bar", mojo.getArgLine());
+ assertEquals("http://someHost:somePort", mojo.getPortSoapAddress());
}
}
Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsprovide-plugin-config.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsprovide-plugin-config.xml 2013-02-13 12:04:40 UTC (rev 17309)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsprovide-plugin-config.xml 2013-02-13 14:45:18 UTC (rev 17310)
@@ -15,6 +15,7 @@
<sourceDirectory>source</sourceDirectory>
<endpointClass>endpoint</endpointClass>
<extension>true</extension>
+ <portSoapAddress>http://someHost:somePort</portSoapAddress>
<verbose>true</verbose>
<fork>true</fork>
<argLine>-Dfoo=bar</argLine>
Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-cxf.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-cxf.xml 2013-02-13 12:04:40 UTC (rev 17309)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-cxf.xml 2013-02-13 14:45:18 UTC (rev 17310)
@@ -62,6 +62,29 @@
<generateWsdl>true</generateWsdl>
</configuration>
</execution>
+ <execution>
+ <id>Third execution</id>
+ <goals>
+ <goal>wsprovide</goal>
+ </goals>
+ <configuration>
+ <endpointClass>org.jboss.test.ws.plugins.tools.wsprovide.TestEndpoint3</endpointClass>
+ <generateWsdl>true</generateWsdl>
+ <fork>true</fork>
+ <portSoapAddress>http://someHost:somePort</portSoapAddress>
+ </configuration>
+ </execution>
+ <execution>
+ <id>Fourth execution</id>
+ <goals>
+ <goal>wsprovide-test</goal>
+ </goals>
+ <configuration>
+ <endpointClass>org.jboss.test.ws.plugins.tools.wsprovide.TestEndpoint4</endpointClass>
+ <generateWsdl>true</generateWsdl>
+ <portSoapAddress>http://someHost:somePort</portSoapAddress>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
Added: projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/main/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint3.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/main/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint3.java (rev 0)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/main/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint3.java 2013-02-13 14:45:18 UTC (rev 17310)
@@ -0,0 +1,40 @@
+/*
+ * 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.plugins.tools.wsprovide;
+
+import javax.jws.WebService;
+
+/**
+ * A simple test endpoint service implementation
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-Feb-2010
+ *
+ */
+@WebService
+public class TestEndpoint3
+{
+ public String test(String s)
+ {
+ return s;
+ }
+}
\ No newline at end of file
Added: projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint4.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint4.java (rev 0)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint4.java 2013-02-13 14:45:18 UTC (rev 17310)
@@ -0,0 +1,40 @@
+/*
+ * 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.plugins.tools.wsprovide;
+
+import javax.jws.WebService;
+
+/**
+ * A simple test endpoint service implementation
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 26-Feb-2010
+ *
+ */
+@WebService
+public class TestEndpoint4
+{
+ public String test(String s)
+ {
+ return s;
+ }
+}
\ No newline at end of file
[View Less]
12 years, 2 months