Add an explicit test for JSPs. Grails - that is using a variant of this - seems to...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 12 Oct 2009 17:28:49 +0000 (17:28 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 12 Oct 2009 17:28:49 +0000 (17:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@824432 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/catalina/startup/TestTomcat.java

index 9bae9d4..98b4c01 100644 (file)
@@ -137,6 +137,21 @@ public class TestTomcat extends TestTomcatBase {
         assertTrue(res.toString().indexOf("<h1>Hello World!</h1>") > 0);
     }
     
+    public void testJsps() throws Exception {
+        Tomcat tomcat = getTomcatInstance();
+
+        File appDir = 
+            new File("output/build/webapps/examples");
+        // app dir is relative to server home
+        tomcat.addWebapp(null, "/examples", appDir.getAbsolutePath());
+        
+        tomcat.start();
+
+        ByteChunk res = getUrl("http://localhost:" + getPort() +
+                "/examples/jsp/jsp2/el/basic-arithmetic.jsp");
+        assertTrue(res.toString().indexOf("<td>${(1==2) ? 3 : 4}</td>") > 0);
+    }
+    
     public void testLaunchTime() throws Exception {
         Tomcat tomcat = getTomcatInstance();
         long t0 = System.currentTimeMillis();