summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.test
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2012-05-23 22:21:58 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2012-05-23 22:21:58 +0200
commit24a0f47e32ab7cdf20c2201d7100599ea057f8a3 (patch)
tree4f48651fbc71bced0469f771b855ff9aa63d670d /org.eclipse.jgit.http.test
parent23e0a3e734beaed5af14d8fb64c5a8285631adc1 (diff)
downloadjgit-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')
-rw-r--r--org.eclipse.jgit.http.test/META-INF/MANIFEST.MF26
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/GitServletInitTest.java31
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java8
3 files changed, 38 insertions, 27 deletions
diff --git a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF
index f015d7b24a..e348924968 100644
--- a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF
@@ -6,21 +6,16 @@ Bundle-Version: 2.0.0.qualifier
Bundle-Vendor: %provider_name
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: javax.servlet;version="[2.5.0,3.0.0)",
- javax.servlet.http;version="[2.5.0,3.0.0)",
- org.eclipse.jetty.continuation;version="[7.1.0,7.6.0)",
- org.eclipse.jetty.http;version="[7.1.0,7.6.0)",
- org.eclipse.jetty.http.security;version="[7.1.0,7.6.0)",
- org.eclipse.jetty.io;version="[7.1.0,7.6.0)",
- org.eclipse.jetty.security;version="[7.1.0,7.6.0)",
- org.eclipse.jetty.security.authentication;version="[7.1.0,7.6.0)",
- org.eclipse.jetty.server;version="[7.1.0,7.6.0)",
- org.eclipse.jetty.server.handler;version="[7.1.0,7.6.0)",
- org.eclipse.jetty.server.nio;version="[7.1.0,7.6.0)",
- org.eclipse.jetty.servlet;version="[7.1.0,7.6.0)",
- org.eclipse.jetty.util.component;version="[7.1.0,7.6.0)",
- org.eclipse.jetty.util.log;version="[7.1.0,7.6.0)",
- org.eclipse.jetty.util.thread;version="[7.1.0,7.6.0)",
+Import-Package: javax.servlet;version="[3.0.0,4.0.0)",
+ javax.servlet.http;version="[3.0.0,4.0.0)",
+ org.eclipse.jetty.continuation;version="[8.1.0,9.0.0)",
+ org.eclipse.jetty.client.security;version="[8.1.0,9.0.0)",
+ org.eclipse.jetty.http;version="[8.1.0,9)",
+ org.eclipse.jetty.http.ssl;version="[8.1.0,9.0.0)",
+ org.eclipse.jetty.io;version="[8.1.0,9)",
+ org.eclipse.jetty.server.handler;version="[8.1.0,9.0.0)",
+ org.eclipse.jetty.servlet;version="[8.1.0,9.0.0)",
+ org.eclipse.jetty.util;version="[8.1.0,9.0.0)",
org.eclipse.jgit.errors;version="[2.0.0,2.1.0)",
org.eclipse.jgit.http.server;version="[2.0.0,2.1.0)",
org.eclipse.jgit.http.server.glue;version="[2.0.0,2.1.0)",
@@ -37,3 +32,4 @@ Import-Package: javax.servlet;version="[2.5.0,3.0.0)",
org.eclipse.jgit.util;version="[2.0.0,2.1.0)",
org.hamcrest.core;version="[1.1.0,2.0.0)",
org.junit;version="[4.0.0,5.0.0)"
+Require-Bundle: org.eclipse.jetty.server;bundle-version="[8.1.0,9.0.0)"
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();