diff options
author | Thomas Watson | 2017-10-19 13:22:12 +0000 |
---|---|---|
committer | Thomas Watson | 2017-10-19 14:13:37 +0000 |
commit | f2424627bcaa7b5f454ce5caf96347f75e7d2b8e (patch) | |
tree | 17390bcb05e32cecffc6dd2c8ce1d46c3c6dc259 | |
parent | ccab0d5d62aadc4e3f0e4a80420d83d6395df1fb (diff) | |
download | rt.equinox.bundles-f2424627bcaa7b5f454ce5caf96347f75e7d2b8e.tar.gz rt.equinox.bundles-f2424627bcaa7b5f454ce5caf96347f75e7d2b8e.tar.xz rt.equinox.bundles-f2424627bcaa7b5f454ce5caf96347f75e7d2b8e.zip |
Bug 526150 - HttpService createDefaultHttpContext does not comply withS4_8_0_M3aS4_8_0_M3I20171103-1105I20171103-0715I20171103-0405I20171102-2000I20171101-2000I20171031-2000I20171030-2000I20171030-0400I20171029-2000I20171028-1500I20171027-2340I20171027-2000I20171025-2000I20171025-0800I20171024-2000I20171024-0800I20171023-2000I20171023-0800I20171022-2000I20171022-0800I20171021-1500I20171020-2000I20171019-2000
the OSGi spec
Change-Id: I918a6adecaf2808914f9a6dec5804fdde12c6e37
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
4 files changed, 30 insertions, 5 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; diff --git a/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF index 2ec3648aa..02d9c75ae 100644 --- a/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %bundleName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.equinox.http.servlet -Bundle-Version: 1.4.0.qualifier +Bundle-Version: 1.4.100.qualifier Bundle-Activator: org.eclipse.equinox.http.servlet.internal.Activator Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/bundles/org.eclipse.equinox.http.servlet/pom.xml b/bundles/org.eclipse.equinox.http.servlet/pom.xml index 30b7528bc..8446a6712 100644 --- a/bundles/org.eclipse.equinox.http.servlet/pom.xml +++ b/bundles/org.eclipse.equinox.http.servlet/pom.xml @@ -20,6 +20,6 @@ </parent> <groupId>org.eclipse.equinox</groupId> <artifactId>org.eclipse.equinox.http.servlet</artifactId> - <version>1.4.0-SNAPSHOT</version> + <version>1.4.100-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceImpl.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceImpl.java index cfd00e1ad..1cbe1ea0c 100644 --- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceImpl.java +++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2015 Cognos Incorporated, IBM Corporation and others. + * Copyright (c) 2005, 2017 Cognos Incorporated, 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 @@ -49,7 +49,7 @@ public class HttpServiceImpl implements HttpService, ExtendedHttpService { name = name.substring(1); } - return bundle.getEntry(name); + return bundle.getResource(name); } return null; } |