use of org.webpieces.httpclient11.api.HttpFullRequest in project webpieces by deanhiller.
the class TestDevRefreshPageWithNoRestarting method testNotFoundFilterModified.
@Test
public void testNotFoundFilterModified() throws IOException {
HttpFullRequest req = Requests.createRequest(KnownHttpMethod.GET, "/enableFilter?webpiecesShowPage=true");
XFuture<HttpFullResponse> respFuture1 = http11Socket.send(req);
verify303(respFuture1, "http://myhost.com/home");
simulateDeveloperMakesChanges("src/test/devServerTest/notFound");
XFuture<HttpFullResponse> respFuture = http11Socket.send(req);
verify303(respFuture, "http://myhost.com/filter");
}
use of org.webpieces.httpclient11.api.HttpFullRequest in project webpieces by deanhiller.
the class TestDevRefreshPageWithNoRestarting method testNotFoundDisplaysWithIframeANDSpecialUrl.
@Test
public void testNotFoundDisplaysWithIframeANDSpecialUrl() {
HttpFullRequest req = Requests.createRequest(KnownHttpMethod.GET, "/notFound");
XFuture<HttpFullResponse> respFuture = http11Socket.send(req);
ResponseWrapper response = ResponseExtract.waitResponseAndWrap(respFuture);
response.assertStatusCode(KnownStatusCode.HTTP_404_NOTFOUND);
// platform should convert request into a development not found page which has an iframe
// of the original page with a query param to tell platform to display original
// page requested
response.assertContains("<iframe id=\"production\" src=\"/notFound?webpiecesShowPage=true");
}
use of org.webpieces.httpclient11.api.HttpFullRequest in project webpieces by deanhiller.
the class TestDevRefreshPageWithNoRestarting method testJustControllerChangedToCompileError.
@Test
public void testJustControllerChangedToCompileError() throws IOException {
HttpFullRequest req = Requests.createRequest(KnownHttpMethod.GET, "/home");
XFuture<HttpFullResponse> respFuture1 = http11Socket.send(req);
verifyPageContents(respFuture1, "user=Dean Hiller");
simulateDeveloperMakesChanges("src/test/devServerTest/controllerChangeCompileError");
XFuture<HttpFullResponse> respFuture = http11Socket.send(req);
ResponseWrapper response = ResponseExtract.waitResponseAndWrap(respFuture);
response.assertStatusCode(KnownStatusCode.HTTP_500_INTERNAL_SVR_ERROR);
response.assertContains("You are in the WebPieces Development Server. You appear to have a bug in your application.");
// Encountered a bug that can't happen in production as prod server won't even start...
response.assertContains("The above looks like an issue that cannot happen in production so we can't display a production page here");
// showing the compile error
response.assertContains("<span style=\"color:red;\">Error: cannot find symbol\n" + " symbol: method renThis()\n" + " location: class org.webpieces.router.api.controller.actions.Actions</span>");
}
use of org.webpieces.httpclient11.api.HttpFullRequest in project webpieces by deanhiller.
the class TestDevRefreshPageWithNoRestarting method testGuiceModuleAddAndControllerChange.
@Test
public void testGuiceModuleAddAndControllerChange() throws IOException {
HttpFullRequest req = Requests.createRequest(KnownHttpMethod.GET, "/home");
XFuture<HttpFullResponse> respFuture1 = http11Socket.send(req);
verifyPageContents(respFuture1, "user=Dean Hiller");
simulateDeveloperMakesChanges("src/test/devServerTest/guiceModule");
XFuture<HttpFullResponse> respFuture = http11Socket.send(req);
verifyPageContents(respFuture, "newuser=Joseph");
}
use of org.webpieces.httpclient11.api.HttpFullRequest in project webpieces by deanhiller.
the class TestDevSynchronousErrors method testWebappThrowsNotFound.
@Test
public void testWebappThrowsNotFound() {
HttpFullRequest req = Requests.createRequest(KnownHttpMethod.GET, "/throwNotFound");
XFuture<HttpFullResponse> respFuture = http11Socket.send(req);
ResponseWrapper response = ResponseExtract.waitResponseAndWrap(respFuture);
response.assertStatusCode(KnownStatusCode.HTTP_404_NOTFOUND);
response.assertContains("Your app's webpage was not found");
}
Aggregations