use of com.gargoylesoftware.htmlunit.TextPage in project javaee7-samples by javaee-samples.
the class TestServletTest method testPost.
@Test
public void testPost() throws IOException, SAXException {
WebRequest request = new WebRequest(new URL(base + "TestServlet"), HttpMethod.POST);
TextPage page = webClient.getPage(request);
assertEquals("my POST", page.getContent());
}
use of com.gargoylesoftware.htmlunit.TextPage in project javaee7-samples by javaee-samples.
the class TestServletTest method testGet.
@Test
public void testGet() throws IOException, SAXException {
TextPage page = webClient.getPage(base + "TestServlet");
assertEquals("my GET", page.getContent());
}
use of com.gargoylesoftware.htmlunit.TextPage in project javaee7-samples by javaee-samples.
the class SimpleServletTest method testGet.
@Test
public void testGet() throws IOException, SAXException {
TextPage page = webClient.getPage(base + "SimpleServlet");
assertEquals("my GET", page.getContent());
}
use of com.gargoylesoftware.htmlunit.TextPage in project javaee7-samples by javaee-samples.
the class SimpleServletTest method testPost.
@Test
public void testPost() throws IOException, SAXException {
WebRequest request = new WebRequest(new URL(base + "SimpleServlet"), HttpMethod.POST);
TextPage page = webClient.getPage(request);
assertEquals("my POST", page.getContent());
}
use of com.gargoylesoftware.htmlunit.TextPage in project javaee7-samples by javaee-samples.
the class SecureServletTest method testPostWithNoCredentials.
@Test
public void testPostWithNoCredentials() throws Exception {
// webClient.setCredentialsProvider(correctCreds);
WebRequest request = new WebRequest(new URL(base + "SecureServlet"), HttpMethod.POST);
TextPage page = webClient.getPage(request);
assertEquals("my POST", page.getContent());
}
Aggregations