Search in sources :

Example 46 with WebConversation

use of com.meterware.httpunit.WebConversation in project cxf by apache.

the class NoSpringServletClientTest method testGetServiceList.

@Test
public void testGetServiceList() throws Exception {
    WebConversation client = new WebConversation();
    WebResponse res = client.getResponse(serviceURL + "/services");
    WebLink[] links = res.getLinks();
    Set<String> s = new HashSet<>();
    for (WebLink l : links) {
        s.add(l.getURLString());
    }
    assertEquals("There should be 3 links for the service", 3, links.length);
    assertTrue(s.contains(serviceURL + "Greeter?wsdl"));
    assertTrue(s.contains(serviceURL + "Hello?wsdl"));
    assertTrue(s.contains(serviceURL + "?wsdl"));
    assertEquals("text/html", res.getContentType());
}
Also used : WebResponse(com.meterware.httpunit.WebResponse) WebConversation(com.meterware.httpunit.WebConversation) WebLink(com.meterware.httpunit.WebLink) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

WebConversation (com.meterware.httpunit.WebConversation)46 Test (org.junit.Test)46 WebResponse (com.meterware.httpunit.WebResponse)44 GetMethodWebRequest (com.meterware.httpunit.GetMethodWebRequest)43 WebRequest (com.meterware.httpunit.WebRequest)39 HttpServletRequest (javax.servlet.http.HttpServletRequest)14 HttpServletResponse (javax.servlet.http.HttpServletResponse)14 HttpSession (javax.servlet.http.HttpSession)9 WebForm (com.meterware.httpunit.WebForm)7 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)5 AuthorizationRequiredException (com.meterware.httpunit.AuthorizationRequiredException)3 PrintWriter (java.io.PrintWriter)3 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)3 HttpException (com.meterware.httpunit.HttpException)2 WebLink (com.meterware.httpunit.WebLink)2 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)2 PostMethodWebRequest (com.meterware.httpunit.PostMethodWebRequest)1 PutMethodWebRequest (com.meterware.httpunit.PutMethodWebRequest)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 HashSet (java.util.HashSet)1