Author: darran.lofthouse(a)jboss.com
Date: 2010-12-13 08:06:35 -0500 (Mon, 13 Dec 2010)
New Revision: 13470
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
Log:
[JBPAPP-5486] Timeout value gets inserted into URLs.
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml 2010-12-13
12:55:12 UTC (rev 13469)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/ant-import-tests/build-jars-jaxws.xml 2010-12-13
13:06:35 UTC (rev 13470)
@@ -142,6 +142,17 @@
</webinf>
</war>
+ <!-- jaxws-jbpapp5486 -->
+ <war warfile="${tests.output.dir}/libs/jaxws-jbpapp5486.war"
webxml="${tests.output.dir}/resources/jaxws/jbpapp5486/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/jbpapp5486/*.class" />
+ <exclude name="org/jboss/test/ws/jaxws/jbpapp5486/*TestCase.class"
/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/resources/jaxws/jbpapp5486/WEB-INF">
+ <include name="jboss-web.xml" />
+ </webinf>
+ </war>
+
<!-- jaxws-jbpapp5576 -->
<jar destfile="${tests.output.dir}/libs/jaxws-jbpapp5576.jar">
<metainf
dir="${tests.output.dir}/resources/jaxws/jbpapp5576/META-INF">
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2010-12-13
12:55:12 UTC (rev 13469)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2010-12-13
13:06:35 UTC (rev 13470)
@@ -153,7 +153,7 @@
if (callProps.containsKey(StubExt.PROPERTY_CLIENT_TIMEOUT))
{
timeout = callProps.get(StubExt.PROPERTY_CLIENT_TIMEOUT);
- targetAddress = addURLParameter(targetAddress, "timeout",
timeout.toString());
+ clientConfig.put("timeout", timeout.toString());
}
}
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java 2010-12-13
13:06:35 UTC (rev 13470)
@@ -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.jaxws.jbpapp5486;
+
+import javax.jws.WebService;
+
+/**
+ * Test Endpoint.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 13th December 2010
+ */
+@WebService(name = "Endpoint", targetNamespace =
"http://ws.jboss.org/jbpap5486")
+public interface Endpoint
+{
+
+ public String verifyNoTimeoutParameter(final String message);
+
+ public String doSleep(final String message, final long timeout);
+
+}
Property changes on:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/Endpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java 2010-12-13
13:06:35 UTC (rev 13470)
@@ -0,0 +1,81 @@
+/*
+ * 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.jbpapp5486;
+
+import java.util.Map;
+
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * Test Endpoint implementation.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 13th December 2010
+ */
+@WebService(name = "Endpoint", targetNamespace =
"http://ws.jboss.org/jbpapp5486", endpointInterface =
"org.jboss.test.ws.jaxws.jbpapp5486.Endpoint")
+public class EndpointImpl implements Endpoint
+{
+
+ @Resource
+ private WebServiceContext context;
+
+ public String verifyNoTimeoutParameter(final String message)
+ {
+ if (getTimeout() != null)
+ {
+ throw new IllegalStateException("timeout parameter recieved.");
+ }
+
+ return message;
+ }
+
+ public String doSleep(final String message, final long timeout)
+ {
+ try
+ {
+ Thread.sleep(timeout);
+ }
+ catch (InterruptedException e)
+ {
+ throw new RuntimeException("We were interrupted!!", e);
+ }
+
+ return message;
+ }
+
+ private String getTimeout()
+ {
+ HttpServletRequest request =
(HttpServletRequest)context.getMessageContext().get(MessageContext.SERVLET_REQUEST);
+ String timeout = request.getParameter("timeout");
+
+ return timeout;
+ }
+
+
+
+
+
+}
Property changes on:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/EndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java 2010-12-13
13:06:35 UTC (rev 13470)
@@ -0,0 +1,106 @@
+/*
+ * 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.jbpapp5486;
+
+import java.io.File;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
+
+import junit.framework.Test;
+
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.core.WSTimeoutException;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBPAPP-5486] Timeout value gets inserted into URLs
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 13th December 2010
+ * @see
https://jira.jboss.org/browse/JBPAPP-5486
+ */
+public class JBPAPP5486TestCase extends JBossWSTest
+{
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBPAPP5486TestCase.class,
"jaxws-jbpapp5486.war");
+ }
+
+ public void testNoTimeout() throws Exception
+ {
+ Service service = getService();
+ Endpoint port = service.getPort(Endpoint.class);
+
+ String message = "Hello 1";
+ String response = port.verifyNoTimeoutParameter(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testTimeout() throws Exception
+ {
+ Service service = getService();
+ Endpoint port = service.getPort(Endpoint.class);
+
+ ((BindingProvider)port).getRequestContext().put(StubExt.PROPERTY_CLIENT_TIMEOUT,
"10000");
+
+ String message = "Hello 2";
+ String response = port.verifyNoTimeoutParameter(message);
+ assertEquals("Response Message", message, response);
+ }
+
+ public void testTimeoutWorks() throws Exception
+ {
+ Service service = getService();
+ Endpoint port = service.getPort(Endpoint.class);
+
+ ((BindingProvider)port).getRequestContext().put(StubExt.PROPERTY_CLIENT_TIMEOUT,
"500");
+
+ String message = "Hello 3";
+ try
+ {
+ port.doSleep(message, 1000);
+ fail("Expected WS exception not thrown.");
+ }
+ catch (WebServiceException ignored)
+ {
+ assertEquals("Expected Cause", WSTimeoutException.class.getName(),
ignored.getCause().getClass().getName());
+ }
+
+ }
+
+ Service getService() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-jbpapp5486?wsdl");
+ QName serviceName = new
QName("http://ws.jboss.org/jbpapp5486",
"EndpointImplService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+
+ return service;
+ }
+
+}
Property changes on:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/java/org/jboss/test/ws/jaxws/jbpapp5486/JBPAPP5486TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml 2010-12-13
13:06:35 UTC (rev 13470)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <context-root>/jaxws-jbpapp5486</context-root>
+</jboss-web>
\ No newline at end of file
Property changes on:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml
===================================================================
---
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml
(rev 0)
+++
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml 2010-12-13
13:06:35 UTC (rev 13470)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4"
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">
+
+ <servlet>
+ <servlet-name>TestEndpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbpapp5486.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Property changes on:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/src/test/resources/jaxws/jbpapp5486/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF