Package org.codehaus.xfire.annotations

Examples of org.codehaus.xfire.annotations.WebAnnotations


   
    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,
View Full Code Here


    public void testInterface()
        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.hasSOAPBindingAnnotation(Echo.class);
        control.setReturnValue(false);
       
        serviceAnnotation = new WebServiceAnnotation();
        serviceAnnotation.setServiceName("Echo");
        serviceAnnotation.setTargetNamespace("urn:Echo");
        webAnnotations.getWebServiceAnnotation(Echo.class);
        control.setDefaultReturnValue(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(Echo.class);
        control.setDefaultReturnValue(new Properties());
        webAnnotations.hasHandlerChainAnnotation(Echo.class);
        control.setDefaultReturnValue(false);
        webAnnotations.getInHandlers(Echo.class);
        control.setDefaultReturnValue(Collections.EMPTY_LIST);
        webAnnotations.getOutHandlers(Echo.class);
        control.setDefaultReturnValue(Collections.EMPTY_LIST);
        webAnnotations.getFaultHandlers(Echo.class);
        control.setDefaultReturnValue(Collections.EMPTY_LIST);
        control.replay();
       
        factory.setServiceFactory(new AnnotationServiceFactory(webAnnotations,
                                                               getTransportManager()));
View Full Code Here

        // jsr181 is synonymous to java5
        if (annotations != null && AN_JSR181.equals(annotations)) {
            annotations = AN_JAVA5;
        }
        // Determine annotations
        WebAnnotations wa = null;
        String selectedAnnotations = null;
        if (annotations != null) {
            selectedAnnotations = annotations;
            if (!annotations.equals(AN_NONE)) {
                wa = (WebAnnotations) KNOWN_ANNOTATIONS.get(annotations);
                if (wa == null) {
                    throw new Exception("Unrecognized annotations: " + annotations);
                }
            }
        } else {
            for (Iterator it = KNOWN_ANNOTATIONS.entrySet().iterator(); it.hasNext();) {
                Map.Entry entry = (Map.Entry) it.next();
                WebAnnotations w = (WebAnnotations) entry.getValue();
                if (w.hasWebServiceAnnotation(serviceClass)) {
                    selectedAnnotations = (String) entry.getKey();
                    wa = w;
                    break;
                }
            }
View Full Code Here

        // jsr181 is synonymous to java5
        if (annotations != null && AN_JSR181.equals(annotations)) {
            annotations = AN_JAVA5;
        }
        // Determine annotations
        WebAnnotations wa = null;
        String selectedAnnotations = null;
        if (annotations != null) {
            selectedAnnotations = annotations;
            if (!annotations.equals(AN_NONE)) {
                wa = (WebAnnotations) knownAnnotations.get(annotations);
                if (wa == null) {
                    throw new Exception("Unrecognized annotations: " + annotations);
                }
            }
        } else {
            for (Iterator it = knownAnnotations.entrySet().iterator(); it.hasNext();) {
                Map.Entry entry = (Map.Entry) it.next();
                WebAnnotations w = (WebAnnotations) entry.getValue();
                if (w.hasWebServiceAnnotation(serviceClass)) {
                    selectedAnnotations = (String) entry.getKey();
                    wa = w;
                    break;
                }
            }
View Full Code Here

        // jsr181 is synonymous to java5
        if (annotations != null && AN_JSR181.equals(annotations)) {
            annotations = AN_JAVA5;
        }
        // Determine annotations
        WebAnnotations wa = null;
        String selectedAnnotations = null;
        if (annotations != null) {
            selectedAnnotations = annotations;
            if (!annotations.equals(AN_NONE)) {
                wa = (WebAnnotations) knownAnnotations.get(annotations);
                if (wa == null) {
                    throw new Exception("Unrecognized annotations: " + annotations);
                }
            }
        } else {
            for (Iterator it = knownAnnotations.entrySet().iterator(); it.hasNext();) {
                Map.Entry entry = (Map.Entry) it.next();
                WebAnnotations w = (WebAnnotations) entry.getValue();
                if (w.hasWebServiceAnnotation(serviceClass)) {
                    selectedAnnotations = (String) entry.getKey();
                    wa = w;
                    break;
                }
            }
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.annotations.WebAnnotations

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.