Search in sources :

Example 26 with JAnnotation

use of org.apache.cxf.tools.common.model.JAnnotation in project cxf by apache.

the class WebParamAnnotatorTest method testAnnotateDOCWrapped.

@Test
public void testAnnotateDOCWrapped() throws Exception {
    init(method, parameter, SOAPBinding.Style.DOCUMENT, true);
    parameter.annotate(new WebParamAnnotator());
    JAnnotation annotation = parameter.getAnnotation("WebParam");
    assertEquals("@WebParam(name = \"x\", targetNamespace = \"http://apache.org/cxf\")", annotation.toString());
    List<JAnnotationElement> elements = annotation.getElements();
    assertEquals(2, elements.size());
    assertEquals("http://apache.org/cxf", elements.get(1).getValue());
    assertEquals("x", elements.get(0).getValue());
}
Also used : JAnnotation(org.apache.cxf.tools.common.model.JAnnotation) JAnnotationElement(org.apache.cxf.tools.common.model.JAnnotationElement) Test(org.junit.Test)

Example 27 with JAnnotation

use of org.apache.cxf.tools.common.model.JAnnotation in project cxf by apache.

the class WebParamAnnotatorTest method testAnnotateRPC.

@Test
public void testAnnotateRPC() throws Exception {
    init(method, parameter, SOAPBinding.Style.RPC, true);
    parameter.annotate(new WebParamAnnotator());
    JAnnotation annotation = parameter.getAnnotation("WebParam");
    assertEquals(2, annotation.getElements().size());
    assertEquals("@WebParam(partName = \"y\", name = \"y\")", annotation.toString());
}
Also used : JAnnotation(org.apache.cxf.tools.common.model.JAnnotation) Test(org.junit.Test)

Aggregations

JAnnotation (org.apache.cxf.tools.common.model.JAnnotation)27 JAnnotationElement (org.apache.cxf.tools.common.model.JAnnotationElement)20 JavaMethod (org.apache.cxf.tools.common.model.JavaMethod)14 Test (org.junit.Test)7 JavaInterface (org.apache.cxf.tools.common.model.JavaInterface)6 JavaParameter (org.apache.cxf.tools.common.model.JavaParameter)5 ArrayList (java.util.ArrayList)4 QName (javax.xml.namespace.QName)3 Message (org.apache.cxf.common.i18n.Message)3 JavaField (org.apache.cxf.tools.common.model.JavaField)3 XmlList (javax.xml.bind.annotation.XmlList)2 XmlJavaTypeAdapter (javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter)2 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)2 JavaModel (org.apache.cxf.tools.common.model.JavaModel)2 JavaReturn (org.apache.cxf.tools.common.model.JavaReturn)2 WrapperBeanClass (org.apache.cxf.tools.java2wsdl.generator.wsdl11.model.WrapperBeanClass)2 WebMethodAnnotator (org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.WebMethodAnnotator)2 Annotation (java.lang.annotation.Annotation)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1