Package org.apache.handlers

Examples of org.apache.handlers.AddNumbers


    @Test
    public void testAddHandlerByAnnotationClientSide() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");

        AddNumbersServiceWithAnnotation service = new AddNumbersServiceWithAnnotation(wsdl, serviceName);
        AddNumbers port = (AddNumbers)service.getPort(portName, AddNumbers.class);

        int result = port.addNumbers(10, 20);
        assertEquals(200, result);
        int result1 = port.addNumbers(5, 6);
        assertEquals(11, result1);
    }
View Full Code Here


    @Test
    public void testHandlerPostConstruct() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");

        AddNumbersServiceWithAnnotation service = new AddNumbersServiceWithAnnotation(wsdl, serviceName);
        AddNumbers port = (AddNumbers)service.getPort(portName, AddNumbers.class);

        List<Handler> handlerChain = ((BindingProvider)port).getBinding().getHandlerChain();
        SmallNumberHandler h = (SmallNumberHandler)handlerChain.get(0);
       
        assertTrue(h.isPostConstructInvoked());     
View Full Code Here

        resourceManager.addResourceResolver(new TestResourceResolver());
      
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");

        AddNumbersServiceWithAnnotation service = new AddNumbersServiceWithAnnotation(wsdl, serviceName);
        AddNumbers port = (AddNumbers)service.getPort(portName, AddNumbers.class);

        List<Handler> handlerChain = ((BindingProvider)port).getBinding().getHandlerChain();
        SmallNumberHandler h = (SmallNumberHandler)handlerChain.get(0);
       
        assertEquals("injectedValue", h.getInjectedString());     
View Full Code Here

        {"classpath:/org/apache/cxf/systest/handlers/beans_no_autoRewriteSoapAddress.xml" };
    }

    @Test
    public void testWsdlAddress() throws Exception {
        AddNumbers addNumbers = (AddNumbers)getApplicationContext().getBean("cxfHandlerTestClientEndpoint",
                                                                   AddNumbers.class);

        int r = addNumbers.addNumbers(10, 15);
        assertEquals(1015, r);


        List<String> serviceUrls = findAllServiceUrlsFromWsdl("localhost", port);
        assertEquals(1, serviceUrls.size());
View Full Code Here

        return new String[] {"classpath:/org/apache/cxf/systest/handlers/beans_autoRewriteSoapAddress.xml" };
    }

    @Test
    public void testWsdlAddress() throws Exception {
        AddNumbers addNumbers = (AddNumbers)getApplicationContext().getBean("cxfHandlerTestClientEndpoint",
                                                                   AddNumbers.class);

        int r = addNumbers.addNumbers(10, 15);
        assertEquals(1015, r);


        List<String> serviceUrls = findAllServiceUrlsFromWsdl("localhost", port);
        assertEquals(1, serviceUrls.size());
View Full Code Here

    @Test
    public void testAddHandlerProgrammaticallyClientSide() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");

        AddNumbersService service = new AddNumbersService(wsdl, serviceName);
        AddNumbers port = (AddNumbers)service.getPort(portName, AddNumbers.class);
        setAddress(port, addNumbersAddress);
        SmallNumberHandler sh = new SmallNumberHandler();
        addHandlersProgrammatically((BindingProvider)port, sh);

        int result = port.addNumbers(10, 20);
        assertEquals(200, result);
        int result1 = port.addNumbers(5, 6);
        assertEquals(11, result1);
    }
View Full Code Here

    @Test
    public void testAddHandlerByAnnotationClientSide() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");

        AddNumbersServiceWithAnnotation service = new AddNumbersServiceWithAnnotation(wsdl, serviceName);
        AddNumbers port = (AddNumbers)service.getPort(portName, AddNumbers.class);
        setAddress(port, addNumbersAddress);

        int result = port.addNumbers(10, 20);
        assertEquals(200, result);
        int result1 = port.addNumbers(5, 6);
        assertEquals(11, result1);
    }
View Full Code Here

    @Test
    public void testHandlerPostConstruct() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");

        AddNumbersServiceWithAnnotation service = new AddNumbersServiceWithAnnotation(wsdl, serviceName);
        AddNumbers port = (AddNumbers)service.getPort(portName, AddNumbers.class);
        setAddress(port, addNumbersAddress);

        @SuppressWarnings("rawtypes")
        List<Handler> handlerChain = ((BindingProvider)port).getBinding().getHandlerChain();
        SmallNumberHandler h = (SmallNumberHandler)handlerChain.get(0);
View Full Code Here

        resourceManager.addResourceResolver(new TestResourceResolver());
      
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");

        AddNumbersServiceWithAnnotation service = new AddNumbersServiceWithAnnotation(wsdl, serviceName);
        AddNumbers port = (AddNumbers)service.getPort(portName, AddNumbers.class);
        setAddress(port, addNumbersAddress);

        @SuppressWarnings("rawtypes")
        List<Handler> handlerChain = ((BindingProvider)port).getBinding().getHandlerChain();
        SmallNumberHandler h = (SmallNumberHandler)handlerChain.get(0);
View Full Code Here

    @Test
    public void testAddHandlerProgrammaticallyClientSide() throws Exception {
        URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");

        AddNumbersService service = new AddNumbersService(wsdl, serviceName);
        AddNumbers port = service.getPort(portName, AddNumbers.class);
        setAddress(port, addNumbersAddress);
        SmallNumberHandler sh = new SmallNumberHandler();
        addHandlersProgrammatically((BindingProvider)port, sh);

        int result = port.addNumbers(10, 20);
        assertEquals(200, result);
        int result1 = port.addNumbers(5, 6);
        assertEquals(11, result1);
    }
View Full Code Here

TOP

Related Classes of org.apache.handlers.AddNumbers

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.