jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r1574984 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java
Date Thu, 06 Mar 2014 18:16:51 GMT
Author: tripod
Date: Thu Mar  6 18:16:51 2014
New Revision: 1574984

URL: http://svn.apache.org/r1574984
Log:
OAK-1517 Creating an property index definition with an illegal namespace should fail

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java?rev=1574984&r1=1574983&r2=1574984&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java
Thu Mar  6 18:16:51 2014
@@ -16,24 +16,35 @@
  */
 package org.apache.jackrabbit.oak.plugins.index.property;
 
+import static org.apache.jackrabbit.oak.plugins.index.IndexConstants.INDEX_DEFINITIONS_NAME;
+import static org.apache.jackrabbit.oak.plugins.index.IndexUtils.createIndexDefinition;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
+import javax.annotation.Nonnull;
+
 import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.api.PropertyValue;
 import org.apache.jackrabbit.oak.api.ResultRow;
 import org.apache.jackrabbit.oak.api.Tree;
+import org.apache.jackrabbit.oak.plugins.index.nodetype.NodeTypeIndexProvider;
 import org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent;
 import org.apache.jackrabbit.oak.query.AbstractQueryTest;
+import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
 import org.apache.jackrabbit.oak.spi.query.PropertyValues;
 import org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
+import org.junit.Ignore;
 import org.junit.Test;
 
+import com.google.common.collect.ImmutableSet;
+
 /**
  * Tests the query engine using the default index implementation: the
  * {@link PropertyIndexProvider}
@@ -59,6 +70,28 @@ public class PropertyIndexQueryTest exte
         test("xpath.txt");
     }
 
+    @Ignore("OAK-1517")
+    @Test
+    public void testInvalidNamespace() throws Exception {
+        new Oak().with(new InitialContent())
+                .with(new OpenSecurityProvider())
+                .with(new PropertyIndexEditorProvider())
+                .with(new RepositoryInitializer(){
+
+                    @Override
+                    public void initialize(@Nonnull NodeBuilder builder) {
+                        createIndexDefinition(
+                                builder.child(INDEX_DEFINITIONS_NAME),
+                                "foo",
+                                true,
+                                false,
+                                ImmutableSet.of("illegal:namespaceProperty"), null);
+                    }
+                })
+                .createContentRepository();
+        fail("creating an index definition with an illegal namespace should fail.");
+    }
+
     @Test
     public void bindVariableTest() throws Exception {
         Tree tree = root.getTree("/");



Mime
View raw message