Author: alessio.soldano(a)jboss.com
Date: 2011-11-10 06:38:50 -0500 (Thu, 10 Nov 2011)
New Revision: 15230
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointTwoImpl.java
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointOne.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointOneEJB3Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointOneImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/MixedTypeTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/mixtype/WEB-INF/web.xml
Log:
[JBWS-3363] Properly deal with multiple endpoints in the same deployement extending each
other
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2011-11-09
16:14:04 UTC (rev 15229)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2011-11-10
11:38:50 UTC (rev 15230)
@@ -58,7 +58,6 @@
private UnifiedVirtualFile deploymentRoot;
- @SuppressWarnings("unchecked")
@Override
public void customize(Object beanInstance)
{
@@ -78,7 +77,7 @@
{
for (Endpoint depEndpoint : depEndpoints)
{
- if
(depEndpoint.getTargetBeanClass().isAssignableFrom(factory.getServiceBean().getClass()))
+ if
(depEndpoint.getTargetBeanClass().getName().equals(factory.getServiceBean().getClass().getName()))
{
depEndpoint.addAttachment(ServerFactoryBean.class, factory);
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointOne.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointOne.java 2011-11-09
16:14:04 UTC (rev 15229)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointOne.java 2011-11-10
11:38:50 UTC (rev 15230)
@@ -25,7 +25,7 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-@WebService(name = "EndpointOne", targetNamespace =
"http://org.jboss.ws.jaxws.cxf/mixtype", serviceName = "ServiceOne")
+@WebService(targetNamespace = "http://org.jboss.ws.jaxws.cxf/mixtype")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface EndpointOne
{
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointOneEJB3Impl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointOneEJB3Impl.java 2011-11-09
16:14:04 UTC (rev 15229)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointOneEJB3Impl.java 2011-11-10
11:38:50 UTC (rev 15230)
@@ -29,10 +29,10 @@
import org.jboss.logging.Logger;
-@WebService(name = "EJBEndpointOne", targetNamespace =
"http://org.jboss.ws.jaxws.cxf/mixtype", serviceName =
"EJBServiceOne")
+@WebService(targetNamespace = "http://org.jboss.ws.jaxws.cxf/mixtype",
serviceName = "EJBServiceOne", portName ="EJBEndpointOnePort",
endpointInterface = "org.jboss.test.ws.jaxws.cxf.mixtype.EndpointOne")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@Stateless
-public class EndpointOneEJB3Impl
+public class EndpointOneEJB3Impl implements EndpointOne
{
private volatile static int count = 0;
@@ -40,7 +40,7 @@
public String echo(String input)
{
Logger.getLogger(this.getClass()).info("echo: " + input);
- count++;
+ count = count + 5;
return input;
}
@@ -49,7 +49,7 @@
public void echoOneWay(String input)
{
Logger.getLogger(this.getClass()).info("echoOneWay: " + input);
- count++;
+ count = count + 5;
}
@WebMethod
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointOneImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointOneImpl.java 2011-11-09
16:14:04 UTC (rev 15229)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointOneImpl.java 2011-11-10
11:38:50 UTC (rev 15230)
@@ -29,9 +29,9 @@
import org.jboss.logging.Logger;
-@WebService(name = "EndpointOne", targetNamespace =
"http://org.jboss.ws.jaxws.cxf/mixtype", serviceName = "ServiceOne")
+@WebService(targetNamespace = "http://org.jboss.ws.jaxws.cxf/mixtype",
serviceName = "ServiceOne", portName ="EndpointOnePort",
endpointInterface = "org.jboss.test.ws.jaxws.cxf.mixtype.EndpointOne")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-public class EndpointOneImpl
+public class EndpointOneImpl implements EndpointOne
{
private volatile static int count = 0;
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointTwoImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointTwoImpl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/EndpointTwoImpl.java 2011-11-10
11:38:50 UTC (rev 15230)
@@ -0,0 +1,57 @@
+/*
+ * 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.cxf.mixtype;
+
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+
+@WebService(targetNamespace = "http://org.jboss.ws.jaxws.cxf/mixtype",
serviceName = "ServiceOne", portName ="EndpointTwoPort",
endpointInterface = "org.jboss.test.ws.jaxws.cxf.mixtype.EndpointOne")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class EndpointTwoImpl extends EndpointOneImpl
+{
+ @WebMethod
+ public String echo(String input)
+ {
+ Logger.getLogger(this.getClass()).info("echo: " + input);
+ return super.echo(input);
+ }
+
+ @WebMethod
+ @Oneway
+ public void echoOneWay(String input)
+ {
+ Logger.getLogger(this.getClass()).info("echoOneWay: " + input);
+ super.echoOneWay(input);
+ }
+
+ @WebMethod
+ public int getCount()
+ {
+ return super.getCount();
+ }
+}
+
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/MixedTypeTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/MixedTypeTestCase.java 2011-11-09
16:14:04 UTC (rev 15229)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/mixtype/MixedTypeTestCase.java 2011-11-10
11:38:50 UTC (rev 15230)
@@ -22,7 +22,6 @@
package org.jboss.test.ws.jaxws.cxf.mixtype;
import java.net.URL;
-import java.util.Iterator;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
@@ -35,7 +34,8 @@
public class MixedTypeTestCase extends JBossWSTest
{
private final String endpointURL = "http://" + getServerHost() +
":8080/mixtype/ServiceOne/EndpointOne";
- private final String ejbEndpointURL = "http://" + getServerHost() +
":8080/mixtype/EJBServiceOne/EJBEndpointOne";
+ private final String endpoint2URL = "http://" + getServerHost() +
":8080/mixtype/ServiceOne/EndpointTwo";
+ private final String ejbEndpointURL = "http://" + getServerHost() +
":8080/mixtype/EJBServiceOne/EndpointOneEJB3Impl";
private String targetNS = "http://org.jboss.ws.jaxws.cxf/mixtype";
@@ -46,24 +46,36 @@
public void testEndpoint() throws Exception
{
-
URL wsdlOneURL = new URL(endpointURL + "?wsdl");
QName serviceOneName = new QName(targetNS, "ServiceOne");
- Service serviceOne = Service.create(wsdlOneURL, serviceOneName);
- EndpointOne endpoint = (EndpointOne)serviceOne.getPort(new QName(targetNS,
"EndpointOnePort"), EndpointOne.class);
+ Service service = Service.create(wsdlOneURL, serviceOneName);
+ EndpointOne endpoint = (EndpointOne)service.getPort(new QName(targetNS,
"EndpointOnePort"), EndpointOne.class);
+ int initialCount = endpoint.getCount();
assertEquals("mixedType", endpoint.echo("mixedType"));
- assertEquals(1, endpoint.getCount());
+ assertEquals(1, endpoint.getCount() - initialCount);
}
public void testEJBEndpoint() throws Exception
{
URL wsdlOneURL = new URL(ejbEndpointURL + "?wsdl");
QName serviceOneName = new QName(targetNS, "EJBServiceOne");
- Service serviceOne = Service.create(wsdlOneURL, serviceOneName);
- EndpointOne endpoint = (EndpointOne)serviceOne.getPort(new QName(targetNS,
"EJBEndpointOnePort"), EndpointOne.class);
+ Service service = Service.create(wsdlOneURL, serviceOneName);
+ EndpointOne endpoint = (EndpointOne)service.getPort(new QName(targetNS,
"EJBEndpointOnePort"), EndpointOne.class);
+ int initialCount = endpoint.getCount();
assertEquals("mixedType", endpoint.echo("mixedType"));
- assertEquals(1, endpoint.getCount());
+ assertEquals(5, endpoint.getCount() - initialCount);
}
+ public void testEndpoint2() throws Exception
+ {
+ //verify everything works with an endpoint extending another one impl
+ URL wsdlOneURL = new URL(endpoint2URL + "?wsdl");
+ QName serviceOneName = new QName(targetNS, "ServiceOne");
+ Service service = Service.create(wsdlOneURL, serviceOneName);
+ EndpointOne endpoint = (EndpointOne)service.getPort(new QName(targetNS,
"EndpointTwoPort"), EndpointOne.class);
+ int initialCount = endpoint.getCount();
+ assertEquals("mixedType", endpoint.echo("mixedType"));
+ assertEquals(1, endpoint.getCount() - initialCount);
+ }
}
\ No newline at end of file
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/mixtype/WEB-INF/web.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/mixtype/WEB-INF/web.xml 2011-11-09
16:14:04 UTC (rev 15229)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/mixtype/WEB-INF/web.xml 2011-11-10
11:38:50 UTC (rev 15230)
@@ -7,8 +7,16 @@
<servlet-name>Ep1Servlet</servlet-name>
<servlet-class>org.jboss.test.ws.jaxws.cxf.mixtype.EndpointOneImpl</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>Ep2Servlet</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.cxf.mixtype.EndpointTwoImpl</servlet-class>
+ </servlet>
<servlet-mapping>
<servlet-name>Ep1Servlet</servlet-name>
<url-pattern>/ServiceOne/EndpointOne</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Ep2Servlet</servlet-name>
+ <url-pattern>/ServiceOne/EndpointTwo</url-pattern>
+ </servlet-mapping>
</web-app>