}
public void testServerClass()
throws Exception
{
MockControl control = MockControl.createControl(WebAnnotations.class);
WebAnnotations webAnnotations = (WebAnnotations) control.getMock();
WebServiceAnnotation serviceAnnotation = new WebServiceAnnotation();
webAnnotations.getWebServiceAnnotation(Echo.class);
control.setDefaultReturnValue(serviceAnnotation);
webAnnotations.hasWebServiceAnnotation(Echo.class);
control.setDefaultReturnValue(true);
webAnnotations.hasWebServiceAnnotation(EchoImpl.class);
control.setDefaultReturnValue(true);
webAnnotations.hasHandlerChainAnnotation(EchoImpl.class);
control.setReturnValue(false);
webAnnotations.hasSOAPBindingAnnotation(Echo.class);
control.setReturnValue(false);
webAnnotations.hasWebServiceAnnotation(EchoImpl.class);
control.setReturnValue(true);
serviceAnnotation = new WebServiceAnnotation();
serviceAnnotation.setServiceName("Echo");
serviceAnnotation.setTargetNamespace("urn:Echo");
serviceAnnotation.setEndpointInterface(Echo.class.getName());
webAnnotations.getWebServiceAnnotation(EchoImpl.class);
control.setReturnValue(serviceAnnotation);
webAnnotations.getWebServiceAnnotation(EchoImpl.class);
control.setReturnValue(serviceAnnotation);
Method echoMethod = EchoImpl.class.getMethod("echo", new Class[]{String.class});
webAnnotations.hasWebMethodAnnotation(echoMethod);
control.setDefaultReturnValue(true);
webAnnotations.hasWebMethodAnnotation(echoMethod);
control.setDefaultReturnValue(false);
webAnnotations.hasWebParamAnnotation(echoMethod, 0);
control.setDefaultReturnValue(false);
webAnnotations.hasWebResultAnnotation(echoMethod);
control.setDefaultReturnValue(false);
webAnnotations.hasOnewayAnnotation(echoMethod);
control.setDefaultReturnValue(false);
webAnnotations.getServiceProperties(EchoImpl.class);
control.setDefaultReturnValue(new Properties());
webAnnotations.getInHandlers(EchoImpl.class);
control.setDefaultReturnValue(Collections.EMPTY_LIST);
webAnnotations.getOutHandlers(EchoImpl.class);
control.setDefaultReturnValue(Collections.EMPTY_LIST);
webAnnotations.getFaultHandlers(EchoImpl.class);
control.setDefaultReturnValue(Collections.EMPTY_LIST);
control.replay();
factory.setServiceFactory(new AnnotationServiceFactory(webAnnotations,
getTransportManager()));
factory.setServiceClass(EchoImpl.class);
factory.afterPropertiesSet();
control.verify();
}