&& isLitmusAvailable(litmus)) {
final Repository repository = JcrUtils.getRepository(
"jcr-jackrabbit://" + Text.escapePath(dir.getCanonicalPath()));
Session session = repository.login(); // for the TransientRepository
try {
SocketConnector connector = new SocketConnector();
connector.setHost("localhost");
connector.setPort(Integer.getInteger("litmus.port", 0));
Server server = new Server();
server.addConnector(connector);
ServletHolder holder = new ServletHolder(
new SimpleWebdavServlet() {
@Override
public Repository getRepository() {
return repository;
}
});
holder.setInitParameter("resource-config", "/config.xml");
Context context = new Context(server, "/");
context.setResourceBase("src/test/resources");
context.addServlet(holder, "/*");
server.addHandler(context);
server.start();
try {
int port = connector.getLocalPort();
String url = "http://localhost:" + port + "/default";
ProcessBuilder builder =
new ProcessBuilder(litmus, url, "admin", "admin");
builder.directory(dir);