Fix some failing tests. No regression in Tomcat/Jasper, just need to take account...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 7 Oct 2010 15:12:21 +0000 (15:12 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 7 Oct 2010 15:12:21 +0000 (15:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1005486 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/jasper/compiler/TestGenerator.java

index 1d80c51..187e678 100644 (file)
@@ -24,6 +24,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletResponse;
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.TagData;
 import javax.servlet.jsp.tagext.TagExtraInfo;
@@ -75,15 +77,10 @@ public class TestGenerator extends TomcatBaseTest {
         
         tomcat.start();
 
-        Exception e = null;
-        try {
-            getUrl("http://localhost:" + getPort() + "/test/bug45nnn/bug45015b.jsp");
-        } catch (IOException ioe) {
-            e = ioe;
-        }
-
-        // Failure is expected
-        assertNotNull(e);
+        int rc = getUrl("http://localhost:" + getPort() +
+                "/test/bug45nnn/bug45015b.jsp", new ByteChunk(), null);
+        
+        assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, rc);
     }
 
     public void testBug45015c() throws Exception {
@@ -96,15 +93,10 @@ public class TestGenerator extends TomcatBaseTest {
         
         tomcat.start();
 
-        Exception e = null;
-        try {
-            getUrl("http://localhost:" + getPort() + "/test/bug45nnn/bug45015c.jsp");
-        } catch (IOException ioe) {
-            e = ioe;
-        }
-
-        // Failure is expected
-        assertNotNull(e);
+        int rc = getUrl("http://localhost:" + getPort() +
+                "/test/bug45nnn/bug45015c.jsp", new ByteChunk(), null);
+        
+        assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, rc);
     }
 
     public void testBug48701Fail() throws Exception {
@@ -122,15 +114,10 @@ public class TestGenerator extends TomcatBaseTest {
         
         tomcat.start();
 
-        Exception e = null;
-        try {
-            getUrl("http://localhost:" + getPort() + "/test/bug48nnn/bug48701-fail.jsp");
-        } catch (IOException ioe) {
-            e = ioe;
-        }
-
-        // Failure is expected
-        assertNotNull(e);
+        int rc = getUrl("http://localhost:" + getPort() +
+                "/test/bug48nnn/bug48701-fail.jsp", new ByteChunk(), null);
+        
+        assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, rc);
     }
 
     public void testBug48701UseBean() throws Exception {