jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1359217 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/ oak-mk-api/src/main/java/org/apache/jackrabbit/mk/api/ oak-mk/src/main/java/org/apache/jack...
Date Mon, 09 Jul 2012 15:25:51 GMT
Author: jukka
Date: Mon Jul  9 15:25:50 2012
New Revision: 1359217

URL: http://svn.apache.org/viewvc?rev=1359217&view=rev
Log:
OAK-173: MicroKernel filter syntax is not proper JSON

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
    jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
    jackrabbit/oak/trunk/oak-mk-api/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java?rev=1359217&r1=1359216&r2=1359217&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
Mon Jul  9 15:25:50 2012
@@ -92,7 +92,7 @@ final class KernelNodeState extends Abst
         if (properties == null) {
             String json = kernel.getNodes(
                     path, revision, 0, 0, MAX_CHILD_NODE_NAMES,
-                    "{properties:[\"*\",\":hash\"]}");
+                    "{\"properties\":[\"*\",\":hash\"]}");
 
             JsopReader reader = new JsopTokenizer(json);
             reader.read('{');

Modified: jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java?rev=1359217&r1=1359216&r2=1359217&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
(original)
+++ jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
Mon Jul  9 15:25:50 2012
@@ -413,11 +413,11 @@ public class MicroKernelIT extends Abstr
         // :hash must be explicitly specified in the filter
         JSONObject obj = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, null));
         assertPropertyNotExists(obj, ":hash");
-        obj = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, "{properties:[\"*\"]}"));
+        obj = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, "{\"properties\":[\"*\"]}"));
         assertPropertyNotExists(obj, ":hash");
 
         // verify initial content with :hash property
-        obj = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, "{properties:[\"*\",\":hash\"]}"));
+        obj = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, "{\"properties\":[\"*\",\":hash\"]}"));
         assertPropertyValue(obj, "test/booleanProp", true);
 
         if (obj.get(":hash") == null) {
@@ -430,7 +430,7 @@ public class MicroKernelIT extends Abstr
 
         // modify a property and verify that the hash of the root node changed
         mk.commit("/test", "^\"booleanProp\":false", null, null);
-        obj = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, "{properties:[\"*\",\":hash\"]}"));
+        obj = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, "{\"properties\":[\"*\",\":hash\"]}"));
         assertPropertyValue(obj, "test/booleanProp", false);
 
         assertPropertyExists(obj, ":hash", String.class);
@@ -441,7 +441,7 @@ public class MicroKernelIT extends Abstr
         // undo property modification and verify that the hash
         // of the root node is now the same as before the modification
         mk.commit("/test", "^\"booleanProp\":true", null, null);
-        obj = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, "{properties:[\"*\",\":hash\"]}"));
+        obj = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, "{\"properties\":[\"*\",\":hash\"]}"));
         assertPropertyValue(obj, "test/booleanProp", true);
 
         assertPropertyExists(obj, ":hash", String.class);
@@ -460,14 +460,14 @@ public class MicroKernelIT extends Abstr
         long count = (Long) resolveValue(obj, ":childNodeCount") ;
         assertEquals(count, mk.getChildNodeCount("/", null));
 
-        obj = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, "{properties:[\"*\"]}"));
+        obj = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, "{\"properties\":[\"*\"]}"));
         assertPropertyExists(obj, ":childNodeCount", Long.class);
         assertPropertyExists(obj, "test/:childNodeCount", Long.class);
         count = (Long) resolveValue(obj, ":childNodeCount") ;
         assertEquals(count, mk.getChildNodeCount("/", null));
 
         // explicitly exclude :childNodeCount
-        obj = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, "{properties:[\"*\",\"-:childNodeCount\"]}"));
+        obj = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, "{\"properties\":[\"*\",\"-:childNodeCount\"]}"));
         assertPropertyNotExists(obj, ":childNodeCount");
         assertPropertyNotExists(obj, "test/:childNodeCount");
     }
@@ -477,7 +477,7 @@ public class MicroKernelIT extends Abstr
         String head = mk.getHeadRevision();
 
         // verify initial content using filter
-        String filter = "{ properties : [ \"*ntProp\", \"-mult*\" ] } ";
+        String filter = "{ \"properties\" : [ \"*ntProp\", \"-mult*\" ] } ";
         JSONObject obj = parseJSONObject(mk.getNodes("/", head, 1, 0, -1, filter));
         assertPropertyExists(obj, "test/intProp");
         assertPropertyNotExists(obj, "test/multiIntProp");
@@ -637,7 +637,7 @@ public class MicroKernelIT extends Abstr
 
         // test offset with filter
         try {
-            parseJSONObject(mk.getNodes("/testRoot", head, 0, 10, NUM_SIBLINGS / 10, "{nodes:[\"n0*\"]}"));
+            parseJSONObject(mk.getNodes("/testRoot", head, 0, 10, NUM_SIBLINGS / 10, "{\"nodes\":[\"n0*\"]}"));
             fail();
         } catch (Throwable e) {
             // expected
@@ -699,7 +699,7 @@ public class MicroKernelIT extends Abstr
 
         // get max 5 siblings using filter
         maxSiblings = 5;
-        obj = parseJSONObject(mk.getNodes("/testRoot", head, 1, 0, maxSiblings, "{nodes:[\"n1*\"]}"));
+        obj = parseJSONObject(mk.getNodes("/testRoot", head, 1, 0, maxSiblings, "{\"nodes\":[\"n1*\"]}"));
         assertPropertyValue(obj, ":childNodeCount", (long) NUM_SIBLINGS);
         assertEquals((long) NUM_SIBLINGS, mk.getChildNodeCount("/testRoot", head));
         names = getNodeNames(obj);

Modified: jackrabbit/oak/trunk/oak-mk-api/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-api/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java?rev=1359217&r1=1359216&r2=1359217&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-api/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java
(original)
+++ jackrabbit/oak/trunk/oak-mk-api/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java
Mon Jul  9 15:25:50 2012
@@ -292,8 +292,8 @@ public interface MicroKernel {
      * Example:
      * <pre>
      * {
-     *   nodes: [ "foo*", "-foo1" ],
-     *   properties: [ "*", "-:childNodeCount" ]
+     *   "nodes": [ "foo*", "-foo1" ],
+     *   "properties": [ "*", "-:childNodeCount" ]
      * }
      * </pre>
      * In the above example all child nodes with names starting with "foo" will
@@ -315,7 +315,7 @@ public interface MicroKernel {
      * none of the exclusion patterns.</li>
      * </ul>
      * If no filter is specified the implicit default filter is assumed:
-     * {@code {nodes:["*"],properties:["*"]}}
+     * {@code {"nodes":["*"],"properties":["*"]}}
      * <p/>
      * System-provided metadata properties:
      * <ul>

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java?rev=1359217&r1=1359216&r2=1359217&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
Mon Jul  9 15:25:50 2012
@@ -667,7 +667,7 @@ public class MicroKernelImpl implements 
             NameFilter nodeFilter = null, propFilter = null;
 
             do {
-                String type = t.readRawValue();
+                String type = t.readString();
                 t.read(':');
                 String[] globs = parseArray(t);
                 if (type.equals("nodes")) {



Mime
View raw message