jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1375930 [2/2] - in /jackrabbit/oak/trunk: oak-bench/base/src/main/java/org/apache/jackrabbit/oak/performance/ oak-core/src/main/java/org/apache/jackrabbit/mk/index/ oak-core/src/main/java/org/apache/jackrabbit/oak/core/ oak-core/src/main/j...
Date Wed, 22 Aug 2012 08:04:52 GMT
Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/IndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/IndexTest.java?rev=1375930&r1=1375929&r2=1375930&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/IndexTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/IndexTest.java
Wed Aug 22 08:04:51 2012
@@ -22,6 +22,10 @@ import java.util.TreeMap;
 import junit.framework.Assert;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
+import org.apache.jackrabbit.oak.plugins.index.BTree;
+import org.apache.jackrabbit.oak.plugins.index.Cursor;
+import org.apache.jackrabbit.oak.plugins.index.Indexer;
+import org.apache.jackrabbit.oak.plugins.index.PropertyIndex;
 import org.junit.Test;
 
 /**

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PrefixIndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PrefixIndexTest.java?rev=1375930&r1=1375929&r2=1375930&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PrefixIndexTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PrefixIndexTest.java
Wed Aug 22 08:04:51 2012
@@ -20,6 +20,8 @@ import java.util.Iterator;
 import junit.framework.Assert;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
+import org.apache.jackrabbit.oak.plugins.index.Indexer;
+import org.apache.jackrabbit.oak.plugins.index.PrefixIndex;
 import org.junit.Test;
 
 /**

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PropertyIndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PropertyIndexTest.java?rev=1375930&r1=1375929&r2=1375930&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PropertyIndexTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/index/PropertyIndexTest.java
Wed Aug 22 08:04:51 2012
@@ -19,6 +19,8 @@ package org.apache.jackrabbit.mk.index;
 import junit.framework.Assert;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
+import org.apache.jackrabbit.oak.plugins.index.Indexer;
+import org.apache.jackrabbit.oak.plugins.index.PropertyIndex;
 import org.junit.Test;
 
 /**

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java?rev=1375930&r1=1375929&r2=1375930&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/mk/wrapper/IndexWrapperTest.java
Wed Aug 22 08:04:51 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.mk.wrapper;
 
+import static org.apache.jackrabbit.oak.plugins.index.Indexer.INDEX_CONFIG_PATH;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import org.apache.jackrabbit.mk.api.MicroKernel;
@@ -36,47 +37,47 @@ public class IndexWrapperTest {
 
     @Test
     public void getNodes() {
-        assertNull(mk.getNodes("/jcr:system/indexes/unknown", head, 1, 0, -1, null));
+        assertNull(mk.getNodes(INDEX_CONFIG_PATH + "/unknown", head, 1, 0, -1, null));
         assertNull(mk.getNodes("/unknown", head, 1, 0, -1, null));
     }
 
     @Test
     public void prefix() {
-        head = mk.commit("/jcr:system/indexes", "+ \"prefix@x\": {}", head, "");
+        head = mk.commit(INDEX_CONFIG_PATH, "+ \"prefix@x\": {}", head, "");
         head = mk.commit("/", "+ \"n1\": { \"value\":\"a:no\" }", head, "");
         head = mk.commit("/", "+ \"n2\": { \"value\":\"x:yes\" }", head, "");
         head = mk.commit("/", "+ \"n3\": { \"value\":\"x:a\" }", head, "");
         head = mk.commit("/", "+ \"n4\": { \"value\":\"x:a\" }", head, "");
-        String empty = mk.getNodes("/jcr:system/indexes/prefix@x?x:no", head, 1, 0, -1, null);
+        String empty = mk.getNodes(INDEX_CONFIG_PATH + "/prefix@x?x:no", head, 1, 0, -1,
null);
         assertEquals("[]", empty);
-        String yes = mk.getNodes("/jcr:system/indexes/prefix@x?x:yes", head, 1, 0, -1, null);
+        String yes = mk.getNodes(INDEX_CONFIG_PATH + "/prefix@x?x:yes", head, 1, 0, -1, null);
         assertEquals("[\"/n2/value\"]", yes);
-        String a = mk.getNodes("/jcr:system/indexes/prefix@x?x:a", head, 1, 0, -1, null);
+        String a = mk.getNodes(INDEX_CONFIG_PATH + "/prefix@x?x:a", head, 1, 0, -1, null);
         assertEquals("[\"/n3/value\",\"/n4/value\"]", a);
     }
 
     @Test
     public void propertyUnique() {
-        head = mk.commit("/jcr:system/indexes", "+ \"property@id,unique\": {}", head, "");
+        head = mk.commit(INDEX_CONFIG_PATH, "+ \"property@id,unique\": {}", head, "");
         head = mk.commit("/", "+ \"n1\": { \"value\":\"empty\" }", head, "");
         head = mk.commit("/", "+ \"n2\": { \"id\":\"1\" }", head, "");
-        String empty = mk.getNodes("/jcr:system/indexes/property@id,unique?0", head, 1, 0,
-1, null);
+        String empty = mk.getNodes(INDEX_CONFIG_PATH + "/property@id,unique?0", head, 1,
0, -1, null);
         assertEquals("[]", empty);
-        String one = mk.getNodes("/jcr:system/indexes/property@id,unique?1", head, 1, 0,
-1, null);
+        String one = mk.getNodes(INDEX_CONFIG_PATH + "/property@id,unique?1", head, 1, 0,
-1, null);
         assertEquals("[\"/n2\"]", one);
     }
 
     @Test
     public void propertyNonUnique() {
-        head = mk.commit("/jcr:system/indexes", "+ \"property@ref\": {}", head, "");
+        head = mk.commit(INDEX_CONFIG_PATH, "+ \"property@ref\": {}", head, "");
         head = mk.commit("/", "+ \"n1\": { \"ref\":\"a\" }", head, "");
         head = mk.commit("/", "+ \"n2\": { \"ref\":\"b\" }", head, "");
         head = mk.commit("/", "+ \"n3\": { \"ref\":\"b\" }", head, "");
-        String empty = mk.getNodes("/jcr:system/indexes/property@ref?no", head, 1, 0, -1,
null);
+        String empty = mk.getNodes(INDEX_CONFIG_PATH + "/property@ref?no", head, 1, 0, -1,
null);
         assertEquals("[]", empty);
-        String one = mk.getNodes("/jcr:system/indexes/property@ref?a", head, 1, 0, -1, null);
+        String one = mk.getNodes(INDEX_CONFIG_PATH + "/property@ref?a", head, 1, 0, -1, null);
         assertEquals("[\"/n1\"]", one);
-        String two = mk.getNodes("/jcr:system/indexes/property@ref?b", head, 1, 0, -1, null);
+        String two = mk.getNodes(INDEX_CONFIG_PATH + "/property@ref?b", head, 1, 0, -1, null);
         assertEquals("[\"/n2\",\"/n3\"]", two);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java?rev=1375930&r1=1375929&r2=1375930&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java
Wed Aug 22 08:04:51 2012
@@ -29,6 +29,7 @@ import org.apache.jackrabbit.oak.api.Res
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.SessionQueryEngine;
 import org.apache.jackrabbit.oak.api.Tree;
+import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.core.ContentRepositoryImpl;
 import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
 import org.apache.jackrabbit.oak.plugins.name.NameValidatorProvider;
@@ -43,7 +44,7 @@ import org.apache.jackrabbit.oak.spi.com
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
 import org.junit.Before;
 
-import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.DEFAULT_INDEX_HOME;
+import static org.apache.jackrabbit.oak.spi.query.IndexUtils.DEFAULT_INDEX_HOME;
 import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.DEFAULT_INDEX_NAME;
 import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.createIndexNode;
 
@@ -64,11 +65,11 @@ public abstract class AbstractLuceneQuer
     @Before
     public void before() throws Exception {
         super.before();
-
         session = createAdminSession();
-        cleanupIndexNode();
+        root = session.getCurrentRoot();
         vf = session.getCoreValueFactory();
         qe = session.getQueryEngine();
+        cleanupIndexNode();
 
     }
 
@@ -98,24 +99,32 @@ public abstract class AbstractLuceneQuer
 
     /**
      * Recreates an empty index node, ready to be used in tests
-     *
+     * 
      * @throws Exception
      */
     private void cleanupIndexNode() throws Exception {
-        root = session.getCurrentRoot();
         Tree index = root.getTree(DEFAULT_INDEX_HOME);
         if (index != null) {
             index = index.getChild(TEST_INDEX_NAME);
             if (index != null) {
                 index.remove();
             }
+        } else {
+            index = root.getTree("/");
+            for (String p : PathUtils.elements(DEFAULT_INDEX_HOME)) {
+                if (index.hasChild(p)) {
+                    index = index.getChild(p);
+                } else {
+                    index = index.addChild(p);
+                }
+            }
         }
-        createIndexNode(root.getTree("/"), DEFAULT_INDEX_HOME, TEST_INDEX_NAME);
+
+        createIndexNode(root.getTree(DEFAULT_INDEX_HOME), TEST_INDEX_NAME, vf);
         root.commit(DefaultConflictHandler.OURS);
     }
 
     protected Result executeQuery(String statement) throws ParseException {
-        return qe.executeQuery(statement, SQL2, Long.MAX_VALUE, 0,
-                null, null);
+        return qe.executeQuery(statement, SQL2, Long.MAX_VALUE, 0, null, null);
     }
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java?rev=1375930&r1=1375929&r2=1375930&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java
Wed Aug 22 08:04:51 2012
@@ -16,6 +16,12 @@
  */
 package org.apache.jackrabbit.oak.plugins.lucene;
 
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
+import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.DEFAULT_INDEX_NAME;
+import static org.apache.jackrabbit.oak.spi.query.IndexUtils.DEFAULT_INDEX_HOME;
+
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
@@ -29,35 +35,29 @@ import org.apache.jackrabbit.oak.query.i
 import org.apache.jackrabbit.oak.spi.Cursor;
 import org.apache.jackrabbit.oak.spi.Filter;
 import org.apache.jackrabbit.oak.spi.QueryIndex;
+import org.apache.jackrabbit.oak.spi.query.IndexDefinition;
+import org.apache.jackrabbit.oak.spi.query.IndexDefinitionImpl;
 import org.junit.Test;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.DEFAULT_INDEX_NAME;
-import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.DEFAULT_INDEX_PATH;
-
 public class LuceneEditorTest {
 
     @Test
     public void testLucene() throws Exception {
-        LuceneIndexInfo indexInfo = new LuceneIndexInfo(DEFAULT_INDEX_NAME,
-                DEFAULT_INDEX_PATH);
+        IndexDefinition testID = new IndexDefinitionImpl(DEFAULT_INDEX_NAME,
+                LuceneIndexFactory.TYPE, DEFAULT_INDEX_HOME, false, null);
 
         KernelNodeStore store = new KernelNodeStore(new MicroKernelImpl());
-        store.setEditor(new LuceneEditor(indexInfo.getPath()));
+        store.setEditor(new LuceneEditor(testID));
         Root root = new RootImpl(store, "", new TestAcContext());
         Tree tree = root.getTree("/");
 
         tree.setProperty("foo", MemoryValueFactory.INSTANCE.createValue("bar"));
         root.commit(DefaultConflictHandler.OURS);
 
-        QueryIndex index = new LuceneIndex(store, indexInfo);
+        QueryIndex index = new LuceneIndex(store, testID);
         FilterImpl filter = new FilterImpl(null);
         filter.restrictPath("/", Filter.PathRestriction.EXACT);
-        filter.restrictProperty(
-                "foo",
-                Operator.EQUAL,
+        filter.restrictProperty("foo", Operator.EQUAL,
                 MemoryValueFactory.INSTANCE.createValue("bar"));
         Cursor cursor = index.query(filter, null, store.getRoot());
         assertTrue(cursor.next());

Added: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/query/IndexManagerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/query/IndexManagerTest.java?rev=1375930&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/query/IndexManagerTest.java
(added)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/query/IndexManagerTest.java
Wed Aug 22 08:04:51 2012
@@ -0,0 +1,183 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.spi.query;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.apache.jackrabbit.mk.api.MicroKernel;
+import org.apache.jackrabbit.mk.core.MicroKernelImpl;
+import org.apache.jackrabbit.oak.AbstractOakTest;
+import org.apache.jackrabbit.oak.api.CommitFailedException;
+import org.apache.jackrabbit.oak.api.ContentRepository;
+import org.apache.jackrabbit.oak.api.ContentSession;
+import org.apache.jackrabbit.oak.api.CoreValueFactory;
+import org.apache.jackrabbit.oak.api.Root;
+import org.apache.jackrabbit.oak.api.Tree;
+import org.apache.jackrabbit.oak.core.ContentRepositoryImpl;
+import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
+import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
+import org.apache.jackrabbit.oak.spi.state.NodeState;
+import org.apache.jackrabbit.oak.spi.state.NodeStore;
+import org.junit.Before;
+import org.junit.Test;
+
+public class IndexManagerTest extends AbstractOakTest {
+
+    protected ContentSession session;
+    private CoreValueFactory vf;
+    private final MicroKernel mk = new MicroKernelImpl();
+    private Root root;
+
+    @Override
+    protected ContentRepository createRepository() {
+        return new ContentRepositoryImpl(mk, null, (ValidatorProvider) null);
+    }
+
+    @Before
+    public void before() throws Exception {
+        super.before();
+        session = createAdminSession();
+        vf = session.getCoreValueFactory();
+        root = session.getCurrentRoot();
+
+    }
+
+    @Test
+    public void testNoDef() throws Exception {
+
+        // setup index definitions
+        String indexdef = "indexdefs" + System.currentTimeMillis();
+        root.getTree("/").addChild("test").addChild(indexdef);
+        root.commit(DefaultConflictHandler.OURS);
+
+        IndexManager im = new IndexManagerImpl("/test/" + indexdef, session, mk);
+        // setup index factory
+        im.registerIndexFactory(new TestIndexFactory());
+        im.init();
+
+        assertTrue(im.getIndexes().isEmpty());
+    }
+
+    @Test
+    public void testSimpleDef() throws Exception {
+
+        // setup index definitions
+        String indexdef = "indexdefs" + System.currentTimeMillis();
+
+        Tree test = root.getTree("/").addChild("test").addChild(indexdef);
+
+        Tree def = test.addChild("a");
+        def.setProperty("type", vf.createValue("custom"));
+        def.setProperty("other", vf.createValue("other-value"));
+        root.commit(DefaultConflictHandler.OURS);
+
+        IndexManager im = new IndexManagerImpl("/test/" + indexdef, session, mk);
+        // setup index factory
+        im.registerIndexFactory(new TestIndexFactory());
+        im.init();
+
+        assertEquals(1, im.getIndexes().size());
+        IndexDefinition id = im.getIndexes().iterator().next();
+
+        assertEquals("a", id.getName());
+        assertEquals("custom", id.getType());
+        assertNotNull(id.getProperties());
+        assertEquals("other-value", id.getProperties().get("other"));
+
+    }
+
+    @Test
+    public void testIllegalDef() throws Exception {
+        // setup index definitions
+        String indexdef = "indexdefs" + System.currentTimeMillis();
+
+        Tree test = root.getTree("/").addChild("test").addChild(indexdef);
+
+        Tree def1 = test.addChild("a");
+        def1.setProperty("type2", vf.createValue("custom"));
+        root.commit(DefaultConflictHandler.OURS);
+
+        IndexManager im = new IndexManagerImpl("/test/" + indexdef, session, mk);
+        // setup index factory
+        im.registerIndexFactory(new TestIndexFactory());
+        im.init();
+
+        assertTrue(im.getIndexes().isEmpty());
+    }
+
+    @Test
+    public void testUnknownDef() throws Exception {
+        // setup index definitions
+        String indexdef = "indexdefs" + System.currentTimeMillis();
+        Tree test = root.getTree("/").addChild("test").addChild(indexdef);
+
+        Tree def1 = test.addChild("a");
+        def1.setProperty("type", vf.createValue("custom"));
+        root.commit(DefaultConflictHandler.OURS);
+
+        IndexManager im = new IndexManagerImpl("/test/" + indexdef, session, mk);
+        im.init();
+
+        assertTrue(im.getIndexes().isEmpty());
+    }
+
+    /**
+     * Test IndexFactory, not supposed to do anything, its purpose is to just
+     * register a given index type
+     * 
+     */
+    private static class TestIndexFactory implements IndexFactory {
+
+        @Override
+        public Index createIndex(IndexDefinition indexDefinition) {
+            return new TestIndex();
+        }
+
+        @Override
+        public String[] getTypes() {
+            return new String[] { "custom" };
+        }
+
+        @Override
+        public void init(MicroKernel mk) {
+        }
+    }
+
+    private static class TestIndex implements Index {
+
+        @Override
+        public NodeState editCommit(NodeStore store, NodeState before,
+                NodeState after) throws CommitFailedException {
+            return null;
+        }
+
+        @Override
+        public IndexDefinition getDefinition() {
+            return new IndexDefinitionImpl("test", "custom", "/test", false,
+                    null);
+        }
+
+        @Override
+        public void close() throws IOException {
+        }
+
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/query/IndexManagerTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/queryTest.txt
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/queryTest.txt?rev=1375930&r1=1375929&r2=1375930&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/queryTest.txt
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/resources/org/apache/jackrabbit/oak/query/queryTest.txt
Wed Aug 22 08:04:51 2012
@@ -31,7 +31,7 @@ nt:base as nt:base /* traverse "//*" */
 select * from [nt:base] where property([*], 'REFERENCE') = CAST('123' AS REFERENCE)
 /test/a
 
-commit /jcr:system/indexes + "prefix@ref:": {}
+commit /oak-index/indexes + "prefix@ref:": {}
 
 explain select * from [nt:base] where property([*], 'REFERENCE') = CAST('123' AS REFERENCE)
 nt:base as nt:base /* prefixIndex "ref:123" */
@@ -40,7 +40,7 @@ select * from [nt:base] where property([
 /test/a
 
 commit / - "test"
-commit /jcr:system/indexes - "prefix@ref:"
+commit /oak-index/indexes - "prefix@ref:"
 
 # sql-1 query (nt:unstructured needs to be escaped in sql-2)
 
@@ -76,7 +76,7 @@ select * from [nt:base] as p inner join 
 java.lang.IllegalArgumentException: Two selectors with the same name: p
 
 commit / + "test": { "a": { "id": "10" }, "b": { "id" : "20" }}
-commit /jcr:system/indexes + "property@id,unique": {}
+commit /oak-index/indexes + "property@id,unique": {}
 
 # combining 'not' and 'and'
 
@@ -100,7 +100,7 @@ explain select * from [nt:base] where id
 nt:base as nt:base /* traverse "//*" */
 
 commit / - "test"
-commit /jcr:system/indexes - "property@id,unique"
+commit /oak-index/indexes - "property@id,unique"
 
 # fulltext search
 
@@ -143,8 +143,13 @@ select * from [nt:base] as b where local
 select * from [nt:base] as x where isdescendantnode(x, '/')
 /
 /jcr:system
-/jcr:system/indexes
-/jcr:system/indexes/:data
+/jcr:system/jcr:activities
+/jcr:system/jcr:nodeTypes
+/jcr:system/jcr:versionStorage
+/jcr:system/rep:privileges
+/oak-index
+/oak-index/indexes
+/oak-index/indexes/:data
 /test
 /test/jcr:resource
 /test/resource
@@ -165,6 +170,7 @@ select * from [nt:base] as p where p.[jc
 select * from [nt:base] as p inner join [nt:base] as p2 on ischildnode(p2, p) where p.[jcr:path]
= '/'
 /, /children
 /, /jcr:system
+/, /oak-index
 /, /parents
 
 select * from [nt:base] as p inner join [nt:base] as p2 on isdescendantnode(p2, p) where
p.[jcr:path] = '/parents'
@@ -222,8 +228,13 @@ commit / + "test2": { "id":"1", "x": "2"
 select * from [nt:base]
 /
 /jcr:system
-/jcr:system/indexes
-/jcr:system/indexes/:data
+/jcr:system/jcr:activities
+/jcr:system/jcr:nodeTypes
+/jcr:system/jcr:versionStorage
+/jcr:system/rep:privileges
+/oak-index
+/oak-index/indexes
+/oak-index/indexes/:data
 /test
 /test/hello
 /test/world
@@ -242,16 +253,26 @@ select * from [nt:base] where id = '1' o
 select * from [nt:base] where not (id = '1' or x = '2')
 /
 /jcr:system
-/jcr:system/indexes
-/jcr:system/indexes/:data
+/jcr:system/jcr:activities
+/jcr:system/jcr:nodeTypes
+/jcr:system/jcr:versionStorage
+/jcr:system/rep:privileges
+/oak-index
+/oak-index/indexes
+/oak-index/indexes/:data
 /test
 /test/hello
 
 select * from [nt:base] where x is null
 /
 /jcr:system
-/jcr:system/indexes
-/jcr:system/indexes/:data
+/jcr:system/jcr:activities
+/jcr:system/jcr:nodeTypes
+/jcr:system/jcr:versionStorage
+/jcr:system/rep:privileges
+/oak-index
+/oak-index/indexes
+/oak-index/indexes/:data
 /test
 
 commit / - "test"
@@ -273,6 +294,11 @@ null
 null
 null
 null
+null
+null
+null
+null
+null
 
 select * from [nt:base] where length(name) = 5
 /test



Mime
View raw message