Author: jim.ma
Date: 2010-09-15 06:31:19 -0400 (Wed, 15 Sep 2010)
New Revision: 12972
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/Endpoint.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointImpl.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointService.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/JBWS3114TestCase.java
framework/trunk/testsuite/test/resources/jaxws/jbws3114/
framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/
framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/jboss-web.xml
framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/web.xml
Modified:
framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-3114]:Added the testcase for stack agnostic timeout configuration
Modified: framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2010-09-14 17:11:02 UTC
(rev 12971)
+++ framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2010-09-15 10:31:19 UTC
(rev 12972)
@@ -745,13 +745,13 @@
</metainf>
</jar>
- <!-- jaxws-jbws2486 -->
- <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2486.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws2486/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/test-classes">
- <include name="org/jboss/test/ws/jaxws/jbws2486/*.class"/>
- <exclude
name="org/jboss/test/ws/jaxws/jbws2486/*TestCase.class"/>
- </classes>
- </war>
+ <!-- jaxws-jbws2486 -->
+ <war
warfile="${tests.output.dir}/test-libs/jaxws-jbws2486.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws2486/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws2486/*.class"/>
+ <exclude
name="org/jboss/test/ws/jaxws/jbws2486/*TestCase.class"/>
+ </classes>
+ </war>
<!-- jbws2527 -->
<war warfile="${tests.output.dir}/test-libs/jaxws-jbws2527-client.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws2527/WEB-INF-client/web.xml">
@@ -1021,6 +1021,17 @@
</webinf>
</war>
+ <!-- jaxws-jbws3114 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws3114.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws3114/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws3114/Endpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws3114/EndpointImpl.class"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/jbws3114/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
+
<!-- jaxws-jbws3123 -->
<jar destfile="${tests.output.dir}/test-libs/jaxws-jbws3123-ejb.jar">
<fileset dir="${tests.output.dir}/test-classes">
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/Endpoint.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/Endpoint.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/Endpoint.java 2010-09-15
10:31:19 UTC (rev 12972)
@@ -0,0 +1,30 @@
+/*
+ * 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.jbws3114;
+import javax.jws.WebService;
+@WebService(name = "Endpoint", targetNamespace =
"http://ws.jboss.org/jbws3114")
+public interface Endpoint
+{
+
+ public String echo(final String message);
+
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointImpl.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointImpl.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointImpl.java 2010-09-15
10:31:19 UTC (rev 12972)
@@ -0,0 +1,43 @@
+/*
+ * 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.jbws3114;
+
+import javax.jws.WebService;
+
+@WebService(name = "Endpoint", portName = "EndpointPort",
serviceName="EndpointService", targetNamespace =
"http://ws.jboss.org/jbws3114", endpointInterface =
"org.jboss.test.ws.jaxws.jbws3114.Endpoint")
+public class EndpointImpl implements Endpoint
+{
+ public String echo(final String message)
+ {
+ try
+ {
+ //To cause the receive timeout
+ Thread.sleep(3);
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ }
+ return message;
+ }
+
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointService.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointService.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/EndpointService.java 2010-09-15
10:31:19 UTC (rev 12972)
@@ -0,0 +1,87 @@
+/*
+ * 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.jbws3114;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceException;
+
+@WebServiceClient(name = "EndpointService", targetNamespace =
"http://ws.jboss.org/jbws3114")
+public class EndpointService
+ extends Service
+{
+
+ private final static URL ENDPOINTSERVICE_WSDL_LOCATION;
+ private final static WebServiceException ENDPOINTSERVICE_EXCEPTION;
+ private final static QName ENDPOINTSERVICE_QNAME = new
QName("http://ws.jboss.org/jbws3114", "EndpointService");
+
+ static {
+ URL url = null;
+ WebServiceException e = null;
+ try {
+ url = new URL("http://localhost:8080/jaxws-jbws3114?wsdl");
+ } catch (MalformedURLException ex) {
+ e = new WebServiceException(ex);
+ }
+ ENDPOINTSERVICE_WSDL_LOCATION = url;
+ ENDPOINTSERVICE_EXCEPTION = e;
+ }
+
+ public EndpointService() {
+ super(__getWsdlLocation(), ENDPOINTSERVICE_QNAME);
+ }
+
+
+ public EndpointService(URL wsdlLocation) {
+ super(wsdlLocation, ENDPOINTSERVICE_QNAME);
+ }
+
+
+ public EndpointService(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ /**
+ *
+ * @return
+ * returns Endpoint
+ */
+ @WebEndpoint(name = "EndpointPort")
+ public Endpoint getEndpointPort() {
+ return super.getPort(new
QName("http://ws.jboss.org/jbws3114",
"EndpointPort"), Endpoint.class);
+ }
+
+
+ private static URL __getWsdlLocation() {
+ if (ENDPOINTSERVICE_EXCEPTION!= null) {
+ throw ENDPOINTSERVICE_EXCEPTION;
+ }
+ return ENDPOINTSERVICE_WSDL_LOCATION;
+ }
+
+}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/JBWS3114TestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/JBWS3114TestCase.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3114/JBWS3114TestCase.java 2010-09-15
10:31:19 UTC (rev 12972)
@@ -0,0 +1,73 @@
+/*
+ * 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.jbws3114;
+
+import java.net.URL;
+
+import javax.xml.ws.BindingProvider;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+/**
+ *
https://jira.jboss.org/browse/JBWS-3114
+ * @author ema(a)redhat.com
+ */
+public class JBWS3114TestCase extends JBossWSTest
+{
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-jbws3114";
+
+ private static Endpoint port;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS3114TestCase.class,
"jaxws-jbws3114.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ EndpointService service = new EndpointService(wsdlURL);
+ port = service.getEndpointPort();
+ }
+
+ public void testConfigureTimeout() throws Exception
+ {
+ String response = port.echo("testjbws3114");
+ assertEquals("testjbws3114", response);
+ ((BindingProvider)
port).getRequestContext().put("javax.xml.ws.client.connectionTimeout",
"6000");
+ ((BindingProvider)
port).getRequestContext().put("javax.xml.ws.client.receiveTimeout",
"1");
+ try
+ {
+ port.echo("testjbws3114");
+ fail("Timeout exeception is expected");
+ }
+ catch (Exception e)
+ {
+ //expected
+ }
+
+ }
+}
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/jboss-web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/jboss-web.xml
(rev 0)
+++
framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/jboss-web.xml 2010-09-15
10:31:19 UTC (rev 12972)
@@ -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-jbws3114</context-root>
+</jboss-web>
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/web.xml
(rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws3114/WEB-INF/web.xml 2010-09-15
10:31:19 UTC (rev 12972)
@@ -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>Endpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws3114.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file