use of com.gargoylesoftware.htmlunit.WebClient in project core by weld.
the class SimpleAsyncListenerTest method testOnTimeoutCalledSuccesfully.
@Test
public void testOnTimeoutCalledSuccesfully() throws Exception {
WebClient webClient = new WebClient();
webClient.setThrowExceptionOnFailingStatusCode(false);
webClient.getPage(getPath(AsyncServlet.TEST_TIMEOUT));
Page results = webClient.getPage(contextPath + "Status");
assertTrue(results.getWebResponse().getContentAsString().contains("onTimeout: true"));
}
use of com.gargoylesoftware.htmlunit.WebClient in project core by weld.
the class EMFFactoryTest method testStaticManagedBeanEMFProducerField.
/*
* description = "WELD-632"
*/
@Test
public void testStaticManagedBeanEMFProducerField() throws Exception {
WebClient client = new WebClient();
client.setThrowExceptionOnFailingStatusCode(false);
Page page = client.getPage(getPath("emfconsumer3"));
assertEquals(200, page.getWebResponse().getStatusCode());
}
use of com.gargoylesoftware.htmlunit.WebClient in project core by weld.
the class EMFFactoryTest method testStaticEJBEMFProducerField.
/*
* description = "WELD-632"
*/
@Test
public void testStaticEJBEMFProducerField() throws Exception {
WebClient client = new WebClient();
client.setThrowExceptionOnFailingStatusCode(false);
Page page = client.getPage(getPath("emfconsumer1"));
assertEquals(200, page.getWebResponse().getStatusCode());
}
use of com.gargoylesoftware.htmlunit.WebClient in project core by weld.
the class RequestScopedCacheLeakTest method test.
@Test
public void test() throws Exception {
WebClient webClient = new WebClient();
webClient.setThrowExceptionOnFailingStatusCode(false);
for (int i = 0; i < 100; i++) {
// first, send out a hundred of poisoning requests
// each of these should leave a thread in a broken state
sendRequest(webClient, i, true);
}
for (int i = 0; i < 100; i++) {
// now send out normal requests to see if they are affected by the thread's broken state
String result = sendRequest(webClient, i, false);
Assert.assertFalse("Invalid state detected after " + (i + 1) + " requests", result.startsWith("bar"));
}
}
use of com.gargoylesoftware.htmlunit.WebClient in project core by weld.
the class ClientConversationContextTest method testRedirectToConversation.
@Test
public void testRedirectToConversation() throws Exception {
WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("/cloud.jsf"));
HtmlPage snowstorm = getFirstMatchingElement(page, HtmlSubmitInput.class, "snow").click();
String name = getFirstMatchingElement(snowstorm, HtmlSpan.class, "snowstormName").getTextContent();
assertEquals(Snowstorm.NAME, name);
snowstorm = getFirstMatchingElement(snowstorm, HtmlSubmitInput.class, "go").click();
name = getFirstMatchingElement(snowstorm, HtmlSpan.class, "snowstormName").getTextContent();
assertEquals(Snowstorm.NAME, name);
}
Aggregations