@Test public void httpServerCanLoadJarPackage() throws Exception { HttpServer httpSever = new HttpServer(); List<ServerSource> sources = httpSever.getServerSources(); Map<String, ServletWrapper> router = new HashMap<>(); ServletWrapper wrapper1 = new ServletWrapper( "index", "/", "info.xiantang.jerrymouse.staticresource.IndexServlet", 0, null, null); ServletWrapper wrapper2 = new ServletWrapper( "hello", "/hello", "info.xiantang.jerrymouse.staticresource.HelloServlet", null, null, null); router.put("/", wrapper1); router.put("/hello", wrapper2); Configuration config = new Configuration(9000, 3, router); assertEquals(new ServerSource("sample.jar",config), sources.get(1)); }
List<ServerSource> getServerSources() { return Collections.unmodifiableList(sources); }
HttpServer implements LifeCycle { List<ServerSource> getServerSources() { return Collections.unmodifiableList(sources); } }
HttpServer implements LifeCycle { List<ServerSource> getServerSources() { return Collections.unmodifiableList(sources); } HttpServer();  HttpServer(String buildPath); }
HttpServer implements LifeCycle { List<ServerSource> getServerSources() { return Collections.unmodifiableList(sources); } HttpServer();  HttpServer(String buildPath); void setContexts(List<Context> contexts); void setSources(List<ServerSource> sources); @Override void init(); @Override void start(); @Override void destroy(); List<Context> getContexts(); void clear(); }
HttpServer implements LifeCycle { List<ServerSource> getServerSources() { return Collections.unmodifiableList(sources); } HttpServer();  HttpServer(String buildPath); void setContexts(List<Context> contexts); void setSources(List<ServerSource> sources); @Override void init(); @Override void start(); @Override void destroy(); List<Context> getContexts(); void clear();  }