public class WrapperBeanFieldAnnotatorTest extends Assert {
@Test
public void testAnnotate() {
JavaClass clz = new JavaClass();
clz.setFullClassName("org.apache.cxf.tools.fortest.withannotation.doc.jaxws.SayHi");
JavaField reqField = new JavaField("array",
"String[]",
"http://doc.withannotation.fortest.tools.cxf.apache.org/");
reqField.setOwner(clz);
List<JAnnotation> annotation = reqField.getAnnotations();
assertEquals(0, annotation.size());
reqField.annotate(new WrapperBeanFieldAnnotator());
annotation = reqField.getAnnotations();
String expectedNamespace = "http://doc.withannotation.fortest.tools.cxf.apache.org/";
assertEquals("@XmlElement(name = \"array\", namespace = \"" + expectedNamespace + "\")",
annotation.get(0).toString());
clz.setFullClassName("org.apache.cxf.tools.fortest.withannotation.doc.jaxws.SayHiResponse");
JavaField resField = new JavaField("return",
"String[]",
"http://doc.withannotation.fortest.tools.cxf.apache.org/");
resField.setOwner(clz);
resField.annotate(new WrapperBeanFieldAnnotator());