incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r991566 - in /sling/trunk: bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/ launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/
Date Wed, 01 Sep 2010 15:14:15 GMT
Author: justin
Date: Wed Sep  1 15:14:14 2010
New Revision: 991566

URL: http://svn.apache.org/viewvc?rev=991566&view=rev
Log:
SLING-1408 - adding support for multi-valued proeprties in text renderer

Modified:
    sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/PlainTextRendererServlet.java
    sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/PropertyRenderingTest.java

Modified: sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/PlainTextRendererServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/PlainTextRendererServlet.java?rev=991566&r1=991565&r2=991566&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/PlainTextRendererServlet.java
(original)
+++ sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/PlainTextRendererServlet.java
Wed Sep  1 15:14:14 2010
@@ -65,6 +65,8 @@ public class PlainTextRendererServlet ex
             dump(pw, r, map);
         } else if ( r.adaptTo(String.class) != null ) {
             printPropertyValue(pw, ResourceUtil.getName(r), r.adaptTo(String.class), false);
+        } else if ( r.adaptTo(String[].class) != null ) {
+            printPropertyValue(pw, ResourceUtil.getName(r), r.adaptTo(String[].class), false);
         } else {
             resp.sendError(HttpServletResponse.SC_NO_CONTENT);
         }

Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/PropertyRenderingTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/PropertyRenderingTest.java?rev=991566&r1=991565&r2=991566&view=diff
==============================================================================
--- sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/PropertyRenderingTest.java
(original)
+++ sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/PropertyRenderingTest.java
Wed Sep  1 15:14:14 2010
@@ -94,6 +94,16 @@ public class PropertyRenderingTest exten
         assertTrue(data.contains(testMultiText2));
     }
 
+    public void testMultiValuedTextTxt() throws IOException {
+        final String data = getContent(displayUrl + "/multiText.txt", CONTENT_TYPE_PLAIN);
+        assertEquals("[" + testMultiText1 + ", " + testMultiText2 + "]", data);
+    }
+
+    public void testMultiValuedTextNoExt() throws IOException {
+        // multi-valued properties can't be adapted to a stream, so this returns an error
+        assertHttpStatus(displayUrl + "/multiText", 403);
+    }
+
     public void testResourceTypeNoExt() throws IOException {
         final String data = getContent(displayUrl + "/sling:resourceType", null);
         assertEquals(slingResourceType, data);



Mime
View raw message