Package com.gargoylesoftware.htmlunit

Examples of com.gargoylesoftware.htmlunit.Page


        }

        // Verify that the conversation cannot be associated
        {
            client.setThrowExceptionOnFailingStatusCode(false);
            Page page = client.getPage(getPath("/display", cid));
            assertEquals(page.getWebResponse().getStatusCode(), 500);
        }
    }
View Full Code Here


    }


    @Test
    public void testCrossContextForward(@ArquillianResource @OperateOnDeployment(FIRST) URL firstContext) throws IOException {
      Page page = new WebClient().getPage(firstContext + "forwarding");
      assertEquals(200, page.getWebResponse().getStatusCode());
      assertEquals("<h1>Hello World</h1>", page.getWebResponse().getContentAsString());
    }
View Full Code Here

        // Finally verify the test bean
        try {
            WebClient webClient = new WebClient();
            webClient.setThrowExceptionOnFailingStatusCode(true);
            Page page = webClient.getPage("http://localhost:8080/test");
            assertEquals(testBean.getId(), page.getWebResponse().getContentAsString().trim());
        } finally {
            server.stop();
            weld.shutdown();
        }
    }
View Full Code Here

    private URL url;

    @Test
    public void testDestroyRemovesSFSB() throws Exception {
        WebClient client = new WebClient();
        Page page = client.getPage(getPath("request1"));
        assertEquals(page.getWebResponse().getStatusCode(), HttpServletResponse.SC_OK);
        page = client.getPage(getPath("request2"));
        assertEquals(page.getWebResponse().getStatusCode(), HttpServletResponse.SC_OK);
    }
View Full Code Here

    public void testRedirectInPreRenderViewAction(@ArquillianResource URL url) throws Exception {
        WebClient client = new WebClient();
        client.setRedirectEnabled(false);
        client.setThrowExceptionOnFailingStatusCode(false);

        Page page = client.getPage(url + "/doRedirect.faces");
        assertEquals("Expected redirect:", HttpServletResponse.SC_MOVED_TEMPORARILY, page.getWebResponse().getStatusCode());
    }
View Full Code Here

    }

    @Test
    public void test() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
        WebClient client = new WebClient();
        Page page = client.getPage(url.toString() + "/foo");
        String content = page.getWebResponse().getContentAsString();
        assertTrue("Unexpected response, was: " + content, content.contains("BMX"));
    }
View Full Code Here

        assertEquals("second:second", getResponseAsString("main/dispatch/forward?crossContext=true"));
        assertEquals("true", getResponseAsString("main/validate"));
    }

    private String getResponseAsString(String urlSuffix) throws FailingHttpStatusCodeException, MalformedURLException, IOException {
        Page page = client.getPage(contextPath + urlSuffix);
        assertEquals(200, page.getWebResponse().getStatusCode());
        return page.getWebResponse().getContentAsString();
    }
View Full Code Here

    @Test
    public void testConversationPropagationToNonExistentConversationLeadsException() throws Exception {
        WebClient client = new WebClient();
        client.setThrowExceptionOnFailingStatusCode(false);
        Page page = client.getPage(getPath("/index.jsp"));

        Assert.assertEquals(200, page.getWebResponse().getStatusCode());
        Assert.assertTrue(page.getUrl().toString().contains("home.jsf"));
    }
View Full Code Here

    */
    @Test
    public void testStaticEJBEMFProducerField() throws Exception {
        WebClient client = new WebClient();
        client.setThrowExceptionOnFailingStatusCode(false);
        Page page = client.getPage(getPath("emfconsumer1"));

        assertEquals(200, page.getWebResponse().getStatusCode());
    }
View Full Code Here

    */
    @Test
    public void testInstanceManagedBeanEMFProducerField() throws Exception {
        WebClient client = new WebClient();
        client.setThrowExceptionOnFailingStatusCode(false);
        Page page = client.getPage(getPath("emfconsumer2"));

        assertEquals(200, page.getWebResponse().getStatusCode());
    }
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.Page

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.