incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r603602 - in /incubator/sling/trunk/microsling/microsling-core/src/test: java/org/apache/sling/microsling/integration/SlingResourceTypeRenderingTest.java resources/integration-test/rendering-test.esp
Date Wed, 12 Dec 2007 12:40:58 GMT
Author: bdelacretaz
Date: Wed Dec 12 04:40:58 2007
New Revision: 603602

URL: http://svn.apache.org/viewvc?rev=603602&view=rev
Log:
add test for java code access from ESP template

Modified:
    incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/integration/SlingResourceTypeRenderingTest.java
    incubator/sling/trunk/microsling/microsling-core/src/test/resources/integration-test/rendering-test.esp

Modified: incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/integration/SlingResourceTypeRenderingTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/integration/SlingResourceTypeRenderingTest.java?rev=603602&r1=603601&r2=603602&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/integration/SlingResourceTypeRenderingTest.java
(original)
+++ incubator/sling/trunk/microsling/microsling-core/src/test/java/org/apache/sling/microsling/integration/SlingResourceTypeRenderingTest.java
Wed Dec 12 04:40:58 2007
@@ -71,6 +71,17 @@
         }
     }
 
+    public void testEspJavaCode() throws IOException {
+        final String toDelete = uploadTestScript("rendering-test.esp","html.esp");
+        try {
+            final String content = getContent(displayUrl + ".html", CONTENT_TYPE_HTML);
+            assertTrue("Content includes ESP marker",content.contains("ESP template"));
+            assertTrue("Content contains java code output",content.contains("TestLinkedListTest"));
+        } finally {
+            testClient.delete(toDelete);
+        }
+    }
+
     public void testEspHtmlInAppsFolder() throws IOException {
         // make sure there's no leftover rendering script
         {

Modified: incubator/sling/trunk/microsling/microsling-core/src/test/resources/integration-test/rendering-test.esp
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/test/resources/integration-test/rendering-test.esp?rev=603602&r1=603601&r2=603602&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/test/resources/integration-test/rendering-test.esp
(original)
+++ incubator/sling/trunk/microsling/microsling-core/src/test/resources/integration-test/rendering-test.esp
Wed Dec 12 04:40:58 2007
@@ -4,4 +4,11 @@
 		ESP template
 		<p><%= resource.node.text %></p>
 	</body>
+	
+	<!-- test access to microsling java classes -->
+	<%
+		var list = new Packages.java.util.LinkedList();
+		list.add("LinkedListTest");
+	%>
+	<p>Test<%= list.get(0) %></p>
 </html>



Mime
View raw message