Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Auge2015-07-02 20:03:44 +0000
committerRaymond Auge2015-07-02 20:03:44 +0000
commitcc9aead0aac05480e919d695e2e1f3e1eb873225 (patch)
tree47bd11f8c0ad194a593e6199dfba085972f8ee29 /bundles/org.eclipse.equinox.http.servlet.tests
parentfadccc5c64fa9b9989c11725cdaa0c2740abbd0b (diff)
downloadrt.equinox.bundles-cc9aead0aac05480e919d695e2e1f3e1eb873225.tar.gz
rt.equinox.bundles-cc9aead0aac05480e919d695e2e1f3e1eb873225.tar.xz
rt.equinox.bundles-cc9aead0aac05480e919d695e2e1f3e1eb873225.zip
Bug 471724 - [http.servlet] TCCL is not being kept as expected during registration using the HttpService API
Signed-off-by: Raymond Auge <raymond.auge@liferay.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.http.servlet.tests')
-rw-r--r--bundles/org.eclipse.equinox.http.servlet.tests/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/ServletTest.java8
2 files changed, 8 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet.tests/pom.xml b/bundles/org.eclipse.equinox.http.servlet.tests/pom.xml
index 66671ea65..f96c37f84 100644
--- a/bundles/org.eclipse.equinox.http.servlet.tests/pom.xml
+++ b/bundles/org.eclipse.equinox.http.servlet.tests/pom.xml
@@ -14,7 +14,7 @@
<parent>
<artifactId>tests-pom</artifactId>
<groupId>org.eclipse.equinox.bundles</groupId>
- <version>4.5.0-SNAPSHOT</version>
+ <version>4.6.0-SNAPSHOT</version>
<relativePath>../../tests-pom/</relativePath>
</parent>
<groupId>org.eclipse.equinox</groupId>
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 51bfa568e..96d5988c6 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
@@ -1195,7 +1195,12 @@ public class ServletTest extends TestCase {
}
};
- String expected = Thread.currentThread().getContextClassLoader().getClass().getName();
+
+ ClassLoader originalTCCL = Thread.currentThread().getContextClassLoader();
+ ClassLoader dummy = new ClassLoader() {
+ };
+ Thread.currentThread().setContextClassLoader(dummy);
+ String expected = dummy.getClass().getName();
String actual = null;
ExtendedHttpService extendedHttpService = (ExtendedHttpService)getHttpService();
try {
@@ -1205,6 +1210,7 @@ public class ServletTest extends TestCase {
} catch (Exception e) {
fail("Unexpected exception: " + e);
} finally {
+ Thread.currentThread().setContextClassLoader(originalTCCL);
try {
extendedHttpService.unregister("/tccl");
extendedHttpService.unregisterFilter(tcclFilter);

Back to the top