You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2016/01/05 23:54:43 UTC
[11/50] incubator-tinkerpop git commit: Refactor tests to use member
variables for graphProvider
Refactor tests to use member variables for graphProvider
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/0926604e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/0926604e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/0926604e
Branch: refs/heads/TINKERPOP-1033
Commit: 0926604ecdfcf5c9ece592f94470df7d3434c701
Parents: 5760bf0
Author: Nghia Tran <ng...@gmail.com>
Authored: Tue Dec 1 19:18:42 2015 -0500
Committer: Nghia Tran <ng...@gmail.com>
Committed: Mon Dec 21 17:01:34 2015 -0500
----------------------------------------------------------------------
.../tinkerpop/gremlin/structure/GraphTest.java | 16 +++-------------
.../tinkerpop/gremlin/structure/PropertyTest.java | 4 ++--
.../tinkerpop/gremlin/structure/VertexTest.java | 18 +++++++++---------
3 files changed, 14 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/0926604e/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 09d836a..830e259 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
@@ -874,7 +874,7 @@ public class GraphTest extends AbstractGremlinTest {
final Vertex a = vertices.get(random.nextInt(vertices.size()));
final Vertex b = vertices.get(random.nextInt(vertices.size()));
if (a != b) {
- edges.add(a.addEdge(GraphManager.getGraphProvider().convertLabel("a" + UUID.randomUUID()), b));
+ edges.add(a.addEdge(graphProvider.convertLabel("a" + UUID.randomUUID()), b));
created = true;
}
}
@@ -910,7 +910,7 @@ public class GraphTest extends AbstractGremlinTest {
for (int i = 0; i < vertexCount; i = i + 2) {
final Vertex a = vertices.get(i);
final Vertex b = vertices.get(i + 1);
- edges.add(a.addEdge(GraphManager.getGraphProvider().convertLabel("a" + UUID.randomUUID()), b));
+ edges.add(a.addEdge(graphProvider.convertLabel("a" + UUID.randomUUID()), b));
}
tryCommit(graph, assertVertexEdgeCounts(vertexCount, vertexCount / 2));
@@ -975,8 +975,6 @@ public class GraphTest extends AbstractGremlinTest {
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
public void shouldEvaluateConnectivityPatterns() {
- final GraphProvider graphProvider = GraphManager.getGraphProvider();
-
final Vertex a;
final Vertex b;
final Vertex c;
@@ -1066,10 +1064,7 @@ public class GraphTest extends AbstractGremlinTest {
@Test
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
- public void shouldTraverseInOutFromVertexWithSingleEdgeLabelFilter() {
- final GraphProvider graphProvider = GraphManager.getGraphProvider();
-
- final Vertex a = graph.addVertex();
+ public void shouldTraverseInOutFromVertexWithSingleEdgeLabelFilter() {final Vertex a = graph.addVertex();
final Vertex b = graph.addVertex();
final Vertex c = graph.addVertex();
@@ -1117,7 +1112,6 @@ public class GraphTest extends AbstractGremlinTest {
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
public void shouldTraverseInOutFromVertexWithMultipleEdgeLabelFilter() {
- final GraphProvider graphProvider = GraphManager.getGraphProvider();
final Vertex a = graph.addVertex();
final Vertex b = graph.addVertex();
final Vertex c = graph.addVertex();
@@ -1154,8 +1148,6 @@ public class GraphTest extends AbstractGremlinTest {
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
public void shouldTestTreeConnectivity() {
- final GraphProvider graphProvider = GraphManager.getGraphProvider();
-
int branchSize = 11;
final Vertex start = graph.addVertex();
for (int i = 0; i < branchSize; i++) {
@@ -1201,8 +1193,6 @@ public class GraphTest extends AbstractGremlinTest {
@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
@FeatureRequirement(featureClass = Graph.Features.GraphFeatures.class, feature = Graph.Features.GraphFeatures.FEATURE_PERSISTENCE)
public void shouldPersistDataOnClose() throws Exception {
- final GraphProvider graphProvider = GraphManager.getGraphProvider();
-
final Vertex v = graph.addVertex();
final Vertex u = graph.addVertex();
if (graph.features().vertex().properties().supportsStringValues()) {
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/0926604e/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/PropertyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/PropertyTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/PropertyTest.java
index 6d48961..2d5623e 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/PropertyTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/PropertyTest.java
@@ -472,13 +472,13 @@ public class PropertyTest {
private Edge createEdgeForPropertyFeatureTests() {
final Vertex vertexA = graph.addVertex();
final Vertex vertexB = graph.addVertex();
- return vertexA.addEdge(GraphManager.getGraphProvider().convertLabel("knows"), vertexB);
+ return vertexA.addEdge(graphProvider.convertLabel("knows"), vertexB);
}
private Edge createEdgeForPropertyFeatureTests(final String k, Object v) {
final Vertex vertexA = graph.addVertex();
final Vertex vertexB = graph.addVertex();
- return vertexA.addEdge(GraphManager.getGraphProvider().convertLabel("knows"), vertexB, k, v);
+ return vertexA.addEdge(graphProvider.convertLabel("knows"), vertexB, k, v);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/0926604e/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 f097e01..9aab219 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
@@ -259,7 +259,7 @@ public class VertexTest {
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_USER_SUPPLIED_IDS)
public void shouldHaveExceptionConsistencyWhenAssigningSameIdOnEdge() {
final Vertex v = graph.addVertex();
- final Object o = GraphManager.getGraphProvider().convertId("1", Edge.class);
+ final Object o = graphProvider.convertId("1", Edge.class);
v.addEdge("self", v, T.id, o);
try {
@@ -359,8 +359,8 @@ public class VertexTest {
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
public void shouldEvaluateVerticesEquivalentWithSuppliedIdsViaTraversal() {
- final Vertex v = graph.addVertex(T.id, GraphManager.getGraphProvider().convertId("1", Vertex.class));
- final Vertex u = graph.vertices(GraphManager.getGraphProvider().convertId("1", Vertex.class)).next();
+ final Vertex v = graph.addVertex(T.id, graphProvider.convertId("1", Vertex.class));
+ final Vertex u = graph.vertices(graphProvider.convertId("1", Vertex.class)).next();
assertEquals(v, u);
}
@@ -368,8 +368,8 @@ public class VertexTest {
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
public void shouldEvaluateVerticesEquivalentWithSuppliedIdsViaIterators() {
- final Vertex v = graph.addVertex(T.id, GraphManager.getGraphProvider().convertId("1", Vertex.class));
- final Vertex u = graph.vertices(GraphManager.getGraphProvider().convertId("1", Vertex.class)).next();
+ final Vertex v = graph.addVertex(T.id, graphProvider.convertId("1", Vertex.class));
+ final Vertex u = graph.vertices(graphProvider.convertId("1", Vertex.class)).next();
assertEquals(v, u);
}
@@ -392,8 +392,8 @@ public class VertexTest {
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
public void shouldEvaluateEquivalentVertexHashCodeWithSuppliedIds() {
- final Vertex v = graph.addVertex(T.id, GraphManager.getGraphProvider().convertId("1", Vertex.class));
- final Vertex u = graph.vertices(GraphManager.getGraphProvider().convertId("1", Vertex.class)).next();
+ final Vertex v = graph.addVertex(T.id, graphProvider.convertId("1", Vertex.class));
+ final Vertex u = graph.vertices(graphProvider.convertId("1", Vertex.class)).next();
assertEquals(v, u);
final Set<Vertex> set = new HashSet<>();
@@ -401,8 +401,8 @@ public class VertexTest {
set.add(v);
set.add(u);
set.add(u);
- set.add(graph.vertices(GraphManager.getGraphProvider().convertId("1", Vertex.class)).next());
- set.add(graph.vertices(GraphManager.getGraphProvider().convertId("1", Vertex.class)).next());
+ set.add(graph.vertices(graphProvider.convertId("1", Vertex.class)).next());
+ set.add(graph.vertices(graphProvider.convertId("1", Vertex.class)).next());
assertEquals(1, set.size());
assertEquals(v.hashCode(), u.hashCode());