Author: heiko.braun(a)jboss.com
Date: 2006-12-05 09:46:04 -0500 (Tue, 05 Dec 2006)
New Revision: 1553
Added:
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHResponse.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java
trunk/src/test/resources/xop/
trunk/src/test/resources/xop/doclit/
trunk/src/test/resources/xop/doclit/META-INF/
trunk/src/test/resources/xop/doclit/META-INF/wsdl/
Modified:
trunk/src/test/ant/build-jars-jaxws.xml
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
Log:
added jaxws XOP test case stub
Modified: trunk/src/test/ant/build-jars-jaxws.xml
===================================================================
--- trunk/src/test/ant/build-jars-jaxws.xml 2006-12-04 19:43:49 UTC (rev 1552)
+++ trunk/src/test/ant/build-jars-jaxws.xml 2006-12-05 14:46:04 UTC (rev 1553)
@@ -447,6 +447,28 @@
<include name="wsdl/**"/>
</metainf>
</jar>
+
+ <!-- jaxws-xop-doclit -->
+ <jar jarfile="${build.tests.dir}/libs/jaxws-xop-doclit.jar">
+ <fileset dir="${build.tests.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/xop/doclit/**/*.class"/>
+ </fileset>
+ <!--metainf
dir="${build.tests.dir}/resources/jaxws/xop/doclit/META-INF">
+ <include name="wsdl/*"/>
+ <include name="jaxws-handler.xml"/>
+ </metainf-->
+ </jar>
+ <jar jarfile="${build.tests.dir}/libs/jaxws-xop-doclit-client.jar">
+ <fileset dir="${build.tests.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/xop/doclit/**/*.class"/>
+ <exclude
name="org/jboss/test/ws/jaxws/xop/doclit/**/*Bean.class"/>
+ </fileset>
+ <!--metainf
dir="${build.tests.dir}/resources/jaxws/xop/doclit/META-INF">
+ <include name="application-client.xml"/>
+ <include name="jboss-client.xml"/>
+ <include name="wsdl/**"/>
+ </metainf-->
+ </jar>
<!-- jaxws-webserviceref -->
<war warfile="${build.tests.dir}/libs/jaxws-webserviceref.war"
webxml="${build.tests.dir}/resources/jaxws/webserviceref/WEB-INF/web.xml">
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2006-12-04
19:43:49 UTC (rev 1552)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2006-12-05
14:46:04 UTC (rev 1553)
@@ -30,6 +30,8 @@
import org.jboss.ws.xop.jaxws.ReflectiveXOPScanner;
/**
+ * Test the ReflectiveXOPScanner.
+ *
* @author Heiko Braun <heiko.braun(a)jboss.com>
* @version $Id$
* @since 04.12.2006
@@ -41,7 +43,8 @@
public void testFieldAnnotation() throws Exception
{
String mimeType = SCANNER.scan(FieldAnnotation.class);
- assertNotNull("Unable to find xop declaration", mimeType);
+ assertNotNull("Unable to find xop declaration", mimeType);
+ assertEquals("text/xml", mimeType);
}
public void testMethodAnnotation() throws Exception
@@ -78,6 +81,12 @@
{
@XmlMimeType("text/xml")
public byte[] data;
+
+
+ @XmlMimeType("text/plain") // check field level precedence
+ public byte[] getData() {
+ return data;
+ }
}
class MethodAnnotation
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java 2006-12-04
19:43:49 UTC (rev 1552)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java 2006-12-05
14:46:04 UTC (rev 1553)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.xop.doclit;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlMimeType;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since 05.12.2006
+ */
+public class DHRequest {
+
+
+ public DHRequest() {
+ }
+
+ private DataHandler dataHandler;
+
+ @XmlMimeType("text/xml")
+ public DataHandler getDataHandler() {
+ return dataHandler;
+ }
+
+ public void setDataHandler(DataHandler dataHandler) {
+ this.dataHandler = dataHandler;
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHResponse.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHResponse.java 2006-12-04
19:43:49 UTC (rev 1552)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHResponse.java 2006-12-05
14:46:04 UTC (rev 1553)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.xop.doclit;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlMimeType;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since 05.12.2006
+ */
+public class DHResponse {
+
+
+ private DataHandler dataHandler;
+
+
+ public DHResponse() {
+ }
+
+ public DHResponse(DataHandler dataHandler) {
+ this.dataHandler = dataHandler;
+ }
+
+ @XmlMimeType("text/xml")
+ public DataHandler getDataHandler() {
+ return dataHandler;
+ }
+
+ public void setDataHandler(DataHandler dataHandler) {
+ this.dataHandler = dataHandler;
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java 2006-12-04
19:43:49 UTC (rev 1552)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java 2006-12-05
14:46:04 UTC (rev 1553)
@@ -0,0 +1,15 @@
+package org.jboss.test.ws.jaxws.xop.doclit;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.ejb.Remote;
+
+@Remote
+@WebService(name = "MTOMEndpoint", targetNamespace =
"http://org.jboss.ws/xop/doclit", serviceName = "MTOMService")
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+public interface MTOMEndpoint {
+
+ @WebMethod
+ public DHResponse echoDataHandler(DHRequest request);
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java 2006-12-04
19:43:49 UTC (rev 1552)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java 2006-12-05
14:46:04 UTC (rev 1553)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.xop.doclit;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.ejb.Stateless;
+
+@Stateless
+@WebService(endpointInterface =
"org.jboss.test.ws.jaxws.xop.doclit.MTOMEndpoint",
name="MTOMEndpoint")
+public class MTOMEndpointBean implements MTOMEndpoint {
+
+
+ @WebMethod
+ public DHResponse echoDataHandler(DHRequest request) {
+ System.out.println("Recv " + request.getDataHandler().getContentType());
+ return new DHResponse(
+ request.getDataHandler()
+ );
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java 2006-12-04
19:43:49 UTC (rev 1552)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java 2006-12-05
14:46:04 UTC (rev 1553)
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.xop.doclit;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import junit.framework.Test;
+
+import javax.xml.namespace.QName;
+import java.net.URL;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since 05.12.2006
+ */
+public class XOPTestCase extends JBossWSTest {
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-xop-doclit/MTOMEndpointBean";
+
+ private MTOMEndpoint mtomWS;
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(XOPTestCase.class, "jaxws-xop-doclit.jar,
jaxws-xop-doclit-client.jar");
+ }
+
+ protected void setUp() throws Exception
+ {
+
+ QName serviceName = new QName("http://org.jboss.ws/xop/doclit",
"MTOMEndpointService");
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS+"?wsdl");
+
+ javax.xml.ws.Service service = javax.xml.ws.Service.create(wsdlURL, serviceName);
+ mtomWS = service.getPort(MTOMEndpoint.class);
+ }
+
+ public void testRequestResponseOptimized() throws Exception
+ {
+
+ }
+}
\ No newline at end of file