se.gawell.fakeriak.servlet.FakeRiakServletJettyUtil Maven / Gradle / Ivy
The newest version!
package se.gawell.fakeriak.servlet;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.webapp.WebAppContext;
public class FakeRiakServletJettyUtil {
public static Server startFakeRiak(int riakPortNumber, String tmpDir) throws Exception {
Server server = new Server(riakPortNumber);
WebAppContext webAppContext = new WebAppContext();
webAppContext.setContextPath("/");
webAppContext.setWar(tmpDir);
ServletHolder servletHolder = new ServletHolder(new FakeRiakServlet());
webAppContext.addServlet(servletHolder, "/*");
server.setHandler(webAppContext);
server.start();
return server;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy