Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2017-10-19 13:22:12 +0000
committerThomas Watson2017-10-19 14:13:37 +0000
commitf2424627bcaa7b5f454ce5caf96347f75e7d2b8e (patch)
tree17390bcb05e32cecffc6dd2c8ce1d46c3c6dc259 /bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http
parentccab0d5d62aadc4e3f0e4a80420d83d6395df1fb (diff)
downloadrt.equinox.bundles-f2424627bcaa7b5f454ce5caf96347f75e7d2b8e.tar.gz
rt.equinox.bundles-f2424627bcaa7b5f454ce5caf96347f75e7d2b8e.tar.xz
rt.equinox.bundles-f2424627bcaa7b5f454ce5caf96347f75e7d2b8e.zip
the OSGi spec Change-Id: I918a6adecaf2808914f9a6dec5804fdde12c6e37 Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http')
-rw-r--r--bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/ServletTest.java27
1 files changed, 26 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/ServletTest.java b/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/ServletTest.java
index a0f8b4863..11ee568b5 100644
--- a/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/ServletTest.java
+++ b/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/ServletTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2016 IBM Corporation and others.
+ * Copyright (c) 2011, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -2198,6 +2198,31 @@ public class ServletTest extends BaseTest {
// }
@Test
+ public void test_Servlet18() throws Exception {
+ Servlet sA = new HttpServlet() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void service(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ // get a resource that is imported
+ URL url = request.getServletContext().getResource("org/osgi/service/http/HttpService.class");
+ response.getWriter().write(url == null ? "null" : url.getProtocol());
+ }
+
+ };
+
+ HttpService httpService = getHttpService();
+
+ HttpContext httpContext = httpService.createDefaultHttpContext();
+
+ httpService.registerServlet("/testDefaultHttpContextResource", sA, null, httpContext);
+
+ // just making sure bundleresource protocol is used as proof that Bundle.getResource was called
+ Assert.assertEquals("bundleresource", requestAdvisor.request("testDefaultHttpContextResource"));
+ }
+
+ @Test
public void test_commonsFileUpload() throws Exception {
Servlet servlet = new HttpServlet() {
private static final long serialVersionUID = 1L;

Back to the top