Examples of WebConversation


Examples of com.meterware.httpunit.WebConversation

        /* check values */
        checkTextRegex(resp,"values","^\\[.*\\]$");
    }

    public @Test void testCookiesTool() throws Exception {
        WebConversation conv = new WebConversation();
        WebRequest req = new GetMethodWebRequest(ROOT_URL+"cookies.vm");
        WebResponse resp = conv.getResponse(req);

        /* check all */
        checkTextStart(resp,"all","[Ljavax.servlet.http.Cookie;");

        /* check get('JSESSIONID') */
 
View Full Code Here

Examples of com.meterware.httpunit.WebConversation

public class game_test extends WebUnitTest {
  private final static String HOST = "http://localhost:8084/sy";
 
  public game_test() throws ParserConfigurationException, MalformedURLException, IOException, SAXException {
    super(new WebConversation(),HOST);
   
  }
View Full Code Here

Examples of com.meterware.httpunit.WebConversation

        //System.in.read();
    }

    @Test
    public void testGetInvocation() throws Exception {
        WebConversation wc = new WebConversation();
        WebRequest request = new GetMethodWebRequest(SERVICE_URL+"/John");
        request.setHeaderField("Content-Type", "application/xml");
        WebResponse response = wc.getResource(request);

        //for debug purposes
        System.out.println(">>>" + GET_RESPONSE);
        System.out.println(">>>" + response.getText());
View Full Code Here

Examples of com.meterware.httpunit.WebConversation

    }
   
    @Test
    public void testGetInvocationNotFound() throws Exception {
        WebConversation wc = new WebConversation();
        WebRequest request = new GetMethodWebRequest(SERVICE_URL+"/Foo");
        request.setHeaderField("Content-Type", "application/xml");
        WebResponse response = wc.getResource(request);
       
        Assert.assertEquals(404, response.getResponseCode());
    }
View Full Code Here

Examples of com.meterware.httpunit.WebConversation

    }

    @Test
    public void testPutInvocation() throws Exception {
        //Add new item to catalog
        WebConversation wc = new WebConversation();
        WebRequest request   = new PostMethodWebRequest(SERVICE_URL, new ByteArrayInputStream(UPDATED_ITEM.getBytes("UTF-8")),"application/xml");
        WebResponse response = wc.getResource(request);

        Assert.assertEquals(201, response.getResponseCode());
        System.out.println(response.getHeaderField("Location"));

        //read new results and expect to get new item back in the response
        request = new GetMethodWebRequest(SERVICE_URL);
        request.setHeaderField("Content-Type", "application/xml");
        response = wc.getResource(request);

        //for debug purposes
        //System.out.println(">>>" + GET_UPDATED_RESPONSE);
        //System.out.println(">>>" + response.getText());
View Full Code Here

Examples of com.meterware.httpunit.WebConversation

    }

    protected void assertServerSetupCorrectly( RemoteRepoInfo remoteRepo )
        throws Exception
    {
        WebConversation wc = new WebConversation();
        WebResponse response = wc.getResponse( remoteRepo.url );
        assertResponseOK( response );
    }
View Full Code Here

Examples of com.meterware.httpunit.WebConversation

    }

    public void endBug948626(WebResponse response)
            throws Exception
    {
        WebConversation conversation = new WebConversation();
        response = conversation.getResponse(response.getURL().toExternalForm());
        WebForm form = response.getFormWithID("testForm");
        SubmitButton submitButton = form.getSubmitButtonWithID("testForm:submit");
        assertEquals("", form.getParameterValue("testForm:hidden"));
        response = form.submit(submitButton);
        form = response.getFormWithID("testForm");
View Full Code Here

Examples of com.meterware.httpunit.WebConversation

    }

    public void endBug948626(WebResponse response)
            throws Exception
    {
        WebConversation conversation = new WebConversation();
        response = conversation.getResponse(response.getURL().toExternalForm());
        WebForm form = response.getFormWithID("testForm");
        SubmitButton submitButton = form.getSubmitButtonWithID("testForm:submit");
        assertEquals("0", form.getParameterValue("testForm:hidden"));
        assertTrue(response.getText().indexOf("false") != -1);
        assertTrue(response.getText().indexOf("true") == -1);
View Full Code Here

Examples of com.meterware.httpunit.WebConversation


    public void endBug972165(WebResponse response)
        throws Exception
    {
        WebConversation conversation = new WebConversation();
        response = conversation.getResponse(response.getURL().toExternalForm());
        WebForm form = response.getFormWithID("testForm");
        SubmitButton submitButton = form.getSubmitButtonWithID("testForm:submit");

        assertTrue(response.getText().indexOf("CheckDisabled:true") != -1);
        assertEquals("true", form.getParameterValue("testForm:checkDisabled"));
View Full Code Here

Examples of com.meterware.httpunit.WebConversation


    public void endBug(WebResponse response)
        throws Exception
    {
        WebConversation conversation = new WebConversation();
        response = conversation.getResponse(response.getURL().toExternalForm());
        WebForm form = response.getFormWithID("testForm");
        form.setParameter("testForm:size", "12");
        SubmitButton submitButton = form.getSubmitButtonWithID("testForm:submit");
        response = form.submit(submitButton);
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.