Examples of WebResponse


Examples of com.google.sitebricks.client.WebResponse

*/
@Test(suiteName = AcceptanceTest.SUITE)
public class SpiRestfuWebServiceWithSubpaths2AcceptanceTest {

  public void shouldServiceTopLevelDynamicPath() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/spi/test")
        .transports(String.class)
        .over(Json.class)
        .get();

    assert "get:top".equals(response.toString());
  }
View Full Code Here

Examples of com.meterware.httpunit.WebResponse

        WebRequest req = new PostMethodWebRequest("http://localhost/services/SoapActionService",
                                                  getResourceAsStream("empty.xml"),
                                                  "text/xml");
        req.setHeaderField("SOAPAction", "one");

        WebResponse response = newClient().getResponse(req);
        assertTrue(response.getText().indexOf("oneout") != -1);
      
        req = new PostMethodWebRequest("http://localhost/services/SoapActionService",
                                       getResourceAsStream("empty.xml"),
                                       "text/xml");
        req.setHeaderField("SOAPAction", "two");
       
        response = newClient().getResponse(req);
        assertTrue(response.getText().indexOf("twoout") != -1);

    }
View Full Code Here

Examples of com.meterware.httpunit.WebResponse

        WebRequest req = new PostMethodWebRequest("http://localhost/services/SoapActionService",
                                                  getResourceAsStream("empty.xml"),
                                                  "text/xml");
        req.setHeaderField("SOAPAction", "\"one\"");

        WebResponse response = newClient().getResponse(req);
        assertTrue(response.getText().indexOf("oneout") != -1);
      
        req = new PostMethodWebRequest("http://localhost/services/SoapActionService",
                                       getResourceAsStream("empty.xml"),
                                       "text/xml");
        req.setHeaderField("SOAPAction", "\"two\"");
       
        response = newClient().getResponse(req);
        assertTrue(response.getText().indexOf("twoout") != -1);

    }
View Full Code Here

Examples of com.meterware.httpunit.WebResponse

            {
                return "WSDL";
            }
        };
       
      WebResponse response = newClient().getResponse(getReq);

        WebRequest req = new PostMethodWebRequest("http://localhost/services/EchoImpl",
                                                  getClass().getResourceAsStream("/org/codehaus/xfire/echo11.xml"),
                                                  "text/xml");

        response = newClient().getResponse(req);

        assertEquals("text/xml", response.getContentType());
        assertEquals("UTF-8", response.getCharacterSet());
       
        Document doc = readDocument(response.getText());
        addNamespace("m", "urn:Echo");
        assertValid("//m:echo", doc);

        assertTrue(MockSessionHandler.inSession);
    }
View Full Code Here

Examples of com.meterware.httpunit.WebResponse

    {
        WebRequest req = new PostMethodWebRequest("http://localhost/services/EchoImpl",
                                                  getClass().getResourceAsStream("/org/codehaus/xfire/echo12.xml"),
                                                  "text/xml");

        WebResponse response = newClient().getResponse(req);

        assertEquals("application/soap+xml", response.getContentType());
        assertEquals("UTF-8", response.getCharacterSet());
       
        Document doc = readDocument(response.getText());
        addNamespace("m", "urn:Echo");
        assertValid("//m:echo", doc);

        assertTrue(MockSessionHandler.inSession);
    }
View Full Code Here

Examples of com.meterware.httpunit.WebResponse

        throws Exception
    {
        ServletUnitClient client = newClient();
        client.setExceptionsThrownOnErrorStatus(false);
       
        WebResponse res = client.getResponse("http://localhost/services/NoSuchService");
        assertEquals(404, res.getResponseCode());
        assertTrue(res.isHTML());
    }
View Full Code Here

Examples of com.meterware.httpunit.WebResponse

        throws Exception
    {
        ServletUnitClient client = newClient();
        client.setExceptionsThrownOnErrorStatus(false);
       
        WebResponse res = client.getResponse("http://localhost/services/EchoImpl");

        assertTrue(res.isHTML());
        assertEquals("<html><body>Invalid SOAP request.</body></html>", res.getText());
    }
View Full Code Here

Examples of com.meterware.httpunit.WebResponse

    {
        WebRequest req = new PostMethodWebRequest("http://localhost/services/AsyncService",
                                                  getClass().getResourceAsStream("/org/codehaus/xfire/echo11.xml"),
                                                  "text/xml");

        WebResponse response = newClient().getResponse(req);
        assertTrue(response.getText().length() == 0);
    }
View Full Code Here

Examples of com.meterware.httpunit.WebResponse

    public void testWSDLDisabled()
        throws Exception
    {
        try
        {
            WebResponse response = newClient().getResponse(new TestWebRequest(
                    "http://localhost/services/Echo"));

            DOMUtils.writeXml(response.getDOM(), System.out);
        }
        catch (HttpNotFoundException e)
        {
            assertEquals(e.getResponseCode(), 404);
            assertTrue(e.getResponseMessage().indexOf("wsdl") > 0);
View Full Code Here

Examples of com.meterware.httpunit.WebResponse

    public void testWSDLEnabled()
        throws Exception
    {
        try
        {
            WebResponse response = newClient().getResponse(new TestWebRequest(
                    "http://localhost/services/Echo1"));

            DOMUtils.writeXml(response.getDOM(), System.out);
        }
        catch (HttpNotFoundException e)
        {
            assertTrue(false);
        }
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.