Package javax.xml.ws.spi.http

Examples of javax.xml.ws.spi.http.HttpExchange


    }
   
    @Test
    public void testMessage() throws Exception {
        expect(bus.getExtension(QueryHandlerRegistry.class)).andReturn(null);
        HttpExchange exchange = setUpExchange();
        control.replay();

        JAXWSHttpSpiDestination destination =
            new JAXWSHttpSpiDestination(bus, endpoint);
        destination.setMessageObserver(observer);
View Full Code Here


        wqh.writeResponse(eq(addr), eq(pathInfo), eq(endpoint), isA(OutputStream.class));
        EasyMock.expectLastCall();
        QueryHandlerRegistry qhr = control.createMock(QueryHandlerRegistry.class);
        expect(qhr.getHandlers()).andReturn(Collections.singletonList((QueryHandler)wqh));
        expect(bus.getExtension(QueryHandlerRegistry.class)).andReturn(qhr);
        HttpExchange exchange = setUpExchangeForWSDLQuery(pathInfo);
        control.replay();

        JAXWSHttpSpiDestination destination =
            new JAXWSHttpSpiDestination(bus, endpoint);
        destination.setMessageObserver(observer);
View Full Code Here

        control.verify();
    }
   
    private HttpExchange setUpExchange() throws Exception {
        HttpExchange exchange = control.createMock(HttpExchange.class);
        expect(exchange.getHttpContext()).andReturn(context).anyTimes();
        expect(exchange.getQueryString()).andReturn(null);
        expect(exchange.getPathInfo()).andReturn(null);
        expect(exchange.getLocalAddress()).andReturn(new InetSocketAddress(8080));
        expect(exchange.getContextPath()).andReturn(CONTEXT_PATH);
        Map<String, List<String>> reqHeaders = new HashMap<String, List<String>>();
        reqHeaders.put("Content-Type", Collections.singletonList("text/xml"));
        expect(exchange.getRequestHeaders()).andReturn(reqHeaders).anyTimes();
        OutputStream responseBody = control.createMock(OutputStream.class);
        responseBody.flush();
        EasyMock.expectLastCall();
        expect(exchange.getResponseBody()).andReturn(responseBody).anyTimes();
        observer.onMessage(isA(Message.class));
        EasyMock.expectLastCall();
       
        return exchange;
    }
View Full Code Here

       
        return exchange;
    }
   
    private HttpExchange setUpExchangeForWSDLQuery(String pathInfo) throws Exception {
        HttpExchange exchange = control.createMock(HttpExchange.class);
        expect(exchange.getHttpContext()).andReturn(context).anyTimes();
        expect(exchange.getQueryString()).andReturn("wsdl").anyTimes();
        expect(exchange.getPathInfo()).andReturn(pathInfo);
        expect(context.getPath()).andReturn(PATH);
        expect(exchange.getContextPath()).andReturn(CONTEXT_PATH);
        expect(exchange.getScheme()).andReturn("http");
        expect(exchange.getLocalAddress()).andReturn(new InetSocketAddress("localhost", 80));
        Map<String, List<String>> resHeaders = new HashMap<String, List<String>>();
        expect(exchange.getResponseHeaders()).andReturn(resHeaders).anyTimes();
        OutputStream responseBody = control.createMock(OutputStream.class);
        responseBody.flush();
        EasyMock.expectLastCall();
        expect(exchange.getResponseBody()).andReturn(responseBody).anyTimes();
       
        return exchange;
    }
View Full Code Here

    }
   
    @Test
    public void testMessage() throws Exception {
        expect(bus.getExtension(QueryHandlerRegistry.class)).andReturn(null);
        HttpExchange exchange = setUpExchange();
        control.replay();

        JAXWSHttpSpiDestination destination =
            new JAXWSHttpSpiDestination(bus, new DestinationRegistryImpl(), endpoint);
        destination.setMessageObserver(observer);
View Full Code Here

        control.verify();
    }
   

    private HttpExchange setUpExchange() throws Exception {
        HttpExchange exchange = control.createMock(HttpExchange.class);
        expect(exchange.getHttpContext()).andReturn(context).anyTimes();
        expect(exchange.getQueryString()).andReturn(null);
        expect(exchange.getPathInfo()).andReturn(null);
        expect(exchange.getRequestURI()).andReturn(CONTEXT_PATH);
        expect(exchange.getContextPath()).andReturn(CONTEXT_PATH);
        Map<String, List<String>> reqHeaders = new HashMap<String, List<String>>();
        reqHeaders.put("Content-Type", Collections.singletonList("text/xml"));
        expect(exchange.getRequestHeaders()).andReturn(reqHeaders).anyTimes();
        OutputStream responseBody = control.createMock(OutputStream.class);
        responseBody.flush();
        EasyMock.expectLastCall();
        expect(exchange.getResponseBody()).andReturn(responseBody).anyTimes();
        observer.onMessage(isA(Message.class));
        EasyMock.expectLastCall();
       
        return exchange;
    }
View Full Code Here

        wqh.writeResponse(eq(addr), eq(pathInfo), eq(endpoint), isA(OutputStream.class));
        EasyMock.expectLastCall();
        QueryHandlerRegistry qhr = control.createMock(QueryHandlerRegistry.class);
        expect(qhr.getHandlers()).andReturn(Collections.singletonList((QueryHandler)wqh));
        expect(bus.getExtension(QueryHandlerRegistry.class)).andReturn(qhr);
        HttpExchange exchange = setUpExchangeForWSDLQuery(pathInfo);
        control.replay();

        JAXWSHttpSpiDestination destination =
            new JAXWSHttpSpiDestination(bus, endpoint);
        destination.setMessageObserver(observer);
View Full Code Here

        control.verify();
    }
   
    private HttpExchange setUpExchange() throws Exception {
        HttpExchange exchange = control.createMock(HttpExchange.class);
        expect(exchange.getHttpContext()).andReturn(context).anyTimes();
        expect(exchange.getQueryString()).andReturn(null);
        expect(exchange.getPathInfo()).andReturn(null);
        expect(exchange.getContextPath()).andReturn(CONTEXT_PATH);
        Map<String, List<String>> reqHeaders = new HashMap<String, List<String>>();
        reqHeaders.put("Content-Type", Collections.singletonList("text/xml"));
        expect(exchange.getRequestHeaders()).andReturn(reqHeaders).anyTimes();
        OutputStream responseBody = control.createMock(OutputStream.class);
        responseBody.flush();
        EasyMock.expectLastCall();
        expect(exchange.getResponseBody()).andReturn(responseBody).anyTimes();
        observer.onMessage(isA(Message.class));
        EasyMock.expectLastCall();
       
        return exchange;
    }
View Full Code Here

       
        return exchange;
    }
   
    private HttpExchange setUpExchangeForWSDLQuery(String pathInfo) throws Exception {
        HttpExchange exchange = control.createMock(HttpExchange.class);
        expect(exchange.getHttpContext()).andReturn(context).anyTimes();
        expect(exchange.getQueryString()).andReturn("wsdl").anyTimes();
        expect(exchange.getPathInfo()).andReturn(pathInfo);
        expect(context.getPath()).andReturn(PATH);
        expect(exchange.getContextPath()).andReturn(CONTEXT_PATH);
        expect(exchange.getScheme()).andReturn("http");
        expect(exchange.getLocalAddress()).andReturn(new InetSocketAddress("localhost", 80));
        Map<String, List<String>> resHeaders = new HashMap<String, List<String>>();
        expect(exchange.getResponseHeaders()).andReturn(resHeaders).anyTimes();
        OutputStream responseBody = control.createMock(OutputStream.class);
        responseBody.flush();
        EasyMock.expectLastCall();
        expect(exchange.getResponseBody()).andReturn(responseBody).anyTimes();
       
        return exchange;
    }
View Full Code Here

    }
   
    @Test
    public void testMessage() throws Exception {
        expect(bus.getExtension(QueryHandlerRegistry.class)).andReturn(null);
        HttpExchange exchange = setUpExchange();
        control.replay();

        JAXWSHttpSpiDestination destination =
            new JAXWSHttpSpiDestination(bus, new DestinationRegistryImpl(), endpoint);
        destination.setMessageObserver(observer);
View Full Code Here

TOP

Related Classes of javax.xml.ws.spi.http.HttpExchange

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.