From d4a772e9f161a19ce183cdc5eb6797b91dd473ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Finn=C3=A9?= Date: Tue, 18 Sep 2018 09:47:10 +0200 Subject: [PATCH] NodeValueIndexCursorTestBase include array/boolean value options Also removed legacy test for in-memory index, which didn't really test in-memory index since that doesn't exist anymore. --- .../NodeValueIndexCursorLuceneTest.java | 12 -------- .../NodeValueIndexCursorNative10Test.java | 6 ---- ...odeValueIndexCursorNativeBtree10Test.java} | 14 +++++++++- .../api/NodeValueIndexCursorTestBase.java | 28 +++++++++++++++---- 4 files changed, 36 insertions(+), 24 deletions(-) rename community/community-it/kernel-it/src/test/java/org/neo4j/kernel/impl/newapi/{NodeValueIndexCursorGenericTest.java => NodeValueIndexCursorNativeBtree10Test.java} (85%) diff --git a/community/community-it/index-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorLuceneTest.java b/community/community-it/index-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorLuceneTest.java index a6b8b8851c46d..0d922efdd6d00 100644 --- a/community/community-it/index-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorLuceneTest.java +++ b/community/community-it/index-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorLuceneTest.java @@ -44,16 +44,4 @@ protected String providerVersion() { return "1.0"; } - - @Override - protected boolean indexProvidesStringValues() - { - return false; - } - - @Override - protected boolean indexProvidesNumericValues() - { - return false; - } } diff --git a/community/community-it/index-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorNative10Test.java b/community/community-it/index-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorNative10Test.java index d5c6f569596a6..57abe9aa0df50 100644 --- a/community/community-it/index-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorNative10Test.java +++ b/community/community-it/index-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorNative10Test.java @@ -43,12 +43,6 @@ protected String providerVersion() return "1.0"; } - @Override - protected boolean indexProvidesStringValues() - { - return false; - } - @Override protected boolean indexProvidesNumericValues() { diff --git a/community/community-it/kernel-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorGenericTest.java b/community/community-it/kernel-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorNativeBtree10Test.java similarity index 85% rename from community/community-it/kernel-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorGenericTest.java rename to community/community-it/kernel-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorNativeBtree10Test.java index 39b45c7f14aeb..e6a88591fbc97 100644 --- a/community/community-it/kernel-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorGenericTest.java +++ b/community/community-it/kernel-it/src/test/java/org/neo4j/kernel/impl/newapi/NodeValueIndexCursorNativeBtree10Test.java @@ -21,7 +21,7 @@ import org.neo4j.graphdb.factory.GraphDatabaseSettings; -public class NodeValueIndexCursorGenericTest extends AbstractNodeValueIndexCursorTest +public class NodeValueIndexCursorNativeBtree10Test extends AbstractNodeValueIndexCursorTest { @Override public ReadTestSupport newTestSupport() @@ -60,4 +60,16 @@ protected boolean indexProvidesAllValues() { return true; } + + @Override + protected boolean indexProvidesArrayValues() + { + return true; + } + + @Override + protected boolean indexProvidesBooleanValues() + { + return true; + } } diff --git a/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/NodeValueIndexCursorTestBase.java b/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/NodeValueIndexCursorTestBase.java index ea16dfc748706..d4ec0252611a0 100644 --- a/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/NodeValueIndexCursorTestBase.java +++ b/community/kernel-api/src/test/java/org/neo4j/internal/kernel/api/NodeValueIndexCursorTestBase.java @@ -153,8 +153,26 @@ public void createTestGraph( GraphDatabaseService graphDb ) protected abstract void createCompositeIndex( GraphDatabaseService graphDb, String label, String... properties ) throws Exception; protected abstract String providerKey(); protected abstract String providerVersion(); - protected abstract boolean indexProvidesStringValues(); - protected abstract boolean indexProvidesNumericValues(); + + protected boolean indexProvidesStringValues() + { + return false; + } + + protected boolean indexProvidesNumericValues() + { + return false; + } + + protected boolean indexProvidesArrayValues() + { + return false; + } + + protected boolean indexProvidesBooleanValues() + { + return false; + } protected boolean indexProvidesTemporalValues() { @@ -544,7 +562,7 @@ public void shouldPerformSpatialRangeSearch() throws KernelException public void shouldPerformBooleanSearch() throws KernelException { // given - boolean needsValues = indexProvidesAllValues(); + boolean needsValues = indexProvidesBooleanValues(); int label = token.nodeLabel( "Node" ); int prop = token.propertyKey( "prop" ); IndexReference index = schemaRead.index( label, prop ); @@ -571,7 +589,7 @@ public void shouldPerformBooleanSearch() throws KernelException public void shouldPerformTextArraySearch() throws KernelException { // given - boolean needsValues = indexProvidesAllValues(); + boolean needsValues = indexProvidesArrayValues(); int label = token.nodeLabel( "Node" ); int prop = token.propertyKey( "prop" ); IndexReference index = schemaRead.index( label, prop ); @@ -842,7 +860,7 @@ private void assertFoundNodesAndValue( NodeValueIndexCursor node, // Assert has value capability if ( IndexValueCapability.YES.equals( expectValue ) ) { - assertTrue( "has value", node.hasValue() ); + assertTrue( "Value capability said index would have value for " + expectValue + ", but didn't", node.hasValue() ); } // Assert has correct value