Author: bdelacretaz
Date: Wed Aug  5 14:42:33 2009
New Revision: 801242

URL: http://svn.apache.org/viewvc?rev=801242&view=rev
Log:
testChangingJsp() added - currently fails, seems like dynamic classloader 
caches compiled JSP classes forever

Modified:
    
sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspScriptingTest.java

Modified: 
sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspScriptingTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspScriptingTest.java?rev=801242&r1=801241&r2=801242&view=diff
==============================================================================
--- 
sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspScriptingTest.java
 (original)
+++ 
sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspScriptingTest.java
 Wed Aug  5 14:42:33 2009
@@ -79,6 +79,25 @@
         }
     }
     
+    /* Verify that overwriting a JSP script changes the output immediately */
+    public void testChangingJsp() throws Exception {
+        String toDelete = null;
+        
+        try {
+            final String [] scripts = { "jsp1.jsp", "jsp2.jsp" };
+            for(String script : scripts) {
+                toDelete = uploadTestScript(unstructuredNode.scriptPath, 
script, "html.jsp");
+                final String content = getContent(unstructuredNode.nodeUrl + 
".html", CONTENT_TYPE_HTML);
+                final String expected = "text from " + script + ":" + 
unstructuredNode.testText; 
+                assertTrue("Content contains '" + expected + "'(" + content + 
")", content.contains(expected));
+            }
+        } finally {
+            if(toDelete != null) {
+                testClient.delete(toDelete);
+            }
+        }
+    }
+
     private void checkContent(TestNode tn) throws Exception {
         final String content = getContent(tn.nodeUrl + ".html", 
CONTENT_TYPE_HTML);
         assertTrue("JSP script executed as expected (" + content + ")", 
content.contains("<h1>JSP rendering result</h1>"));


Reply via email to