You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/05/11 17:14:05 UTC
[1/3] incubator-tinkerpop git commit: Fixed plugin installation
condition in docs pre-processor. [Forced Update!]
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1300 111439995 -> bf7c98141 (forced update)
Fixed plugin installation condition in docs pre-processor.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/bce33476
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/bce33476
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/bce33476
Branch: refs/heads/TINKERPOP-1300
Commit: bce33476a035a1de77ca2d5116b6871e8692f788
Parents: b8d66cf
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Wed May 11 15:51:30 2016 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Wed May 11 15:51:30 2016 +0200
----------------------------------------------------------------------
docs/preprocessor/preprocess.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bce33476/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index 1c496f6..740808c 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -97,7 +97,7 @@ function cleanup() {
trap cleanup EXIT
-if [ "${DRYRUN_DOCS}" != "*" ]; then
+if [ "${DRYRUN_DOCS}" != "*" ] || [ ! -z "${FULLRUN_DOCS}" ]; then
# install plugins
echo
[2/3] incubator-tinkerpop git commit: fixed a bug in BulkSet.equals()
which caused the aggregate().cap() bug. Added hashCode() and equals() tests
to BulkSetTest and added the exposing traversal to AggregateTest -- Fixed
TINKERPOP-1215. CTR.
Posted by sp...@apache.org.
fixed a bug in BulkSet.equals() which caused the aggregate().cap() bug. Added hashCode() and equals() tests to BulkSetTest and added the exposing traversal to AggregateTest -- Fixed TINKERPOP-1215. CTR.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/5165d0d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/5165d0d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/5165d0d9
Branch: refs/heads/TINKERPOP-1300
Commit: 5165d0d94a6717aa4a57e70f4e4818be2699f0b1
Parents: bce3347
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed May 11 09:24:54 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed May 11 09:24:54 2016 -0600
----------------------------------------------------------------------
CHANGELOG.asciidoc | 3 +-
.../process/traversal/step/util/BulkSet.java | 2 +-
.../gremlin/process/util/BulkSetTest.java | 25 ++++++++++++++
.../step/sideEffect/GroovyAggregateTest.groovy | 7 +++-
.../step/sideEffect/AggregateTest.java | 34 ++++++++++++++++++--
5 files changed, 66 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5165d0d9/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 4f0b923..e447eee 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/
TinkerPop 3.1.3 (NOT OFFICIALLY RELEASED YET)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* Fixed a bug in `BulkSet.equals()` which made itself apparent when using `store()` and `aggregate()` with labeled `cap()`.
* Fixed bug in `gremlin-driver` where certain channel-level errors would not allow the driver to reconnect.
* Bumped SLF4J to 1.7.21 as previous versions suffered from a memory leak.
* Fixed a bug in `Neo4jGraphStepStrategy` where it wasn't defined properly as a `ProviderOptimizationStrategy`.
@@ -40,7 +41,7 @@ TinkerPop 3.1.3 (NOT OFFICIALLY RELEASED YET)
* Fixed bug in `:uninstall` command if the default `/ext` directory was not used.
* Added support to Gremlin Driver to allow either plain text or GSSAPI SASL authentication allowing the client to pass the SASL mechanism in the request.
* Improved dryRun functionality for the docs processor. It's now possible to dry run (or full run) only specific files.
-* Added precompile of ScriptInputFormat scripts to ScriptRecordReader to improve performance.
+* Added precompile of `ScriptInputFormat` scripts to `ScriptRecordReader` to improve performance.
[[release-3-1-2-incubating]]
TinkerPop 3.1.2 (Release Date: April 8, 2016)
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5165d0d9/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/BulkSet.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/BulkSet.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/BulkSet.java
index ce29b5a..cf0c550 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/BulkSet.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/BulkSet.java
@@ -137,7 +137,7 @@ public final class BulkSet<S> extends AbstractSet<S> implements Set<S>, Serializ
@Override
public boolean equals(final Object object) {
- return this.map.equals(object);
+ return object instanceof BulkSet && this.map.equals(((BulkSet) object).map);
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5165d0d9/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/util/BulkSetTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/util/BulkSetTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/util/BulkSetTest.java
index f340383..df1c54f 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/util/BulkSetTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/util/BulkSetTest.java
@@ -26,6 +26,9 @@ import java.util.Random;
import java.util.Set;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -33,6 +36,28 @@ import static org.junit.Assert.assertEquals;
public class BulkSetTest {
@Test
+ public void shouldHaveProperHashAndEquality() {
+ final BulkSet<String> a = new BulkSet<>();
+ final BulkSet<String> b = new BulkSet<>();
+ a.add("stephen", 12);
+ a.add("marko", 32);
+ a.add("daniel", 74);
+ b.add("stephen", 12);
+ b.add("marko", 32);
+ b.add("daniel", 74);
+ assertEquals(a, b);
+ assertTrue(a.equals(b));
+ assertEquals(a.hashCode(), b.hashCode());
+ assertTrue(a.hashCode() == b.hashCode());
+ assertEquals(12, a.get("stephen"));
+ assertEquals(12, b.get("stephen"));
+ a.add("matthias", 99);
+ assertFalse(a.equals(b));
+ assertFalse(a.hashCode() == b.hashCode());
+ assertNotEquals(a.hashCode(), b.hashCode());
+ }
+
+ @Test
public void shouldHaveProperCountAndNotOutOfMemoryException() {
final Set<Boolean> list = new BulkSet<>();
final Random random = new Random();
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5165d0d9/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyAggregateTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyAggregateTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyAggregateTest.groovy
index a2743e9..0211f05 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyAggregateTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyAggregateTest.groovy
@@ -18,9 +18,9 @@
*/
package org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect
-import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalScriptHelper
import org.apache.tinkerpop.gremlin.process.traversal.Path
import org.apache.tinkerpop.gremlin.process.traversal.Traversal
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalScriptHelper
import org.apache.tinkerpop.gremlin.structure.Vertex
/**
@@ -44,5 +44,10 @@ public abstract class GroovyAggregateTest {
public Traversal<Vertex, Path> get_g_V_out_aggregateXaX_path() {
TraversalScriptHelper.compute("g.V.out.aggregate('a').path", g)
}
+
+ @Override
+ public Traversal<Vertex, Collection<Integer>> get_g_V_hasLabelXpersonX_aggregateXxX_byXageX_capXxX_asXyX_selectXyX() {
+ TraversalScriptHelper.compute("g.V.hasLabel('person').aggregate('x').by('age').cap('x').as('y').select('y')", g);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5165d0d9/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateTest.java
index 74fc56b..0793794 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateTest.java
@@ -23,7 +23,7 @@ import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
import org.apache.tinkerpop.gremlin.process.traversal.Path;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.MapHelper;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.Test;
@@ -36,7 +36,10 @@ import java.util.Map;
import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -51,6 +54,8 @@ public abstract class AggregateTest extends AbstractGremlinProcessTest {
public abstract Traversal<Vertex, Path> get_g_V_out_aggregateXaX_path();
+ public abstract Traversal<Vertex, Collection<Integer>> get_g_V_hasLabelXpersonX_aggregateXxX_byXageX_capXxX_asXyX_selectXyX();
+
//public abstract Traversal<Vertex, Path> get_g_v1_asXxX_bothE_asXeX_valueXweightX_exceptXwX_aggregateXwX_backXeX_otherV_jumpXx_true_trueX_path(final Object v1Id);
@Test
@@ -110,6 +115,26 @@ public abstract class AggregateTest extends AbstractGremlinProcessTest {
assertTrue(secondStepCounts.values().contains(1l));
}
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_hasLabelXpersonX_aggregateXxX_byXageX_capXxX_asXyX_selectXyX() {
+ final Traversal<Vertex, Collection<Integer>> traversal = get_g_V_hasLabelXpersonX_aggregateXxX_byXageX_capXxX_asXyX_selectXyX();
+ final Collection<Integer> ages = traversal.next();
+ assertTrue(ages instanceof BulkSet);
+ assertEquals(4, ages.size());
+ assertTrue(ages.contains(29));
+ assertTrue(ages.contains(27));
+ assertTrue(ages.contains(32));
+ assertTrue(ages.contains(35));
+ final BulkSet<Integer> bulkSet = new BulkSet<>();
+ bulkSet.add(29);
+ bulkSet.add(27);
+ bulkSet.add(32);
+ bulkSet.add(35);
+ assertEquals(bulkSet, ages); // ensure bulk set equality
+ assertFalse(traversal.hasNext());
+ }
+
/*@Test
@LoadGraphWith(CLASSIC)
public void g_v1_asXxX_bothE_asXeX_valueXweightX_exceptXwX_aggregateXwX_backXeX_otherV_jumpXx_true_trueX_path() {
@@ -142,6 +167,11 @@ public abstract class AggregateTest extends AbstractGremlinProcessTest {
return g.V().out().aggregate("a").path();
}
+ @Override
+ public Traversal<Vertex, Collection<Integer>> get_g_V_hasLabelXpersonX_aggregateXxX_byXageX_capXxX_asXyX_selectXyX() {
+ return g.V().hasLabel("person").aggregate("x").by("age").cap("x").as("y").select("y");
+ }
+
/*public Traversal<Vertex, Path> get_g_v1_asXxX_bothE_asXeX_valueXweightX_exceptXwX_aggregateXwX_backXeX_otherV_jumpXx_true_trueX_path(final Object v1Id) {
return g.V(1).as("x").bothE().as("e").value("weight").except("w").aggregate("w").back("e").otherV().jump("x", t -> true, t -> true).path();
}*/
[3/3] incubator-tinkerpop git commit: Fixed many broken count asserts
not being applied in test suite.
Posted by sp...@apache.org.
Fixed many broken count asserts not being applied in test suite.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/bf7c9814
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/bf7c9814
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/bf7c9814
Branch: refs/heads/TINKERPOP-1300
Commit: bf7c981414b03aafb0f4ceadbd3eccf86608a079
Parents: 5165d0d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed May 11 13:10:08 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed May 11 13:13:51 2016 -0400
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
.../upgrade/release-3.1.x-incubating.asciidoc | 13 ++++
.../tinkerpop/gremlin/AbstractGremlinTest.java | 6 +-
.../traversal/step/sideEffect/SubgraphTest.java | 5 +-
.../tinkerpop/gremlin/structure/EdgeTest.java | 10 +--
.../structure/GraphConstructionTest.java | 2 +-
.../tinkerpop/gremlin/structure/GraphTest.java | 24 +++----
.../structure/GraphWritePerformanceTest.java | 7 +-
.../gremlin/structure/TransactionTest.java | 76 ++++++++++----------
.../gremlin/structure/VertexPropertyTest.java | 36 +++++-----
.../tinkerpop/gremlin/structure/VertexTest.java | 18 ++---
11 files changed, 98 insertions(+), 100 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bf7c9814/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index e447eee..7fb58fa 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -27,6 +27,7 @@ TinkerPop 3.1.3 (NOT OFFICIALLY RELEASED YET)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Fixed a bug in `BulkSet.equals()` which made itself apparent when using `store()` and `aggregate()` with labeled `cap()`.
+* Ensured that all asserts of vertex and edge counts were being applied properly in the test suite.
* Fixed bug in `gremlin-driver` where certain channel-level errors would not allow the driver to reconnect.
* Bumped SLF4J to 1.7.21 as previous versions suffered from a memory leak.
* Fixed a bug in `Neo4jGraphStepStrategy` where it wasn't defined properly as a `ProviderOptimizationStrategy`.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bf7c9814/docs/src/upgrade/release-3.1.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.1.x-incubating.asciidoc b/docs/src/upgrade/release-3.1.x-incubating.asciidoc
index 88eaa2b..7f52a37 100644
--- a/docs/src/upgrade/release-3.1.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.1.x-incubating.asciidoc
@@ -60,6 +60,19 @@ Upgrading for Providers
IMPORTANT: It is recommended that providers also review all the upgrade instructions specified for users. Many of the
changes there may prove important for the provider's implementation.
+Graph Database Providers
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Vertex and Edge Counts
+++++++++++++++++++++++
+
+A large number of asserts for vertex and edge counts in the test suite were not being applied. This problem has been
+rectified, but could manifest as test errors for different implementations. The chances of the new assertions
+identifying previously unrecognized bugs seems slim however, as there are many other tests that validate these counts
+in other ways. If those were passing previously, then these new asserts should likely not pose a problem.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1300[TINKERPOP-1300]
+
Graph Language Providers
^^^^^^^^^^^^^^^^^^^^^^^^
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bf7c9814/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
index 49a03e1..2a97cd0 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
@@ -258,7 +258,11 @@ public abstract class AbstractGremlinTest {
return this.graphComputerClass.isPresent();
}
- public static Consumer<Graph> assertVertexEdgeCounts(final int expectedVertexCount, final int expectedEdgeCount) {
+ public static void assertVertexEdgeCounts(final Graph graph, final int expectedVertexCount, final int expectedEdgeCount) {
+ getAssertVertexEdgeCounts(expectedVertexCount, expectedEdgeCount).accept(graph);
+ }
+
+ public static Consumer<Graph> getAssertVertexEdgeCounts(final int expectedVertexCount, final int expectedEdgeCount) {
return (g) -> {
assertEquals(expectedVertexCount, IteratorUtils.count(g.vertices()));
assertEquals(expectedEdgeCount, IteratorUtils.count(g.edges()));
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bf7c9814/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SubgraphTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SubgraphTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SubgraphTest.java
index 99f7d9c..ad4b0cc 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SubgraphTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SubgraphTest.java
@@ -24,7 +24,6 @@ import org.apache.tinkerpop.gremlin.LoadGraphWith;
import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.Test;
@@ -64,7 +63,7 @@ public abstract class SubgraphTest extends AbstractGremlinProcessTest {
final Traversal<Vertex, Graph> traversal = get_g_V_withSideEffectXsgX_outEXknowsX_subgraphXsgX_name_capXsgX(convertToVertexId("marko"), subgraph);
printTraversalForm(traversal);
subgraph = traversal.next();
- assertVertexEdgeCounts(3, 2).accept(subgraph);
+ assertVertexEdgeCounts(subgraph, 3, 2);
subgraph.edges().forEachRemaining(e -> {
assertEquals("knows", e.label());
assertEquals("marko", e.outVertex().values("name").next());
@@ -97,7 +96,7 @@ public abstract class SubgraphTest extends AbstractGremlinProcessTest {
printTraversalForm(traversal);
checkResults(Arrays.asList("marko", "josh", "peter"), traversal);
final Graph subGraph = traversal.asAdmin().getSideEffects().<Graph>get("sg").get();
- assertVertexEdgeCounts(5, 4).accept(subGraph);
+ assertVertexEdgeCounts(subgraph, 5, 4);
graphProvider.clear(subgraph, config);
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bf7c9814/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
index 98e44dc..68770e9 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
@@ -21,21 +21,15 @@ package org.apache.tinkerpop.gremlin.structure;
import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
import org.apache.tinkerpop.gremlin.ExceptionCoverage;
import org.apache.tinkerpop.gremlin.FeatureRequirement;
-import org.apache.tinkerpop.gremlin.LoadGraphWith;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.apache.tinkerpop.gremlin.util.function.FunctionUtils;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
-import java.util.NoSuchElementException;
import java.util.Set;
-import java.util.function.Consumer;
import static org.apache.tinkerpop.gremlin.structure.Graph.Features.PropertyFeatures.*;
import static org.junit.Assert.*;
@@ -260,14 +254,14 @@ public class EdgeTest {
v.addEdge("friend", v);
}
- tryCommit(graph, assertVertexEdgeCounts(25, 25));
+ tryCommit(graph, getAssertVertexEdgeCounts(25, 25));
for (Edge e : g.E().toList()) {
e.remove();
tryCommit(graph);
}
- tryCommit(graph, assertVertexEdgeCounts(25, 0));
+ tryCommit(graph, getAssertVertexEdgeCounts(25, 0));
}
@Test
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bf7c9814/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphConstructionTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphConstructionTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphConstructionTest.java
index 62dfa32..0023b02 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphConstructionTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphConstructionTest.java
@@ -56,7 +56,7 @@ public class GraphConstructionTest extends AbstractGremlinTest {
*/
@Test
public void shouldConstructAnEmptyGraph() {
- assertVertexEdgeCounts(0, 0).accept(graph);
+ assertVertexEdgeCounts(graph, 0, 0);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bf7c9814/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
index 830e259..11770e1 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
@@ -22,8 +22,6 @@ import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
import org.apache.tinkerpop.gremlin.ExceptionCoverage;
import org.apache.tinkerpop.gremlin.FeatureRequirement;
import org.apache.tinkerpop.gremlin.FeatureRequirementSet;
-import org.apache.tinkerpop.gremlin.GraphManager;
-import org.apache.tinkerpop.gremlin.GraphProvider;
import org.apache.tinkerpop.gremlin.structure.io.util.CustomId;
import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
@@ -866,7 +864,7 @@ public class GraphTest extends AbstractGremlinTest {
final Random random = new Random();
IntStream.range(0, vertexCount).forEach(i -> vertices.add(graph.addVertex()));
- tryCommit(graph, assertVertexEdgeCounts(vertexCount, 0));
+ tryCommit(graph, getAssertVertexEdgeCounts(vertexCount, 0));
IntStream.range(0, edgeCount).forEach(i -> {
boolean created = false;
@@ -880,7 +878,7 @@ public class GraphTest extends AbstractGremlinTest {
}
});
- tryCommit(graph, assertVertexEdgeCounts(vertexCount, edgeCount));
+ tryCommit(graph, getAssertVertexEdgeCounts(vertexCount, edgeCount));
int counter = 0;
for (Edge e : edges) {
@@ -888,7 +886,7 @@ public class GraphTest extends AbstractGremlinTest {
e.remove();
final int currentCounter = counter;
- tryCommit(graph, assertVertexEdgeCounts(vertexCount, edgeCount - currentCounter));
+ tryCommit(graph, getAssertVertexEdgeCounts(vertexCount, edgeCount - currentCounter));
}
}
@@ -905,7 +903,7 @@ public class GraphTest extends AbstractGremlinTest {
final List<Edge> edges = new ArrayList<>();
IntStream.range(0, vertexCount).forEach(i -> vertices.add(graph.addVertex()));
- tryCommit(graph, assertVertexEdgeCounts(vertexCount, 0));
+ tryCommit(graph, getAssertVertexEdgeCounts(vertexCount, 0));
for (int i = 0; i < vertexCount; i = i + 2) {
final Vertex a = vertices.get(i);
@@ -913,7 +911,7 @@ public class GraphTest extends AbstractGremlinTest {
edges.add(a.addEdge(graphProvider.convertLabel("a" + UUID.randomUUID()), b));
}
- tryCommit(graph, assertVertexEdgeCounts(vertexCount, vertexCount / 2));
+ tryCommit(graph, getAssertVertexEdgeCounts(vertexCount, vertexCount / 2));
int counter = 0;
for (Vertex v : vertices) {
@@ -922,7 +920,7 @@ public class GraphTest extends AbstractGremlinTest {
if ((counter + 1) % 2 == 0) {
final int currentCounter = counter;
- tryCommit(graph, assertVertexEdgeCounts(
+ tryCommit(graph, getAssertVertexEdgeCounts(
vertexCount - currentCounter, edges.size() - ((currentCounter + 1) / 2)));
}
}
@@ -991,14 +989,14 @@ public class GraphTest extends AbstractGremlinTest {
d = graph.addVertex();
}
- tryCommit(graph, assertVertexEdgeCounts(4, 0));
+ tryCommit(graph, getAssertVertexEdgeCounts(4, 0));
final Edge e = a.addEdge(graphProvider.convertLabel("knows"), b);
final Edge f = b.addEdge(graphProvider.convertLabel("knows"), c);
final Edge g = c.addEdge(graphProvider.convertLabel("knows"), d);
final Edge h = d.addEdge(graphProvider.convertLabel("knows"), a);
- tryCommit(graph, assertVertexEdgeCounts(4, 4));
+ tryCommit(graph, getAssertVertexEdgeCounts(4, 4));
graph.vertices().forEachRemaining(v -> {
assertEquals(1l, IteratorUtils.count(v.edges(Direction.OUT)));
@@ -1186,7 +1184,7 @@ public class GraphTest extends AbstractGremlinTest {
totalVertices = totalVertices + (int) Math.pow(branchSize, i);
}
- tryCommit(graph, assertVertexEdgeCounts(totalVertices, totalVertices - 1));
+ tryCommit(graph, getAssertVertexEdgeCounts(totalVertices, totalVertices - 1));
}
@Test
@@ -1204,11 +1202,11 @@ public class GraphTest extends AbstractGremlinTest {
if (graph.features().edge().properties().supportsStringValues())
e.property("location", "internet");
- tryCommit(graph, assertVertexEdgeCounts(2, 1));
+ tryCommit(graph, getAssertVertexEdgeCounts(2, 1));
graph.close();
final Graph reopenedGraph = graphProvider.standardTestGraph(this.getClass(), name.getMethodName(), null);
- assertVertexEdgeCounts(2, 1).accept(reopenedGraph);
+ assertVertexEdgeCounts(reopenedGraph, 2, 1);
if (graph.features().vertex().properties().supportsStringValues()) {
reopenedGraph.vertices().forEachRemaining(vertex -> {
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bf7c9814/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphWritePerformanceTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphWritePerformanceTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphWritePerformanceTest.java
index 2d1f2df..0d1eb48 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphWritePerformanceTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphWritePerformanceTest.java
@@ -28,11 +28,8 @@ import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
import org.apache.tinkerpop.gremlin.LoadGraphWith;
import org.apache.tinkerpop.gremlin.structure.io.GraphWriter;
import org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLIo;
-import org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLWriter;
import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo;
-import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter;
import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoWriter;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
@@ -66,7 +63,7 @@ public class GraphWritePerformanceTest {
tryBatchCommit(graph, ix);
}
- assertVertexEdgeCounts(verticesToGenerate, 0).accept(graph);
+ assertVertexEdgeCounts(graph, verticesToGenerate, 0);
}
@Test
@@ -83,7 +80,7 @@ public class GraphWritePerformanceTest {
tryBatchCommit(graph, ix);
}
- assertVertexEdgeCounts(verticesToGenerate, verticesToGenerate - 1).accept(graph);
+ assertVertexEdgeCounts(graph, verticesToGenerate, verticesToGenerate - 1);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bf7c9814/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/TransactionTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/TransactionTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/TransactionTest.java
index 11beb8b..a16dd09 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/TransactionTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/TransactionTest.java
@@ -240,23 +240,23 @@ public class TransactionTest extends AbstractGremlinTest {
public void shouldCommitElementAutoTransactionByDefault() {
final Vertex v1 = graph.addVertex();
final Edge e1 = v1.addEdge("l", v1);
- assertVertexEdgeCounts(1, 1);
+ assertVertexEdgeCounts(graph, 1, 1);
assertEquals(v1.id(), graph.vertices(v1.id()).next().id());
assertEquals(e1.id(), graph.edges(e1.id()).next().id());
g.tx().commit();
- assertVertexEdgeCounts(1, 1);
+ assertVertexEdgeCounts(graph, 1, 1);
assertEquals(v1.id(), graph.vertices(v1.id()).next().id());
assertEquals(e1.id(), graph.edges(e1.id()).next().id());
graph.vertices(v1.id()).forEachRemaining(Element::remove);
- assertVertexEdgeCounts(0, 0);
+ assertVertexEdgeCounts(graph, 0, 0);
g.tx().rollback();
- assertVertexEdgeCounts(1, 1);
+ assertVertexEdgeCounts(graph, 1, 1);
graph.vertices(v1.id()).forEachRemaining(Element::remove);
- assertVertexEdgeCounts(0, 0);
+ assertVertexEdgeCounts(graph, 0, 0);
g.tx().commit();
- assertVertexEdgeCounts(0, 0);
+ assertVertexEdgeCounts(graph, 0, 0);
}
@Test
@@ -266,11 +266,11 @@ public class TransactionTest extends AbstractGremlinTest {
public void shouldRollbackElementAutoTransactionByDefault() {
final Vertex v1 = graph.addVertex();
final Edge e1 = v1.addEdge("l", v1);
- assertVertexEdgeCounts(1, 1);
+ assertVertexEdgeCounts(graph, 1, 1);
assertEquals(v1.id(), graph.vertices(v1.id()).next().id());
assertEquals(e1.id(), graph.edges(e1.id()).next().id());
g.tx().rollback();
- assertVertexEdgeCounts(0, 0);
+ assertVertexEdgeCounts(graph, 0, 0);
}
@Test
@@ -280,7 +280,7 @@ public class TransactionTest extends AbstractGremlinTest {
final Vertex v1 = graph.addVertex();
final Edge e1 = v1.addEdge("l", v1);
g.tx().commit();
- assertVertexEdgeCounts(1, 1);
+ assertVertexEdgeCounts(graph, 1, 1);
assertEquals(v1.id(), graph.vertices(v1.id()).next().id());
assertEquals(e1.id(), graph.edges(e1.id()).next().id());
@@ -312,7 +312,7 @@ public class TransactionTest extends AbstractGremlinTest {
assertEquals("xxx", e1.<String>value("name"));
assertEquals("xxx", graph.edges(e1.id()).next().<String>value("name"));
- assertVertexEdgeCounts(1, 1);
+ assertVertexEdgeCounts(graph, 1, 1);
assertEquals(v1.id(), graph.vertices(v1.id()).next().id());
assertEquals(e1.id(), graph.edges(e1.id()).next().id());
}
@@ -323,7 +323,7 @@ public class TransactionTest extends AbstractGremlinTest {
public void shouldRollbackPropertyAutoTransactionByDefault() {
final Vertex v1 = graph.addVertex("name", "marko");
final Edge e1 = v1.addEdge("l", v1, "name", "xxx");
- assertVertexEdgeCounts(1, 1);
+ assertVertexEdgeCounts(graph, 1, 1);
assertEquals(v1.id(), graph.vertices(v1.id()).next().id());
assertEquals(e1.id(), graph.edges(e1.id()).next().id());
assertEquals("marko", v1.<String>value("name"));
@@ -353,7 +353,7 @@ public class TransactionTest extends AbstractGremlinTest {
assertEquals("xxx", e1.<String>value("name"));
assertEquals("xxx", graph.edges(e1.id()).next().<String>value("name"));
- assertVertexEdgeCounts(1, 1);
+ assertVertexEdgeCounts(graph, 1, 1);
}
@Test
@@ -461,7 +461,7 @@ public class TransactionTest extends AbstractGremlinTest {
}
assertEquals(completedThreads.get(), 250);
- assertVertexEdgeCounts(vertices.get(), edges.get());
+ assertVertexEdgeCounts(graph, vertices.get(), edges.get());
}
@Test
@@ -560,7 +560,7 @@ public class TransactionTest extends AbstractGremlinTest {
threadTryCommitTx.join();
assertTrue(noVerticesInFirstThread.get());
- assertVertexEdgeCounts(0, 0);
+ assertVertexEdgeCounts(graph, 0, 0);
}
@Test
@@ -583,11 +583,11 @@ public class TransactionTest extends AbstractGremlinTest {
latch.await(10000, TimeUnit.MILLISECONDS);
// threaded transaction is not yet committed so g should not reflect any change
- assertVertexEdgeCounts(0, 0);
+ assertVertexEdgeCounts(graph, 0, 0);
threadedG.tx().commit();
// there should be one vertex for each thread
- assertVertexEdgeCounts(numberOfThreads, 0);
+ assertVertexEdgeCounts(graph, numberOfThreads, 0);
}
@@ -600,15 +600,15 @@ public class TransactionTest extends AbstractGremlinTest {
grx.addVertex();
throw new Exception("fail");
})).fireAndForget();
- assertVertexEdgeCounts(0, 0);
+ assertVertexEdgeCounts(graph, 0, 0);
// this tx will work
g.tx().submit(grx -> graph.addVertex()).fireAndForget();
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
// make sure a commit happened and a new tx started
g.tx().rollback();
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
}
@Test
@@ -625,15 +625,15 @@ public class TransactionTest extends AbstractGremlinTest {
assertEquals("fail", ex.getCause().getCause().getMessage());
}
- assertVertexEdgeCounts(0, 0);
+ assertVertexEdgeCounts(graph, 0, 0);
// this tx will work
g.tx().submit(grx -> graph.addVertex()).oneAndDone();
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
// make sure a commit happened and a new tx started
g.tx().rollback();
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
}
@Test
@@ -654,7 +654,7 @@ public class TransactionTest extends AbstractGremlinTest {
}
assertEquals(Transaction.Workload.DEFAULT_TRIES, attempts.get());
- assertVertexEdgeCounts(0, 0);
+ assertVertexEdgeCounts(graph, 0, 0);
// this tx will work after several tries
final AtomicInteger tries = new AtomicInteger(0);
@@ -667,11 +667,11 @@ public class TransactionTest extends AbstractGremlinTest {
})).exponentialBackoff();
assertEquals(Transaction.Workload.DEFAULT_TRIES - 2, tries.get());
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
// make sure a commit happened and a new tx started
g.tx().rollback();
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
}
@Test
@@ -695,7 +695,7 @@ public class TransactionTest extends AbstractGremlinTest {
}
assertEquals(1, attempts.get());
- assertVertexEdgeCounts(0, 0);
+ assertVertexEdgeCounts(graph, 0, 0);
// this tx will retry for specific tx and then fail after several tries
final AtomicInteger setOfTries = new AtomicInteger(0);
@@ -712,7 +712,7 @@ public class TransactionTest extends AbstractGremlinTest {
}
assertEquals(Transaction.Workload.DEFAULT_TRIES - 2, setOfTries.get());
- assertVertexEdgeCounts(0, 0);
+ assertVertexEdgeCounts(graph, 0, 0);
// this tx will work after several tries
final AtomicInteger tries = new AtomicInteger(0);
@@ -725,11 +725,11 @@ public class TransactionTest extends AbstractGremlinTest {
})).exponentialBackoff(Transaction.Workload.DEFAULT_TRIES, 20, exceptions);
assertEquals(Transaction.Workload.DEFAULT_TRIES - 2, tries.get());
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
// make sure a commit happened and a new tx started
g.tx().rollback();
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
}
@Test
@@ -749,7 +749,7 @@ public class TransactionTest extends AbstractGremlinTest {
}
assertEquals(Transaction.Workload.DEFAULT_TRIES, attempts.get());
- assertVertexEdgeCounts(0, 0);
+ assertVertexEdgeCounts(graph, 0, 0);
// this tx will work after several tries
final AtomicInteger tries = new AtomicInteger(0);
@@ -762,11 +762,11 @@ public class TransactionTest extends AbstractGremlinTest {
})).retry();
assertEquals(Transaction.Workload.DEFAULT_TRIES - 2, tries.get());
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
// make sure a commit happened and a new tx started
g.tx().rollback();
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
}
@Test
@@ -788,7 +788,9 @@ public class TransactionTest extends AbstractGremlinTest {
}
assertEquals(Transaction.Workload.DEFAULT_TRIES, attempts.get());
- assertVertexEdgeCounts(0, 0);
+ assertFalse(g.tx().isOpen());
+ g.tx().open();
+ assertVertexEdgeCounts(graph, 0, 0);
// this tx will work after several tries
final AtomicInteger tries = new AtomicInteger(0);
@@ -803,7 +805,7 @@ public class TransactionTest extends AbstractGremlinTest {
assertEquals(Transaction.Workload.DEFAULT_TRIES - 2, tries.get());
assertFalse(g.tx().isOpen());
g.tx().open();
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
g.tx().rollback();
}
@@ -816,17 +818,17 @@ public class TransactionTest extends AbstractGremlinTest {
Vertex v1 = graph.addVertex();
graph.tx().commit();
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
final Vertex v2 = graph.addVertex();
v1 = graph.vertices(v1.id()).next();
v1.addEdge("friend", v2);
- assertVertexEdgeCounts(2, 1);
+ assertVertexEdgeCounts(graph, 2, 1);
graph.tx().commit();
- assertVertexEdgeCounts(2, 1);
+ assertVertexEdgeCounts(graph, 2, 1);
}
@Test
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bf7c9814/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
index c7f7749..78785a4 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
@@ -117,7 +117,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
assertEquals(34, v.<Integer>value("age").intValue());
assertEquals(1, IteratorUtils.count(v.properties("name")));
assertEquals(2, IteratorUtils.count(v.properties()));
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
});
final VertexProperty<String> property = v.property(VertexProperty.Cardinality.list, "name", "marko a. rodriguez");
@@ -134,13 +134,13 @@ public class VertexPropertyTest extends AbstractGremlinTest {
assertTrue(IteratorUtils.list(v.values("name")).contains("marko a. rodriguez"));
assertEquals(3, IteratorUtils.count(v.properties()));
assertEquals(2, IteratorUtils.count(v.properties("name")));
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
assertEquals(v, v.property(VertexProperty.Cardinality.list, "name", "mrodriguez").element());
tryCommit(graph, g -> {
assertEquals(3, IteratorUtils.count(v.properties("name")));
assertEquals(4, IteratorUtils.count(v.properties()));
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
});
v.<String>properties("name").forEachRemaining(meta -> {
@@ -164,7 +164,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
}
});
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
});
}
@@ -211,9 +211,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
});
v.remove();
- tryCommit(graph, g -> {
- assertVertexEdgeCounts(0, 0);
- });
+ tryCommit(graph, getAssertVertexEdgeCounts(0, 0));
final Vertex u = graph.addVertex("name", "marko", "name", "marko a. rodriguez", "name", "marko rodriguez");
tryCommit(graph);
@@ -394,28 +392,28 @@ public class VertexPropertyTest extends AbstractGremlinTest {
assertThat(values, hasItem("marko a. rodriguez"));
assertThat(values, hasItem("marko rodriguez"));
assertThat(values, hasItem("marko"));
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
});
IteratorUtils.filter(v.properties(), p -> p.value().equals("marko")).forEachRemaining(VertexProperty::remove);
tryCommit(graph, graph -> {
assertEquals(3, IteratorUtils.count(v.properties()));
assertEquals(2, IteratorUtils.count(v.properties("name")));
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
});
v.property("age").remove();
tryCommit(graph, graph -> {
assertEquals(2, IteratorUtils.count(v.properties()));
assertEquals(2, IteratorUtils.count(v.properties("name")));
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
});
IteratorUtils.filter(v.properties("name"), p -> p.key().equals("name")).forEachRemaining(VertexProperty::remove);
tryCommit(graph, graph -> {
assertEquals(0, IteratorUtils.count(v.properties()));
assertEquals(0, IteratorUtils.count(v.properties("name")));
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
});
}
@@ -428,7 +426,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
final Vertex marko = graph.addVertex("name", "marko", "name", "okram");
final Vertex stephen = graph.addVertex("name", "stephen", "name", "spmallette");
tryCommit(graph, graph -> {
- assertVertexEdgeCounts(2, 0);
+ assertVertexEdgeCounts(graph, 2, 0);
assertEquals(2, IteratorUtils.count(marko.properties("name")));
assertEquals(2, IteratorUtils.count(stephen.properties("name")));
assertEquals(2, IteratorUtils.count(marko.properties()));
@@ -439,7 +437,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
stephen.remove();
tryCommit(graph, graph -> {
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
assertEquals(2, IteratorUtils.count(marko.properties("name")));
assertEquals(2, IteratorUtils.count(marko.properties()));
assertEquals(0, IteratorUtils.count(marko.properties("blah")));
@@ -449,7 +447,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
marko.property(VertexProperty.Cardinality.list, "name", "Remove-" + String.valueOf(i));
}
tryCommit(graph, graph -> {
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
assertEquals(102, IteratorUtils.count(marko.properties("name")));
assertEquals(102, IteratorUtils.count(marko.properties()));
assertEquals(0, IteratorUtils.count(marko.properties("blah")));
@@ -457,15 +455,13 @@ public class VertexPropertyTest extends AbstractGremlinTest {
g.V().properties("name").has(T.value, P.test((a, b) -> ((String) a).startsWith((String) b), "Remove-")).forEachRemaining(Property::remove);
tryCommit(graph, graph -> {
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
assertEquals(2, IteratorUtils.count(marko.properties("name")));
assertEquals(2, IteratorUtils.count(marko.properties()));
assertEquals(0, IteratorUtils.count(marko.properties("blah")));
});
marko.remove();
- tryCommit(graph, graph -> {
- assertVertexEdgeCounts(0, 0);
- });
+ tryCommit(graph, getAssertVertexEdgeCounts(0, 0));
}
}
@@ -489,7 +485,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
final Vertex v = graph.addVertex("name", "marko", "age", 34);
tryCommit(graph, g -> {
assertEquals(2, IteratorUtils.count(v.properties()));
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
assertEquals(v.property("name"), v.property("name").property("acl", "public").element());
assertEquals(v.property("age"), v.property("age").property("acl", "private").element());
});
@@ -506,7 +502,7 @@ public class VertexPropertyTest extends AbstractGremlinTest {
assertEquals(1, IteratorUtils.count(v.property("name").properties("acl")));
assertEquals("private", v.property("age").values("acl").next());
assertEquals("public", v.property("name").values("acl").next());
- assertVertexEdgeCounts(1, 0);
+ assertVertexEdgeCounts(graph, 1, 0);
});
v.property("age").property("acl", "public");
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bf7c9814/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
index 9aab219..0ffaec5 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
@@ -22,26 +22,20 @@ import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
import org.apache.tinkerpop.gremlin.ExceptionCoverage;
import org.apache.tinkerpop.gremlin.FeatureRequirement;
import org.apache.tinkerpop.gremlin.FeatureRequirementSet;
-import org.apache.tinkerpop.gremlin.GraphManager;
import org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexFeatures;
import org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexPropertyFeatures;
-import org.apache.tinkerpop.gremlin.structure.io.IoTest;
import org.apache.tinkerpop.gremlin.structure.io.util.CustomId;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.apache.tinkerpop.gremlin.util.function.FunctionUtils;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
-import java.util.function.Consumer;
import static org.apache.tinkerpop.gremlin.structure.Graph.Features.PropertyFeatures.*;
import static org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS;
@@ -323,7 +317,7 @@ public class VertexTest {
assertTrue(v.keys().contains("name"));
assertTrue(v.keys().contains("age"));
assertFalse(v.keys().contains("location"));
- assertVertexEdgeCounts(1, 0).accept(graph);
+ assertVertexEdgeCounts(graph, 1, 0);
v.properties("name").forEachRemaining(Property::remove);
v.property(VertexProperty.Cardinality.single, "name", "marko rodriguez");
@@ -336,7 +330,7 @@ public class VertexTest {
assertTrue(v.keys().contains("name"));
assertTrue(v.keys().contains("age"));
assertFalse(v.keys().contains("location"));
- assertVertexEdgeCounts(1, 0).accept(graph);
+ assertVertexEdgeCounts(graph, 1, 0);
v.property(VertexProperty.Cardinality.single, "location", "santa fe");
assertEquals(3, IteratorUtils.count(v.properties()));
@@ -348,11 +342,11 @@ public class VertexTest {
assertTrue(v.keys().contains("age"));
assertTrue(v.keys().contains("location"));
v.property("location").remove();
- assertVertexEdgeCounts(1, 0).accept(graph);
+ assertVertexEdgeCounts(graph, 1, 0);
assertEquals(2, IteratorUtils.count(v.properties()));
v.properties().forEachRemaining(Property::remove);
assertEquals(0, IteratorUtils.count(v.properties()));
- assertVertexEdgeCounts(1, 0).accept(graph);
+ assertVertexEdgeCounts(graph, 1, 0);
}
@Test
@@ -515,7 +509,7 @@ public class VertexTest {
}
graph.vertices().forEachRemaining(v -> graph.vertices().forEachRemaining(u -> v.addEdge("knows", u, "myEdgeId", 12)));
- tryCommit(graph, assertVertexEdgeCounts(25, 625));
+ tryCommit(graph, getAssertVertexEdgeCounts(25, 625));
final List<Vertex> vertices = new ArrayList<>();
IteratorUtils.fill(graph.vertices(), vertices);
@@ -524,7 +518,7 @@ public class VertexTest {
tryCommit(graph);
}
- tryCommit(graph, assertVertexEdgeCounts(0, 0));
+ tryCommit(graph, getAssertVertexEdgeCounts(0, 0));
}
@Test