Package org.apache.cxf.service.factory

Examples of org.apache.cxf.service.factory.HelloService


    @Test
    public void testClientServer() {
        ctx =
            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/frontend/spring/rountrip.xml"});
       
        HelloService greeter = (HelloService) ctx.getBean("client");
        assertNotNull(greeter);
       
        String result = greeter.sayHello();
        assertEquals("We get the wrong sayHello result", result, "hello");
       
       
        Client c = ClientProxy.getClient(greeter);
        TestInterceptor out = new TestInterceptor();
        TestInterceptor in = new TestInterceptor();
        c.getRequestContext().put(Message.OUT_INTERCEPTORS, Arrays.asList(new Interceptor[] {out}));
        result = greeter.sayHello();
        assertTrue(out.wasCalled());
        out.reset();

        c.getRequestContext().put(Message.IN_INTERCEPTORS, Arrays.asList(new Interceptor[] {in}));
        result = greeter.sayHello();
        assertTrue(out.wasCalled());
        assertTrue(in.wasCalled());
        ctx.close();
        BusFactory.setDefaultBus(null);
    }
View Full Code Here


        BindingConfiguration bc = cpfbean.getBindingConfig();
        assertTrue(bc instanceof SoapBindingConfiguration);
        SoapBindingConfiguration sbc = (SoapBindingConfiguration) bc;
        assertTrue(sbc.getVersion() instanceof Soap12);

        HelloService greeter = (HelloService) ctx.getBean("client1");
        assertNotNull(greeter);

        Client client = ClientProxy.getClient(greeter);
        assertNotNull("expected ConduitSelector", client.getConduitSelector());
        assertTrue("unexpected ConduitSelector",
View Full Code Here

    @Test
    public void testClientServer() {
        ctx =
            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/frontend/spring/rountrip.xml"});
       
        HelloService greeter = (HelloService) ctx.getBean("client");
        assertNotNull(greeter);
       
        String result = greeter.sayHello();
        assertEquals("We get the wrong sayHello result", "hello", result);
       
       
        Client c = ClientProxy.getClient(greeter);
        TestInterceptor out = new TestInterceptor();
        TestInterceptor in = new TestInterceptor();
        c.getRequestContext().put(Message.OUT_INTERCEPTORS, Arrays.asList(new Interceptor[] {out}));
        result = greeter.sayHello();
        assertTrue(out.wasCalled());
        out.reset();

        c.getRequestContext().put(Message.IN_INTERCEPTORS, Arrays.asList(new Interceptor[] {in}));
        result = greeter.sayHello();
        assertTrue(out.wasCalled());
        assertTrue(in.wasCalled());
        ctx.close();
        BusFactory.setDefaultBus(null);
    }
View Full Code Here

        BindingConfiguration bc = cpfbean.getBindingConfig();
        assertTrue(bc instanceof SoapBindingConfiguration);
        SoapBindingConfiguration sbc = (SoapBindingConfiguration) bc;
        assertTrue(sbc.getVersion() instanceof Soap12);

        HelloService greeter = (HelloService) ctx.getBean("client1");
        assertNotNull(greeter);

        Client client = ClientProxy.getClient(greeter);
        assertNotNull("expected ConduitSelector", client.getConduitSelector());
        assertTrue("unexpected ConduitSelector",
View Full Code Here

        BindingConfiguration bc = cpfbean.getBindingConfig();
        assertTrue(bc instanceof SoapBindingConfiguration);
        SoapBindingConfiguration sbc = (SoapBindingConfiguration) bc;
        assertTrue(sbc.getVersion() instanceof Soap12);

        HelloService greeter = (HelloService) ctx.getBean("client1");
        assertNotNull(greeter);

        Client client = ClientProxy.getClient(greeter);
        assertNotNull("expected ConduitSelector", client.getConduitSelector());
        assertTrue("unexpected ConduitSelector",
View Full Code Here

    public void testClientServer() {
        BusFactory.setDefaultBus(null);
        ClassPathXmlApplicationContext ctx =
            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/frontend/spring/rountrip.xml"});
       
        HelloService greeter = (HelloService) ctx.getBean("client");
        assertNotNull(greeter);
       
        String result = greeter.sayHello();
        assertEquals("We get the wrong sayHello result", result, "hello");
       
       
        Client c = ClientProxy.getClient(greeter);
        TestInterceptor out = new TestInterceptor();
        TestInterceptor in = new TestInterceptor();
        c.getRequestContext().put(Message.OUT_INTERCEPTORS, Arrays.asList(new Interceptor[] {out}));
        result = greeter.sayHello();
        assertTrue(out.wasCalled());
        out.reset();

        c.getRequestContext().put(Message.IN_INTERCEPTORS, Arrays.asList(new Interceptor[] {in}));
        result = greeter.sayHello();
        assertTrue(out.wasCalled());
        assertTrue(in.wasCalled());
    }
View Full Code Here

        BindingConfiguration bc = cpfbean.getBindingConfig();
        assertTrue(bc instanceof SoapBindingConfiguration);
        SoapBindingConfiguration sbc = (SoapBindingConfiguration) bc;
        assertTrue(sbc.getVersion() instanceof Soap12);

        HelloService greeter = (HelloService) ctx.getBean("client1");
        assertNotNull(greeter);

        Client client = ClientProxy.getClient(greeter);
        assertNotNull("expected ConduitSelector", client.getConduitSelector());
        assertTrue("unexpected ConduitSelector",
View Full Code Here

        BindingConfiguration bc = cpfbean.getBindingConfig();
        assertTrue(bc instanceof SoapBindingConfiguration);
        SoapBindingConfiguration sbc = (SoapBindingConfiguration) bc;
        assertTrue(sbc.getVersion() instanceof Soap12);
       
        HelloService greeter = (HelloService) ctx.getBean("client1");
        assertNotNull(greeter);
       
        Client client = ClientProxy.getClient(greeter);
        assertNotNull("expected ConduitSelector", client.getConduitSelector());
        assertTrue("unexpected ConduitSelector",
View Full Code Here

        BindingConfiguration bc = cpfbean.getBindingConfig();
        assertTrue(bc instanceof SoapBindingConfiguration);
        SoapBindingConfiguration sbc = (SoapBindingConfiguration) bc;
        assertTrue(sbc.getVersion() instanceof Soap12);
       
        HelloService greeter = (HelloService) ctx.getBean("client1");
        assertNotNull(greeter);
       
        Client client = ClientProxy.getClient(greeter);
        assertNotNull("expected ConduitSelector", client.getConduitSelector());
        assertTrue("unexpected ConduitSelector",
View Full Code Here

    public void testClientServer() {
        BusFactory.setDefaultBus(null);
        ClassPathXmlApplicationContext ctx =
            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/frontend/spring/rountrip.xml"});
       
        HelloService greeter = (HelloService) ctx.getBean("client");
        assertNotNull(greeter);
       
        String result = greeter.sayHello();
        assertEquals("We get the wrong sayHello result", result, "hello");
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.service.factory.HelloService

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.