Author: richard.opalka(a)jboss.com
Date: 2010-05-11 09:53:14 -0400 (Tue, 11 May 2010)
New Revision: 12203
Added:
framework/trunk/testsuite/test/resources/jaxws/jbws2960/
framework/trunk/testsuite/test/resources/jaxws/jbws2960/WEB-INF/
framework/trunk/testsuite/test/resources/jaxws/jbws2960/WEB-INF/jboss-web.xml
framework/trunk/testsuite/test/resources/jaxws/jbws2960/WEB-INF/web.xml
Modified:
framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2960/JBWS2960TestCase.java
Log:
[JBWS-2960] endorsing workaround - refactoring test. Since now the endpoint is published
and WSDL is generated on service deploy, thus no need to run command line tools from Java
-> Maven -> ANT
Modified: framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2010-05-11 09:54:40 UTC
(rev 12202)
+++ framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2010-05-11 13:53:14 UTC
(rev 12203)
@@ -883,6 +883,18 @@
</webinf>
</war>
+ <!-- jaxws-jbws2960 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2960.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws2960/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws2960/AddNumbersImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws2960/AddNumbersException.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws2960/TooBigNumbersException.class"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/jbws2960/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
+
<!-- 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">
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2960/JBWS2960TestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2960/JBWS2960TestCase.java 2010-05-11
09:54:40 UTC (rev 12202)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws2960/JBWS2960TestCase.java 2010-05-11
13:53:14 UTC (rev 12203)
@@ -21,7 +21,7 @@
*/
package org.jboss.test.ws.jaxws.jbws2960;
-import java.io.File;
+import java.net.URL;
import java.util.List;
import javax.wsdl.Definition;
@@ -34,10 +34,11 @@
import javax.xml.namespace.QName;
import junit.framework.Assert;
+import junit.framework.Test;
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestSetup;
import org.w3c.dom.Element;
/**
@@ -51,12 +52,17 @@
private static final QName WSAM_ADDRESSING_QNAME = new
QName("http://www.w3.org/2007/05/addressing/metadata", "Addressing");
private static final QName POLICY_QNAME = new
QName("http://www.w3.org/ns/ws-policy", "Policy");
private static final QName POLICY_REFERENCE_QNAME = new
QName("http://www.w3.org/ns/ws-policy", "PolicyReference");
- private final File wsdlFile =
JBossWSTestHelper.getResourceFile("jaxws/jbws2960/AddNumbersService.wsdl");
+ private URL wsdlFile;
- public void setUp()
+ public static Test suite()
{
+ return new JBossWSTestSetup(JBWS2960TestCase.class,
"jaxws-jbws2960.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ wsdlFile = new URL("http://" + getServerHost() +
":8080/jaxws-jbws2960/Endpoint?wsdl");
assertNotNull("WSDL not found", wsdlFile);
- assertTrue("WSDL doesn't exist", wsdlFile.exists());
}
/*
@@ -83,7 +89,7 @@
@SuppressWarnings("unchecked")
public void testPolicyReference() throws Exception
{
- Definition wsdl = getWSDLDefinition(wsdlFile.getAbsolutePath());
+ Definition wsdl = getWSDLDefinition(wsdlFile);
List definitionExtElements = wsdl.getExtensibilityElements();
QName serviceQName = new
QName("http://foobar.org/",
"AddNumbersService");
Port wsdlPort = wsdl.getService(serviceQName).getPort("AddNumbersPort");
@@ -102,7 +108,7 @@
public void testOperations() throws Exception
{
- Definition wsdl = getWSDLDefinition(wsdlFile.getAbsolutePath());
+ Definition wsdl = getWSDLDefinition(wsdlFile);
PortType port = wsdl.getPortType(new
QName("http://foobar.org/",
"AddNumbers"));
Operation operation = null;
@@ -223,12 +229,12 @@
Assert.assertEquals("Wrong WSAM attr. value", expectedValue,
wsamValue.getLocalPart());
}
- private Definition getWSDLDefinition(final String wsdlLocation) throws Exception
+ private Definition getWSDLDefinition(final URL wsdlLocation) throws Exception
{
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
- return wsdlReader.readWSDL(null, wsdlLocation);
+ return wsdlReader.readWSDL(null, wsdlLocation.toURI().toString());
}
@SuppressWarnings("unchecked")
Added: framework/trunk/testsuite/test/resources/jaxws/jbws2960/WEB-INF/jboss-web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws2960/WEB-INF/jboss-web.xml
(rev 0)
+++
framework/trunk/testsuite/test/resources/jaxws/jbws2960/WEB-INF/jboss-web.xml 2010-05-11
13:53:14 UTC (rev 12203)
@@ -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-jbws2960</context-root>
+</jboss-web>
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/jbws2960/WEB-INF/web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws2960/WEB-INF/web.xml
(rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws2960/WEB-INF/web.xml 2010-05-11
13:53:14 UTC (rev 12203)
@@ -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.jbws2960.AddNumbersImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file