Author: alessio.soldano(a)jboss.com
Date: 2009-01-21 08:05:55 -0500 (Wed, 21 Jan 2009)
New Revision: 9078
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/WSProviderPlugin.java
Log:
[JBWS-2451] Adding testcase for @XmlList
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-21
13:05:23 UTC (rev 9077)
+++
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/CalculatorBean.java 2009-01-21
13:05:55 UTC (rev 9078)
@@ -22,10 +22,12 @@
package org.jboss.test.ws.jaxws.smoke.tools;
import java.util.HashMap;
+import java.util.List;
import java.util.Set;
import javax.jws.WebMethod;
import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlList;
@WebService(targetNamespace = "http://foo.bar.com/calculator")
public class CalculatorBean
@@ -50,4 +52,11 @@
else
return null;
}
+
+ @WebMethod
+ @XmlList
+ public List<String> processList(@XmlList List<String> list)
+ {
+ return list;
+ }
}
Modified:
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderPlugin.java
===================================================================
---
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderPlugin.java 2009-01-21
13:05:23 UTC (rev 9077)
+++
framework/branches/jaxws21/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderPlugin.java 2009-01-21
13:05:55 UTC (rev 9078)
@@ -26,6 +26,7 @@
import org.jboss.wsf.test.JBossWSTest;
import org.w3c.dom.Element;
+import javax.xml.bind.annotation.XmlList;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.BufferedReader;
@@ -107,10 +108,23 @@
javaSource = new File(directory.getAbsolutePath() + FS + "org" + FS +
"jboss" + FS + "test" + FS + "ws" + FS + "jaxws" +
FS + "smoke" + FS + "tools" + FS
+ "jaxws" + FS + "GetKeysResponse.java");
+ assertTrue("Source not generated", javaSource.exists());
+ String contents = readFile(javaSource);
+ //[JBWS-2477] check support for generics
+ assertTrue("Didn't found method \"public Set<Integer>
getReturn()\"", contents.contains("public Set<Integer>
getReturn()"));
+ javaSource = new File(directory.getAbsolutePath() + FS + "org" + FS +
"jboss" + FS + "test" + FS + "ws" + FS + "jaxws" +
FS + "smoke" + FS + "tools" + FS
+ + "jaxws" + FS + "ProcessListResponse.java");
assertTrue("Source not generated", javaSource.exists());
+ contents = readFile(javaSource);
+ //[JBWS-2451] check support for @XmlList
+ assertTrue("Didn't found @XmlList",
contents.contains("@XmlList"));
- BufferedReader input = new BufferedReader(new FileReader(javaSource));
+ }
+
+ private String readFile(File file) throws Exception
+ {
+ BufferedReader input = new BufferedReader(new FileReader(file));
StringBuilder sb = new StringBuilder();
try
{
@@ -125,9 +139,7 @@
{
input.close();
}
-
- //[JBWS-2477] check support for generics
- assertTrue("Didn't found method \"public Set<Integer>
getReturn()\"", sb.toString().contains("public Set<Integer>
getReturn()"));
+ return sb.toString();
}
/**
@@ -138,10 +150,13 @@
{
provide();
ClassLoader loader = getArtefactClassLoader();
- Class responseWrapper =
loader.loadClass("org.jboss.test.ws.jaxws.smoke.tools.jaxws.AddResponse");
+ Class<?> responseWrapper =
loader.loadClass("org.jboss.test.ws.jaxws.smoke.tools.jaxws.AddResponse");
XmlRootElement rootElement = (XmlRootElement)
responseWrapper.getAnnotation(XmlRootElement.class);
assertNotNull("@XmlRootElement missing form response wrapper",
rootElement);
assertEquals("Wrong namespace", rootElement.namespace(),
"http://foo.bar.com/calculator");
+ responseWrapper =
loader.loadClass("org.jboss.test.ws.jaxws.smoke.tools.jaxws.ProcessListResponse");
+ XmlList xmlList = (XmlList)
responseWrapper.getDeclaredField("_return").getAnnotation(XmlList.class);
+ assertNotNull("@XmlList missing form response wrapper's _return
field", xmlList);
}
/**
Show replies by date