From 2957ca5c5add93f45a9501d9e4dce66a33068aa8 Mon Sep 17 00:00:00 2001 From: zhangyi51 Date: Fri, 17 Aug 2018 19:23:37 +0800 Subject: [PATCH] Fix bug that tinkerpop test suite can't find filter in resource directory fix #8 Change-Id: If0d046a6eaaa76cabbc368fae18ecc05231a5307 --- hugegraph-test/pom.xml | 3 --- .../java/com/baidu/hugegraph/tinkerpop/TestGraph.java | 8 ++++---- .../baidu/hugegraph/tinkerpop/TestGraphProvider.java | 10 +++++++--- hugegraph-test/src/main/resources/hugegraph.properties | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/hugegraph-test/pom.xml b/hugegraph-test/pom.xml index 3634c1b40d..f5a070afcc 100644 --- a/hugegraph-test/pom.xml +++ b/hugegraph-test/pom.xml @@ -155,9 +155,6 @@ src/main/resources/ - - hugegraph.properties - true diff --git a/hugegraph-test/src/main/java/com/baidu/hugegraph/tinkerpop/TestGraph.java b/hugegraph-test/src/main/java/com/baidu/hugegraph/tinkerpop/TestGraph.java index 2103c8b4ea..7bfdfe467a 100644 --- a/hugegraph-test/src/main/java/com/baidu/hugegraph/tinkerpop/TestGraph.java +++ b/hugegraph-test/src/main/java/com/baidu/hugegraph/tinkerpop/TestGraph.java @@ -39,10 +39,10 @@ import com.baidu.hugegraph.structure.HugeFeatures; import com.baidu.hugegraph.type.define.IdStrategy; -@Graph.OptIn("com.baidu.hugegraph.tinkerpop.StructureStandardTest") -@Graph.OptIn("com.baidu.hugegraph.tinkerpop.ProcessStandardTest") -@Graph.OptIn("com.baidu.hugegraph.tinkerpop.StructurePerformanceTest") -@Graph.OptIn("com.baidu.hugegraph.tinkerpop.ProcessPerformanceTest") +@Graph.OptIn("com.baidu.hugegraph.tinkerpop.StructureBasicSuite") +@Graph.OptIn("com.baidu.hugegraph.tinkerpop.ProcessBasicSuite") +@Graph.OptIn("com.baidu.hugegraph.tinkerpop.StructurePerformanceSuite") +@Graph.OptIn("com.baidu.hugegraph.tinkerpop.ProcessPerformanceSuite") public class TestGraph implements Graph { public static final String DEFAULT_VL = "vertex"; diff --git a/hugegraph-test/src/main/java/com/baidu/hugegraph/tinkerpop/TestGraphProvider.java b/hugegraph-test/src/main/java/com/baidu/hugegraph/tinkerpop/TestGraphProvider.java index 6fa6136f89..99595e3e14 100644 --- a/hugegraph-test/src/main/java/com/baidu/hugegraph/tinkerpop/TestGraphProvider.java +++ b/hugegraph-test/src/main/java/com/baidu/hugegraph/tinkerpop/TestGraphProvider.java @@ -23,6 +23,7 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; +import java.net.URL; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -95,9 +96,12 @@ private void initBlackList() throws IOException { filter = DEFAULT_FILTER; } - String blackList = TestGraphProvider.class.getClassLoader() - .getResource(filter).getPath(); - File file = new File(blackList); + URL blackList = TestGraphProvider.class.getClassLoader() + .getResource(filter); + E.checkArgument(blackList != null, + "Can't find tests filter '%s' in resource directory", + filter); + File file = new File(blackList.getPath()); E.checkArgument( file.exists() && file.isFile() && file.canRead(), "Need to specify a readable filter file rather than: %s", diff --git a/hugegraph-test/src/main/resources/hugegraph.properties b/hugegraph-test/src/main/resources/hugegraph.properties index f47c371e88..2e899ba208 100644 --- a/hugegraph-test/src/main/resources/hugegraph.properties +++ b/hugegraph-test/src/main/resources/hugegraph.properties @@ -5,8 +5,8 @@ serializer=${serializer} store=hugegraph -vertex.tx_capacity=1000 -edge.tx_capacity=1000 +vertex.tx_capacity=10000 +edge.tx_capacity=10000 # cassandra backend config cassandra.host=127.0.0.1