Examples of AddNumbersPortType


Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

    @Test
    public void testAddNumbers() throws Exception {
        ByteArrayOutputStream input = setupInLogging();
        ByteArrayOutputStream output = setupOutLogging();

        AddNumbersPortType port = getPort();

        assertEquals(3, port.addNumbers(1, 2));

        String expectedOut = BASE_URI + "addNumbersRequest";
        String expectedIn = BASE_URI + "addNumbersResponse";
       
        assertTrue(output.toString().indexOf(expectedOut) != -1);
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

    @Test
    public void testAddNumbers2() throws Exception {
        ByteArrayOutputStream input = setupInLogging();
        ByteArrayOutputStream output = setupOutLogging();

        AddNumbersPortType port = getPort();

        assertEquals(3, port.addNumbers2(1, 2));

        String expectedOut = BASE_URI + "add2In";
        String expectedIn = BASE_URI + "add2Out";

        assertTrue(output.toString().indexOf(expectedOut) != -1);
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

    @Test
    public void testAddNumbers3() throws Exception {
        ByteArrayOutputStream input = setupInLogging();
        ByteArrayOutputStream output = setupOutLogging();

        AddNumbersPortType port = getPort();

        assertEquals(3, port.addNumbers3(1, 2));

        String expectedOut = "3in";
        String expectedIn = "3out";

        assertTrue(output.toString().indexOf(expectedOut) != -1);
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

    @Test
    public void testAddNumbersFault() throws Exception {
        ByteArrayOutputStream input = setupInLogging();
        ByteArrayOutputStream output = setupOutLogging();

        AddNumbersPortType port = getPort();

        try {
            port.addNumbers(-1, 2);
        } catch (AddNumbersFault_Exception ex) {
            assert true;
        } catch (Exception e) {
            e.printStackTrace();
            assert false;
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

    @Test
    public void testAddNumbersFault3() throws Exception {
        ByteArrayOutputStream input = setupInLogging();
        ByteArrayOutputStream output = setupOutLogging();

        AddNumbersPortType port = getPort();

        try {
            port.addNumbers3(-1, 2);
        } catch (AddNumbersFault_Exception ex) {
            assert true;
        } catch (Exception e) {
            e.printStackTrace();
            assert false;
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

        assertTrue(input.toString().indexOf(expectedIn) != -1);
    }
   
    @Test
    public void testAnonToNonAnon() throws Exception {
        AddNumbersPortType port = getPort();
        ((BindingProvider)port).getRequestContext()
            .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                 "http://localhost:" + PORT + "/jaxws/addNonAnon");
        try {
            port.addNumbers3(-1, 2);
        } catch (SOAPFaultException e) {
            assertTrue(e.getFault().getFaultCode().contains("OnlyNonAnonymousAddressSupported"));
        }
    }
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

            assertTrue(e.getFault().getFaultCode().contains("OnlyNonAnonymousAddressSupported"));
        }
    }
    @Test
    public void testNonAnonToAnon() throws Exception {
        AddNumbersPortType port = getPort();
        ((BindingProvider)port).getRequestContext()
            .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                 "http://localhost:" + PORT + "/jaxws/addAnon");
       
        AddressingPropertiesImpl maps = new AddressingPropertiesImpl();
        EndpointReferenceType ref = new EndpointReferenceType();
        AttributedURIType add = new AttributedURIType();
        add.setValue("http://localhost:" + INVALID_PORT + "/not/a/real/url");
        ref.setAddress(add);
        maps.setReplyTo(ref);
        maps.setFaultTo(ref);

        ((BindingProvider)port).getRequestContext()
            .put("javax.xml.ws.addressing.context", maps);

        try {
            port.addNumbers3(-1, 2);
        } catch (SOAPFaultException e) {
            assertTrue(e.getFault().getFaultCode().contains("OnlyAnonymousAddressSupported"));
        }
    }
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

        URL wsdl = getClass().getResource("/wsdl_systest_wsspec/add_numbers.wsdl");
        assertNotNull("WSDL is null", wsdl);

        AddNumbersService service = new AddNumbersService(wsdl, serviceName);
        assertNotNull("Service is null ", service);
        AddNumbersPortType port = service.getAddNumbersPort(new AddressingFeature());
        updateAddressPort(port, PORT);
        return port;
    }
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

    @Test
    public void testDisableServerSide() throws Exception {
        ByteArrayOutputStream input = setupInLogging();
        ByteArrayOutputStream output = setupOutLogging();

        AddNumbersPortType port = getService().getAddNumbersPort();

        ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                                        "http://localhost:"
                                                        + PORT + "/jaxws/add");

        assertEquals(3, port.addNumbers(1, 2));

        String base = "http://apache.org/cxf/systest/ws/addr_feature/AddNumbersPortType/";
        String expectedOut = base + "addNumbersRequest</Action>";
        String expectedIn = "http://www.w3.org/2005/08/addressing";
       
View Full Code Here

Examples of org.apache.cxf.systest.ws.addr_feature.AddNumbersPortType

    @Test
    public void testDisableAll() throws Exception {
        ByteArrayOutputStream input = setupInLogging();
        ByteArrayOutputStream output = setupOutLogging();

        AddNumbersPortType port = getService().getAddNumbersPort(new AddressingFeature(false));

        ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                                        "http://localhost:"
                                                        + PORT + "/jaxws/add");

        assertEquals(3, port.addNumbers(1, 2));

        String expectedOut = "http://www.w3.org/2005/08/addressing";
        String expectedIn = "http://www.w3.org/2005/08/addressing";
       
        assertTrue(output.toString().indexOf(expectedOut) == -1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.