Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Auge2015-04-26 04:05:42 +0000
committerRaymond Auge2015-04-28 08:23:45 +0000
commitf8d19cfc971f73ae38a2f4ab5ce593f2cb03b366 (patch)
treeaea323204a6d93eb62e893061e2b4932abf1fbd9
parent4bb11dc145ce19c84f9c06c46a5ed2c520a1df07 (diff)
downloadrt.equinox.bundles-f8d19cfc971f73ae38a2f4ab5ce593f2cb03b366.tar.gz
rt.equinox.bundles-f8d19cfc971f73ae38a2f4ab5ce593f2cb03b366.tar.xz
rt.equinox.bundles-f8d19cfc971f73ae38a2f4ab5ce593f2cb03b366.zip
Bug 465445 - test showing miss-handling of exception on committed response
Signed-off-by: Raymond Auge <raymond.auge@liferay.com>
-rw-r--r--bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/ServletTest.java33
1 files changed, 33 insertions, 0 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 938d6ef0..0cd1d384 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
@@ -380,6 +380,39 @@ public class ServletTest extends TestCase {
Assert.assertEquals("500 : 500 : ERROR : /TestErrorPage9/a", responseBody);
}
+ public void test_ErrorPage10() throws Exception {
+ Servlet servlet = new HttpServlet() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void doGet(
+ HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException {
+
+ resp.getWriter().write("some output");
+ resp.flushBuffer();
+
+ throw new IOException();
+ }
+ };
+
+ Dictionary<String, Object> props = new Hashtable<String, Object>();
+ props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME, "E10");
+ props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, "/TestErrorPage10/*");
+ registrations.add(getBundleContext().registerService(Servlet.class, servlet, props));
+
+ try {
+ requestAdvisor.request("TestErrorPage10/a");
+ }
+ catch (Exception e) {
+ Assert.assertTrue(e instanceof IOException);
+
+ return;
+ }
+
+ Assert.fail("Expecting java.io.IOException: Premature EOF");
+ }
+
public void test_Filter1() throws Exception {
String expected = "bab";
String actual;

Back to the top