Package com.meterware.httpunit

Examples of com.meterware.httpunit.WebRequest


    @Test
    public void testGetWSDLWithIncludes() throws Exception {
        ServletUnitClient client = newClient();
        client.setExceptionsThrownOnErrorStatus(true);
       
        WebRequest req = new GetMethodQueryWebRequest(CONTEXT_URL + "/services/greeter3?wsdl");
       
        WebResponse res = client.getResponse(req);
        assertEquals(200, res.getResponseCode());
        assertEquals("text/xml", res.getContentType());
        Document doc = DOMUtils.readXml(res.getInputStream());
View Full Code Here


    @Test
    public void testGetWSDLWithXMLBinding() throws Exception {
        ServletUnitClient client = newClient();
        client.setExceptionsThrownOnErrorStatus(true);
       
        WebRequest req = new GetMethodQueryWebRequest(CONTEXT_URL + "/services/greeter2?wsdl");
       
        WebResponse res = client.getResponse(req);
        assertEquals(200, res.getResponseCode());
        assertEquals("text/xml", res.getContentType());
       
View Full Code Here

        assertEquals("text/html", res.getContentType());
    }

    @Test
    public void testServiceWsdlNotFound() throws Exception {
        WebRequest req = new GetMethodWebRequest(CONTEXT_URL + "/services/NoSuchService?wsdl");

        expectErrorCode(req, 404, "Response code 404 required for invalid WSDL url.");
    }
View Full Code Here

    @Test
    public void testGetImportedXSD() throws Exception {
        ServletUnitClient client = newClient();
        client.setExceptionsThrownOnErrorStatus(true);

        WebRequest req
            = new GetMethodQueryWebRequest(CONTEXT_URL + "/services/greeter?wsdl");
        WebResponse res = client.getResponse(req);
        assertEquals(200, res.getResponseCode());
        String text = res.getText();
        assertEquals("text/xml", res.getContentType());
View Full Code Here

    }

    @Test
    public void testInvokingSpringBeans() throws Exception {

        WebRequest req = new PostMethodWebRequest(CONTEXT_URL + "/services/SOAPService",
            getClass().getResourceAsStream("GreeterMessage.xml"),
            "text/xml; charset=utf-8");

        invokingEndpoint(req);
       
View Full Code Here

    @Test
    public void testGreetMeGetRequest() throws Exception {
        ServletUnitClient client = newClient();
        client.setExceptionsThrownOnErrorStatus(true);
       
        WebRequest req =
            new GetMethodQueryWebRequest(CONTEXT_URL + "/services/SOAPService/greetMe?"
                                         + "requestType=hello");
       
        WebResponse response = client.getResponse(req);       
        Document doc = DOMUtils.readXml(response.getInputStream());
View Full Code Here

    @Test
    public void testGetWSDL() throws Exception {
        ServletUnitClient client = newClient();
        client.setExceptionsThrownOnErrorStatus(true);
       
        WebRequest req =
            new GetMethodQueryWebRequest(CONTEXT_URL + "/services/SOAPService?wsdl");
      
        WebResponse res = client.getResponse(req);       
        assertEquals(200, res.getResponseCode());
        assertEquals("text/xml", res.getContentType());
View Full Code Here

    }

    @Test
    public void testInvokingSpringBeans() throws Exception {

        WebRequest req = new PostMethodWebRequest(CONTEXT_URL + "/services/Greeter",
            getClass().getResourceAsStream("GreeterMessage.xml"),
            "text/xml; charset=utf-8");

        invokingEndpoint(req);
       
View Full Code Here

    @Test
    public void testGreetMeGetRequest() throws Exception {
        ServletUnitClient client = newClient();
        client.setExceptionsThrownOnErrorStatus(true);
       
        WebRequest req =
            new GetMethodQueryWebRequest(CONTEXT_URL + "/services/Greeter/greetMe?"
                                         + "requestType=hello");
       
        WebResponse response = client.getResponse(req);       
        Document doc = DOMUtils.readXml(response.getInputStream());
View Full Code Here

    @Test
    public void testGetWSDL() throws Exception {
        ServletUnitClient client = newClient();
        client.setExceptionsThrownOnErrorStatus(true);
       
        WebRequest req =
            new GetMethodQueryWebRequest(CONTEXT_URL + "/services/Greeter?wsdl");
      
        WebResponse res = client.getResponse(req);       
        assertEquals(200, res.getResponseCode());
        assertEquals("text/xml", res.getContentType());
View Full Code Here

TOP

Related Classes of com.meterware.httpunit.WebRequest

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.