incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r631948 - in /incubator/sling/trunk/scripting/javascript/src: main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableNode.java test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java
Date Thu, 28 Feb 2008 12:56:04 GMT
Author: bdelacretaz
Date: Thu Feb 28 04:56:00 2008
New Revision: 631948

URL: http://svn.apache.org/viewvc?rev=631948&view=rev
Log:
SLING-282 - ScriptableNode.getProperty added

Modified:
    incubator/sling/trunk/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableNode.java
    incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java

Modified: incubator/sling/trunk/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableNode.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableNode.java?rev=631948&r1=631947&r2=631948&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableNode.java
(original)
+++ incubator/sling/trunk/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableNode.java
Thu Feb 28 04:56:00 2008
@@ -116,6 +116,10 @@
             return Undefined.instance;
         }
     }
+    
+    public ScriptableProperty jsFunction_getProperty(String name) throws RepositoryException
{
+        return new ScriptableProperty(node.getProperty(name));
+    }
 
     public String jsFunction_getUUID() {
         try {

Modified: incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java?rev=631948&r1=631947&r2=631948&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java
(original)
+++ incubator/sling/trunk/scripting/javascript/src/test/java/org/apache/sling/scripting/wrapper/ScriptableNodeTest.java
Thu Feb 28 04:56:00 2008
@@ -138,4 +138,9 @@
         ;
         assertEquals("nt:resource", script.evalToString(code, data));
     }
+
+    public void testGetProperty() throws Exception {
+        final String code = "out.print(node.getProperty('text'));";
+        assertEquals(testText, script.evalToString(code, data));
+    }
 }



Mime
View raw message