use of org.apache.catalina.Engine in project async-http-client by AsyncHttpClient.
the class WebDavBasicTest method setUpGlobal.
@BeforeClass(alwaysRun = true)
public void setUpGlobal() throws Exception {
embedded = new Embedded();
String path = new File(".").getAbsolutePath();
embedded.setCatalinaHome(path);
Engine engine = embedded.createEngine();
engine.setDefaultHost("localhost");
Host host = embedded.createHost("localhost", path);
engine.addChild(host);
Context c = embedded.createContext("/", path);
c.setReloadable(false);
Wrapper w = c.createWrapper();
w.addMapping("/*");
w.setServletClass(org.apache.catalina.servlets.WebdavServlet.class.getName());
w.addInitParameter("readonly", "false");
w.addInitParameter("listings", "true");
w.setLoadOnStartup(0);
c.addChild(w);
host.addChild(c);
Connector connector = embedded.createConnector("localhost", 0, Http11NioProtocol.class.getName());
connector.setContainer(host);
embedded.addEngine(engine);
embedded.addConnector(connector);
embedded.start();
port1 = connector.getLocalPort();
}
Aggregations