Author: darran.lofthouse(a)jboss.com
Date: 2009-06-17 13:03:51 -0400 (Wed, 17 Jun 2009)
New Revision: 10201
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/Endpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/EndpointImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/JBWS2682TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2682/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2682/WEB-INF/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2682/WEB-INF/web.xml
Modified:
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
Log:
[JBWS-2682] Incorrect Parsing of Badly Formed int - Test Case.
Modified: stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-06-17
06:20:01 UTC (rev 10200)
+++
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2009-06-17
17:03:51 UTC (rev 10201)
@@ -552,6 +552,14 @@
</metainf>
</jar>
+ <!-- jaxws-jbws2682 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2682.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws2682/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws2682/Endpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws2682/EndpointImpl.class"/>
+ </classes>
+ </war>
+
<!-- jaxws-webserviceref -->
<war warfile="${tests.output.dir}/test-libs/jaxws-webserviceref.war"
webxml="${tests.output.dir}/test-resources/jaxws/webserviceref/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/Endpoint.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/Endpoint.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/Endpoint.java 2009-06-17
17:03:51 UTC (rev 10201)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2682;
+
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 16th June 2009
+ */
+@WebService(name = "Endpoint", targetNamespace =
"http://ws.jboss.org/jbws2682")
+public interface Endpoint
+{
+
+ public int echo(final int value);
+
+}
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/Endpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/EndpointImpl.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/EndpointImpl.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/EndpointImpl.java 2009-06-17
17:03:51 UTC (rev 10201)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2682;
+
+import org.jboss.logging.Logger;
+
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint implementation.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 16th June 2009
+ */
+@WebService(name = "Endpoint", targetNamespace =
"http://ws.jboss.org/jbws2682", endpointInterface =
"org.jboss.test.ws.jaxws.jbws2682.Endpoint")
+public class EndpointImpl implements Endpoint
+{
+
+ private static final Logger log = Logger.getLogger(EndpointImpl.class);
+
+ public int echo(final int value)
+ {
+ log.debug("echoing '" + value + "'");
+ return value;
+ }
+
+}
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/EndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/JBWS2682TestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/JBWS2682TestCase.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/JBWS2682TestCase.java 2009-06-17
17:03:51 UTC (rev 10201)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.jbws2682;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.soap.SOAPMessage;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * JBWS2682 Test Case
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 16th June 2009
+ * @see
https://jira.jboss.org/jira/browse/JBWS-2682
+ */
+public class JBWS2682TestCase extends JBossWSTest
+{
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-jbws2682/TestEndpoint";
+
+ private String badMsgString =
+ "<soapenv:Envelope
xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:jbw='http://ws.jboss.org/jbws2682'>" +
+ " <soapenv:Header/>" + " <soapenv:Body>" +
+ " <jbw:echo>" +
+ " <arg0>1-1</arg0>" +
+ " </jbw:echo>" +
+ " </soapenv:Body>" +
+ "</soapenv:Envelope>";
+
+ private String goodMsgString =
+ "<soapenv:Envelope
xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:jbw='http://ws.jboss.org/jbws2682'>" +
+ " <soapenv:Header/>" +
+ " <soapenv:Body>" +
+ " <jbw:echo>" +
+ " <arg0>646</arg0>" +
+ " </jbw:echo>" +
+ " </soapenv:Body>" +
+ "</soapenv:Envelope>";
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS2682TestCase.class,
"jaxws-jbws2682.war");
+ }
+
+ public void testGoodMessage() throws Exception
+ {
+ SOAPMessage response = sendMessage(this.goodMsgString);
+ SOAPEnvelope resEnv = response.getSOAPPart().getEnvelope();
+ SOAPBody resBody = resEnv.getBody();
+
+ Iterator it = resBody.getChildElements(new
QName("http://ws.jboss.org/jbws2682", "echoResponse"));
+ SOAPElement echoResponse = (SOAPElement)it.next();
+ it = echoResponse.getChildElements(new QName("return"));
+ SOAPElement returnElement = (SOAPElement)it.next();
+
+ String value = returnElement.getValue();
+ assertEquals("Expected return value", "646",
returnElement.getValue());
+ }
+
+ public void testBadMessage() throws Exception
+ {
+ if (true)
+ {
+ System.out.println("FIXME [JBWS-2682] Incorrect Parsing of Badly Formed
int.");
+ return;
+ }
+
+ SOAPMessage response = sendMessage(this.badMsgString);
+ SOAPEnvelope resEnv = response.getSOAPPart().getEnvelope();
+ SOAPFault fault = resEnv.getBody().getFault();
+ assertNotNull("Expected fault to be raised", fault);
+ }
+
+ private SOAPMessage sendMessage(final String message) throws SOAPException,
IOException
+ {
+ MessageFactory msgFactory = MessageFactory.newInstance();
+ SOAPMessage reqMsg = msgFactory.createMessage(null, new
ByteArrayInputStream(message.getBytes()));
+
+ SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
+ SOAPMessage resMsg = con.call(reqMsg, TARGET_ENDPOINT_ADDRESS);
+
+ return resMsg;
+ }
+
+}
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2682/JBWS2682TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2682/WEB-INF/web.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2682/WEB-INF/web.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2682/WEB-INF/web.xml 2009-06-17
17:03:51 UTC (rev 10201)
@@ -0,0 +1,18 @@
+<?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.jbws2682.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpoint</servlet-name>
+ <url-pattern>/TestEndpoint</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2682/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF