diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2013-06-16 12:02:14 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2013-06-16 23:32:37 +0200 |
commit | 7f43d049865770b517ce100f35dc82458fd4d225 (patch) | |
tree | 55dbe79eb8be7294e19958e527131e086c3f4db6 /org.eclipse.jgit.http.test | |
parent | 4045e7e9c4eb16d6fd48b712facb7fb2ec6b7e94 (diff) | |
download | jgit-7f43d049865770b517ce100f35dc82458fd4d225.tar.gz jgit-7f43d049865770b517ce100f35dc82458fd4d225.zip |
Fix tests for OS X when the tmpdir is the default /tmp
/tmp is a symbolic link and some tests break when the path
gets canonicalized by JGit or Jetty. Allow Jetty to serve
symlinks by setting init parameter "aliases" to true [1].
[1] http://wiki.eclipse.org/Jetty/Howto/How_to_serve_symbolically_linked_files
Change-Id: I45359a40435e8a33def6e0bb6784b4d8637793ac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.http.test')
3 files changed, 11 insertions, 3 deletions
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java index fbf4d075ad..1726dc5eb9 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java @@ -60,6 +60,7 @@ import java.util.Map; 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; @@ -97,8 +98,9 @@ public class DumbClientDumbServerTest extends HttpTestCase { 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(); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletInitTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletInitTest.java index 9dfb199425..6cbb41e98e 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletInitTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletInitTest.java @@ -101,6 +101,8 @@ public class GitServletInitTest { 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(); @@ -133,6 +135,8 @@ public class GitServletInitTest { 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()); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java index 8bdaf2cb6a..b686d160b1 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java @@ -123,7 +123,9 @@ public class HttpClientTests extends HttpTestCase { 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; } |