Author: richard.opalka(a)jboss.com
Date: 2010-09-02 08:59:13 -0400 (Thu, 02 Sep 2010)
New Revision: 12886
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/EjbInWarWebInfLib/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/EjbInWarWebInfLib/JBWS2957TestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/common/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/common/HelloIface.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/common/HelloImpl.java
framework/trunk/testsuite/test/resources/jaxws/jbws2957/
framework/trunk/testsuite/test/resources/jaxws/jbws2957/WEB-INF/
framework/trunk/testsuite/test/resources/jaxws/jbws2957/WEB-INF/ejb-jar.xml
framework/trunk/testsuite/test/resources/jaxws/jbws2957/WEB-INF/wsdl/
framework/trunk/testsuite/test/resources/jaxws/jbws2957/WEB-INF/wsdl/HelloService.wsdl
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-2957] providing EJB3 webservice in war test case + URL pattern fix to include WSDL
service name in request path
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java 2010-09-02
11:21:45 UTC (rev 12885)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java 2010-09-02
12:59:13 UTC (rev 12886)
@@ -123,6 +123,11 @@
String fullClassName = beanClass.getName();
urlPattern =
fullClassName.substring(fullClassName.lastIndexOf('.') + 1);
}
+ if (!"".equals(webServiceAnnotation.serviceName()))
+ {
+ urlPattern = webServiceAnnotation.serviceName() + "/" +
urlPattern;
+ }
+
}
}
Modified: framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2010-09-02 11:21:45 UTC
(rev 12885)
+++ framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2010-09-02 12:59:13 UTC
(rev 12886)
@@ -891,6 +891,29 @@
</webinf>
</war>
+ <!-- jaxws-jbws2957 -->
+ <jar
destfile="${tests.output.dir}/test-libs/jaxws-jbws2957-ejbinwarwebinflib_ejb.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2957/common/*.class" />
+ </fileset>
+ </jar>
+
+ <war
warfile="${tests.output.dir}/test-libs/jaxws-jbws2957-ejbinwarwebinflib_web.war"
needxmlfile="false">
+ <lib dir="${tests.output.dir}/test-libs/">
+ <include name="jaxws-jbws2957-ejbinwarwebinflib_ejb.jar"/>
+ </lib>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/jbws2957/WEB-INF">
+ <include name="wsdl/**" />
+ <include name="ejb-jar.xml"/>
+ </webinf>
+ </war>
+
+ <jar
jarfile="${tests.output.dir}/test-libs/jaxws-jbws2957-ejbinwarwebinflib.ear">
+ <fileset dir="${tests.output.dir}/test-libs">
+ <include name="jaxws-jbws2957-ejbinwarwebinflib_web.war"/>
+ </fileset>
+ </jar>
+
<!-- jaxws-jbws2985 -->
<war warfile="${tests.output.dir}/test-libs/jaxws-jbws2985.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws2985/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/EjbInWarWebInfLib/JBWS2957TestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/EjbInWarWebInfLib/JBWS2957TestCase.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/EjbInWarWebInfLib/JBWS2957TestCase.java 2010-09-02
12:59:13 UTC (rev 12886)
@@ -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.jbws2957;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+import org.jboss.test.ws.jaxws.jbws2957.common.HelloIface;
+
+/**
+ * [JBWS-2957] Tests EJB3 service in web inf lib directory.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public class JBWS2957TestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS2957TestCase.class,
"jaxws-jbws2957-ejbinwarwebinflib.ear");
+ }
+
+ public void testEJB() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-jbws2957-ejbinwarwebinflib_web/Service/HelloImpl?wsdl");
+ QName serviceName = new
QName("http://www.jboss.org/test/ws/jaxws/jbws2957", "Service");
+ Service.create(wsdlURL, serviceName);
+ Service service = Service.create(wsdlURL, serviceName);
+ HelloIface port = (HelloIface)service.getPort(HelloIface.class);
+ assertEquals("Hello", port.sayHello());
+ }
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/common/HelloIface.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/common/HelloIface.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/common/HelloIface.java 2010-09-02
12:59:13 UTC (rev 12886)
@@ -0,0 +1,35 @@
+/*
+ * 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.jbws2957.common;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@WebService(targetNamespace = "http://www.jboss.org/test/ws/jaxws/jbws2957")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface HelloIface
+{
+ String sayHello();
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/common/HelloImpl.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/common/HelloImpl.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2957/common/HelloImpl.java 2010-09-02
12:59:13 UTC (rev 12886)
@@ -0,0 +1,45 @@
+/*
+ * 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.jbws2957.common;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.jboss.wsf.spi.annotation.WebContext;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@Stateless
+@WebService(
+ endpointInterface = "org.jboss.test.ws.jaxws.jbws2957.common.HelloIface",
+ targetNamespace = "http://www.jboss.org/test/ws/jaxws/jbws2957",
+ wsdlLocation="WEB-INF/wsdl/HelloService.wsdl",
+ serviceName = "Service"
+)
+public class HelloImpl implements HelloIface
+{
+ public String sayHello()
+ {
+ return "Hello";
+ }
+}
Added: framework/trunk/testsuite/test/resources/jaxws/jbws2957/WEB-INF/ejb-jar.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws2957/WEB-INF/ejb-jar.xml
(rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws2957/WEB-INF/ejb-jar.xml 2010-09-02
12:59:13 UTC (rev 12886)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar version="3.1"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd">
+ <display-name>JBWS2957</display-name>
+ <enterprise-beans>
+ <session>
+ <display-name>JBWS2957Test</display-name>
+ <ejb-name>JBWS2957Test</ejb-name>
+
<business-remote>org.jboss.test.ws.jaxws.jbws2957.common.HelloIface</business-remote>
+
<ejb-class>org.jboss.test.ws.jaxws.jbws2957.common.HelloImpl</ejb-class>
+ <session-type>Stateless</session-type>
+ <transaction-type>Container</transaction-type>
+ <security-identity>
+ <description></description>
+ <use-caller-identity></use-caller-identity>
+ </security-identity>
+ </session>
+ </enterprise-beans>
+
+ <assembly-descriptor>
+ <container-transaction>
+ <method>
+ <ejb-name>JBWS2957Test</ejb-name>
+ <method-name>sayHello</method-name>
+ </method>
+ <trans-attribute>Supports</trans-attribute>
+ </container-transaction>
+ </assembly-descriptor>
+</ejb-jar>
Added:
framework/trunk/testsuite/test/resources/jaxws/jbws2957/WEB-INF/wsdl/HelloService.wsdl
===================================================================
---
framework/trunk/testsuite/test/resources/jaxws/jbws2957/WEB-INF/wsdl/HelloService.wsdl
(rev 0)
+++
framework/trunk/testsuite/test/resources/jaxws/jbws2957/WEB-INF/wsdl/HelloService.wsdl 2010-09-02
12:59:13 UTC (rev 12886)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="Service"
targetNamespace="http://www.jboss.org/test/ws/jaxws/jbws2957"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.jboss.org/test/ws/jaxws/jbws2957"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <types/>
+ <message name="HelloIface_sayHello"/>
+ <message name="HelloIface_sayHelloResponse">
+ <part name="return" type="xsd:string"/>
+ </message>
+ <portType name="HelloIface">
+ <operation name="sayHello">
+ <input message="tns:HelloIface_sayHello"/>
+ <output message="tns:HelloIface_sayHelloResponse"/>
+ </operation>
+ </portType>
+ <binding name="HelloIfaceBinding" type="tns:HelloIface">
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
namespace="http://www.jboss.org/test/ws/jaxws/jbws2957"
use="literal"/>
+ </input>
+ <output>
+ <soap:body
namespace="http://www.jboss.org/test/ws/jaxws/jbws2957"
use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="Service">
+ <port binding="tns:HelloIfaceBinding" name="HelloImplPort">
+ <soap:address location="http://localhost:8080/foo/bar"/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file