use of org.apache.cxf.tools.common.model.JavaMethod in project cxf by apache.
the class WebMethodAnnotatorTest method testAddWebResultAnnotation.
@Test
public void testAddWebResultAnnotation() throws Exception {
JavaMethod method = new JavaMethod();
method.annotate(new WebResultAnnotator());
Map<String, JAnnotation> annotations = method.getAnnotationMap();
assertNotNull(annotations);
assertEquals(1, annotations.size());
assertEquals("WebResult", annotations.keySet().iterator().next());
JAnnotation resultAnnotation = annotations.get("WebResult");
assertEquals("@WebResult(name = \"return\")", resultAnnotation.toString());
List<JAnnotationElement> elements = resultAnnotation.getElements();
assertNotNull(elements);
assertEquals(1, elements.size());
assertEquals("name", elements.get(0).getName());
assertEquals("return", elements.get(0).getValue());
}
use of org.apache.cxf.tools.common.model.JavaMethod in project cxf by apache.
the class WebMethodAnnotatorTest method testAddWebMethodAnnotation.
@Test
public void testAddWebMethodAnnotation() throws Exception {
JavaMethod method = new JavaMethod();
method.setName("echoFoo");
method.setOperationName("echoFoo");
method.annotate(new WebMethodAnnotator());
Map<String, JAnnotation> annotations = method.getAnnotationMap();
assertNotNull(annotations);
assertEquals(1, annotations.size());
assertEquals("WebMethod", annotations.keySet().iterator().next());
}
use of org.apache.cxf.tools.common.model.JavaMethod in project cxf by apache.
the class WebParamAnnotatorTest method setUp.
@Before
public void setUp() {
method = new JavaMethod();
parameter = new JavaParameter();
parameter.setMethod(method);
}
use of org.apache.cxf.tools.common.model.JavaMethod in project cxf by apache.
the class MethodMapperTest method testMap.
@Test
public void testMap() throws Exception {
JavaMethod method = new MethodMapper().map(getOperation());
assertNotNull(method);
assertEquals(javax.jws.soap.SOAPBinding.Style.DOCUMENT, method.getSoapStyle());
assertEquals("operationTest", method.getName());
assertEquals("OperationTest", method.getOperationName());
assertEquals(OperationType.REQUEST_RESPONSE, method.getStyle());
assertFalse(method.isWrapperStyle());
assertFalse(method.isOneWay());
}
use of org.apache.cxf.tools.common.model.JavaMethod in project cxf by apache.
the class MethodMapperTest method testMapOneWayOperation.
@Test
public void testMapOneWayOperation() throws Exception {
OperationInfo operation = getOperation();
MessageInfo inputMessage = operation.createMessage(new QName("urn:test:ns", "testInputMessage"), MessageInfo.Type.INPUT);
operation.setInput("input", inputMessage);
JavaMethod method = new MethodMapper().map(operation);
assertNotNull(method);
assertTrue(method.isOneWay());
}
Aggregations