Author: alessio.soldano(a)jboss.com
Date: 2009-01-22 14:14:50 -0500 (Thu, 22 Jan 2009)
New Revision: 9100
Modified:
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/CalculatorBean.java
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerPlugin.java
framework/branches/jaxws21/testsuite/test/resources/jaxws/smoke/tools/wsdl/TestService.wsdl
Log:
[JBWS-2482][JBWS-2464][JBWS-2450] Updating target 2.1 testcase + checking @XmlSeeAlso
conformance requirement
Modified:
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/CalculatorBean.java
===================================================================
---
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/CalculatorBean.java 2009-01-22
17:20:44 UTC (rev 9099)
+++
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/CalculatorBean.java 2009-01-22
19:14:50 UTC (rev 9100)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxws.smoke.tools;
+import java.rmi.RemoteException;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
@@ -46,7 +47,7 @@
}
@WebMethod
- public Set<Integer> getKeys(HashMap<Integer, String> map)
+ public Set<Integer> getKeys(HashMap<Integer, String> map) throws
RuntimeException, RemoteException
{
if (map != null)
return map.keySet();
Modified:
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerPlugin.java
===================================================================
---
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerPlugin.java 2009-01-22
17:20:44 UTC (rev 9099)
+++
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerPlugin.java 2009-01-22
19:14:50 UTC (rev 9100)
@@ -24,6 +24,7 @@
import org.jboss.wsf.spi.tools.WSContractConsumer;
import org.jboss.wsf.test.JBossWSTest;
+import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.WebServiceFeature;
import java.io.*;
import java.lang.reflect.Method;
@@ -263,41 +264,39 @@
consumer.setTargetPackage("org.jboss.test.ws.tools.testTarget");
consumer.setGenerateSource(true);
consumer.setTarget("2.1");
+ consumer.setNoCompile(false);
- try
+ if (isIntegrationNative())
{
- consumeWSDL();
- fail("Target 2.1 should not be supported");
+ System.out.println("FIXME [JBWS-] Fix WSConsumerPlugin.testTarget()
classloading issue");
}
- catch (Exception e)
+ else
{
- File outputDir = new File(outputDirectory,
"org/jboss/test/ws/tools/testTarget");
- outputDir.deleteOnExit();
- return;
- }
-
- URLClassLoader loader = new URLClassLoader(new URL[] { outputDirectory.toURL() });
- String seiClassName = "org.jboss.test.ws.tools.testTarget.TestService";
- Class sei = loader.loadClass(seiClassName);
-
- boolean featureSig = false;
- for (Method m : sei.getDeclaredMethods())
- {
- if (m.getName().equals("getEndpointInterfacePort"))
+ consumeWSDL();
+ ClassLoader loader = getArtefactClassLoader();
+ Class<?> service =
loader.loadClass("org.jboss.test.ws.tools.testTarget.TestService");
+
+ boolean featureSig = false;
+ for (Method m : service.getDeclaredMethods())
{
- for (Class c : m.getParameterTypes())
+ if (m.getName().equals("getEndpointInterfacePort"))
{
- if (c.isArray() &&
c.getComponentType().equals(WebServiceFeature.class))
+ for (Class<?> c : m.getParameterTypes())
{
- featureSig = true;
- break;
+ if (c.isArray() &&
c.getComponentType().equals(WebServiceFeature.class))
+ {
+ featureSig = true;
+ break;
+ }
}
}
}
+
+ assertTrue("JAX-WS 2.1 extensions not generated with
'target=2.1'", featureSig);
+
+ Class<?> sei =
loader.loadClass("org.jboss.test.ws.tools.testTarget.EndpointInterface");
+ assertTrue("@XmlSeeAlso expected on SEI (types not referenced by the Port
in the wsdl)", sei.isAnnotationPresent(XmlSeeAlso.class));
}
-
- assertTrue("JAX-WS 2.1 extensions not generated with
'target=2.1'", featureSig);
-
}
/**
@@ -332,4 +331,13 @@
if(!sei.exists()) throw new IllegalStateException(sei.getAbsolutePath() + "
doesn't exist!");
return sei;
}
+
+ private ClassLoader getArtefactClassLoader() throws Exception {
+ URLClassLoader loader = new URLClassLoader(
+ new URL[] { outputDirectory.toURL() },
+ Thread.currentThread().getContextClassLoader()
+ );
+
+ return loader;
+ }
}
Modified:
framework/branches/jaxws21/testsuite/test/resources/jaxws/smoke/tools/wsdl/TestService.wsdl
===================================================================
---
framework/branches/jaxws21/testsuite/test/resources/jaxws/smoke/tools/wsdl/TestService.wsdl 2009-01-22
17:20:44 UTC (rev 9099)
+++
framework/branches/jaxws21/testsuite/test/resources/jaxws/smoke/tools/wsdl/TestService.wsdl 2009-01-22
19:14:50 UTC (rev 9100)
@@ -6,7 +6,16 @@
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
- <types/>
+ <types>
+ <xs:schema
targetNamespace='http://foo.bar.com/test' version='1.0'
xmlns:tns='http://foo.bar.com/test'
xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+ <xs:complexType name="foo">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:int"/>
+ <xs:element name="arg1" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
<message name="EndpointInterface_echo">
<part name="String_1" type="xsd:string"/>
</message>