import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jgit.errors.NotSupportedException;
import org.eclipse.jgit.junit.TestRepository;
import org.eclipse.jgit.junit.http.AccessEvent;
ServletContextHandler app = server.addContext("/git");
app.setResourceBase(base.toString());
- app.addServlet(DefaultServlet.class, "/");
-
+ ServletHolder holder = app.addServlet(DefaultServlet.class, "/");
+ // The tmp directory is symlinked on OS X
+ holder.setInitParameter("aliases", "true");
server.setUp();
remoteRepository = src.getRepository();
ServletHolder s = app.addServlet(GitServlet.class, "/git");
s.setInitOrder(1);
s.getServletHandler().setStartWithUnavailable(false);
+ // The tmp directory is symlinked on OS X
+ s.setInitParameter("aliases", "true");
try {
server.setUp();
s.setInitOrder(1);
s.setInitParameter("base-path", ".");
s.setInitParameter("export-all", "true");
+ // The tmp directory is symlinked on OS X
+ s.setInitParameter("aliases", "true");
server.setUp();
assertTrue("no warnings", RecordingLogger.getWarnings().isEmpty());
ServletContextHandler ctx = server.addContext(path);
ctx.setResourceBase(base.toString());
- ctx.addServlet(DefaultServlet.class, "/");
+ ServletHolder holder = ctx.addServlet(DefaultServlet.class, "/");
+ // The tmp directory is symlinked on OS X
+ holder.setInitParameter("aliases", "true");
return ctx;
}
builder.setMustExist(true);
Repository repo2 = builder.build();
- assertEquals(repo1.getDirectory(), repo2.getDirectory());
+ // The tmp directory may be a symlink so the actual path
+ // may not
+ assertEquals(repo1.getDirectory().getCanonicalPath(), repo2
+ .getDirectory().getCanonicalPath());
assertEquals(dir, repo2.getWorkTree());
}
builder.setMustExist(true);
Repository repo2 = builder.build();
- assertEquals(repo1.getDirectory(), repo2.getDirectory());
+ // The tmp directory may be a symlink
+ assertEquals(repo1.getDirectory().getCanonicalPath(), repo2
+ .getDirectory().getCanonicalPath());
assertEquals(dir, repo2.getWorkTree());
}
}