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); }
@Override protected void tearDown() throws Exception { if (server != null) { server.stop(); } super.tearDown(); }
protected DummyWebServer getServer() throws Exception { if (server == null) { server = new DummyWebServer(); server.start(); } return server; }
protected String getUrl(String path) { return server.getUrl(path); }