Exemplo n.º 1
0
 protected WebContext loadPage(String content) throws Exception {
   server = getServer();
   String path = getName() + ".html";
   server.addPage(path, content);
   WebClient webClient = new WebClient();
   String url = server.getUrl(path);
   return new WebContext(webClient.getPage(url), webClient, project);
 }
Exemplo n.º 2
0
 @Override
 protected void tearDown() throws Exception {
   if (server != null) {
     server.stop();
   }
   super.tearDown();
 }
Exemplo n.º 3
0
 protected DummyWebServer getServer() throws Exception {
   if (server == null) {
     server = new DummyWebServer();
     server.start();
   }
   return server;
 }
Exemplo n.º 4
0
 protected String getUrl(String path) {
   return server.getUrl(path);
 }