diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2012-05-23 22:21:58 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2012-05-23 22:21:58 +0200 |
commit | 24a0f47e32ab7cdf20c2201d7100599ea057f8a3 (patch) | |
tree | 4f48651fbc71bced0469f771b855ff9aa63d670d /org.eclipse.jgit.http.test/tst/org/eclipse | |
parent | 23e0a3e734beaed5af14d8fb64c5a8285631adc1 (diff) | |
download | jgit-24a0f47e32ab7cdf20c2201d7100599ea057f8a3.tar.gz jgit-24a0f47e32ab7cdf20c2201d7100599ea057f8a3.zip |
Update Jetty to 8.1.3.v20120416
Jetty 8.1.3 comes with Juno M7 and this version can be installed from
http://download.eclipse.org/jetty/updates/jetty-bundles-8.x/8.1.3.v20120416/
Change-Id: Ifc4bfbb3efbab0f5bfbde74f0b2ddc5a2f9ee6a5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.http.test/tst/org/eclipse')
-rw-r--r-- | org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletInitTest.java | 31 | ||||
-rw-r--r-- | org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java | 8 |
2 files changed, 27 insertions, 12 deletions
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 78db5747f7..9dfb199425 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 @@ -43,7 +43,6 @@ package org.eclipse.jgit.http.test; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -53,6 +52,7 @@ import javax.servlet.ServletException; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; +import org.eclipse.jetty.util.MultiException; import org.eclipse.jgit.http.server.GitServlet; import org.eclipse.jgit.junit.http.AppServer; import org.eclipse.jgit.junit.http.MockServletConfig; @@ -100,15 +100,28 @@ public class GitServletInitTest { ServletContextHandler app = server.addContext("/"); ServletHolder s = app.addServlet(GitServlet.class, "/git"); s.setInitOrder(1); + s.getServletHandler().setStartWithUnavailable(false); - server.setUp(); - - List<RecordingLogger.Warning> events = RecordingLogger.getWarnings(); - assertFalse("Servlet started without base-path", events.isEmpty()); - - Throwable why = events.get(0).getCause(); - assertTrue("Caught ServletException", why instanceof ServletException); - assertTrue("Wanted base-path", why.getMessage().contains("base-path")); + try { + server.setUp(); + } catch (Exception e) { + Throwable why = null; + if (e instanceof MultiException) { + MultiException multi = (MultiException) e; + List<Throwable> reasons = multi.getThrowables(); + why = reasons.get(0); + assertTrue("Expected ServletException", + why instanceof ServletException); + } else if (e instanceof ServletException) + why = e; + + if (why != null) { + assertTrue("Wanted base-path", + why.getMessage().contains("base-path")); + return; + } + } + fail("Expected ServletException complaining about unset base-path"); } @Test diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java index 2a39c9f39c..4db7430ba9 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java @@ -57,9 +57,11 @@ import java.io.IOException; import java.io.PrintWriter; import java.net.URISyntaxException; import java.util.Collections; +import java.util.EnumSet; import java.util.List; import java.util.Map; +import javax.servlet.DispatcherType; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; @@ -70,7 +72,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.servlet.FilterHolder; -import org.eclipse.jetty.servlet.FilterMapping; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jgit.errors.RemoteRepositoryException; @@ -89,9 +90,9 @@ import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevBlob; import org.eclipse.jgit.revwalk.RevCommit; -import org.eclipse.jgit.storage.file.ReflogEntry; import org.eclipse.jgit.storage.file.FileBasedConfig; import org.eclipse.jgit.storage.file.FileRepository; +import org.eclipse.jgit.storage.file.ReflogEntry; import org.eclipse.jgit.storage.file.ReflogReader; import org.eclipse.jgit.transport.FetchConnection; import org.eclipse.jgit.transport.HttpTransport; @@ -160,7 +161,8 @@ public class SmartClientSmartServerTest extends HttpTestCase { public void destroy() { // } - }), "/" + srcName + "/git-upload-pack", FilterMapping.DEFAULT); + }), "/" + srcName + "/git-upload-pack", EnumSet + .of(DispatcherType.REQUEST)); broken.addServlet(new ServletHolder(gs), "/*"); server.setUp(); |