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 2015/03/09 22:20:54 UTC
[1/2] incubator-tinkerpop git commit: more tests fixed up.
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/newapi 976994e16 -> 5c2fbbc05
more tests fixed up.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/12dc2e8d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/12dc2e8d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/12dc2e8d
Branch: refs/heads/newapi
Commit: 12dc2e8dfaf44dca1d6bd6034537f0b32d393238
Parents: e23522d
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Mar 9 15:20:45 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Mar 9 15:20:45 2015 -0600
----------------------------------------------------------------------
.../generator/AbstractGeneratorTest.java | 2 +-
.../traversal/step/sideEffect/SubgraphTest.java | 2 +-
.../structure/strategy/IdStrategyTest.java | 62 ++++++++++----------
3 files changed, 33 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/12dc2e8d/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/AbstractGeneratorTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/AbstractGeneratorTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/AbstractGeneratorTest.java
index 8132692..dcbda8a 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/AbstractGeneratorTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/algorithm/generator/AbstractGeneratorTest.java
@@ -43,7 +43,7 @@ public class AbstractGeneratorTest extends AbstractGremlinTest {
return StreamFactory.stream(g1.vertices())
.map(v -> Triplet.<Integer, List<Vertex>, List<Vertex>>with(v.value("oid"), IteratorUtils.list(v.vertices(Direction.IN)), IteratorUtils.list(v.vertices(Direction.OUT))))
.allMatch(p -> {
- final Vertex v = (Vertex) g2.V().has("oid", p.getValue0()).next();
+ final Vertex v = IteratorUtils.filter(g2.vertices(), vx -> vx.value("oid").equals(p.getValue0())).next();
return sameInVertices(v, p.getValue1()) && sameOutVertices(v, p.getValue2());
});
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/12dc2e8d/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/graph/traversal/step/sideEffect/SubgraphTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/graph/traversal/step/sideEffect/SubgraphTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/graph/traversal/step/sideEffect/SubgraphTest.java
index a1b1c5c..537f4fa 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/graph/traversal/step/sideEffect/SubgraphTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/graph/traversal/step/sideEffect/SubgraphTest.java
@@ -63,7 +63,7 @@ public abstract class SubgraphTest extends AbstractGremlinProcessTest {
printTraversalForm(traversal);
subgraph = traversal.next();
assertVertexEdgeCounts(3, 2).accept(subgraph);
- subgraph.E().forEachRemaining(e -> {
+ subgraph.edges().forEachRemaining(e -> {
assertEquals("knows", e.label());
assertEquals("marko", e.outVertex().values("name").next());
assertEquals(new Integer(29), e.outVertex().<Integer>values("age").next());
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/12dc2e8d/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/strategy/IdStrategyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/strategy/IdStrategyTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/strategy/IdStrategyTest.java
index edd4ebc..c4c2ebd 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/strategy/IdStrategyTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/strategy/IdStrategyTest.java
@@ -51,9 +51,9 @@ public class IdStrategyTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldInjectAnIdAndReturnBySpecifiedIdForVertex() {
- final IdStrategy strategy = (IdStrategy) ((StrategyGraph) g).getStrategy();
- final Vertex v = g.addVertex(T.id, "test", "something", "else");
- tryCommit(g, c -> {
+ final IdStrategy strategy = (IdStrategy) ((StrategyGraph) graph).getStrategy();
+ final Vertex v = graph.addVertex(T.id, "test", "something", "else");
+ tryCommit(graph, c -> {
assertNotNull(v);
assertEquals("test", v.id());
assertEquals("test", v.property(strategy.getIdKey()).value());
@@ -70,10 +70,10 @@ public class IdStrategyTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
public void shouldInjectAnIdAndReturnBySpecifiedIdForEdge() {
- final IdStrategy strategy = (IdStrategy) ((StrategyGraph) g).getStrategy();
- final Vertex v = g.addVertex(T.id, "test", "something", "else");
+ final IdStrategy strategy = (IdStrategy) ((StrategyGraph) graph).getStrategy();
+ final Vertex v = graph.addVertex(T.id, "test", "something", "else");
final Edge e = v.addEdge("self", v, T.id, "edge-id", "try", "this");
- tryCommit(g, c -> {
+ tryCommit(graph, c -> {
assertNotNull(e);
assertEquals("edge-id", e.id());
assertEquals("edge-id", e.property(strategy.getIdKey()).value());
@@ -89,9 +89,9 @@ public class IdStrategyTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldCreateAnIdAndReturnByCreatedIdForVertex() {
- final IdStrategy strategy = (IdStrategy) ((StrategyGraph) g).getStrategy();
- final Vertex v = g.addVertex("something", "else");
- tryCommit(g, c -> {
+ final IdStrategy strategy = (IdStrategy) ((StrategyGraph) graph).getStrategy();
+ final Vertex v = graph.addVertex("something", "else");
+ tryCommit(graph, c -> {
assertNotNull(v);
assertNotNull(UUID.fromString(v.id().toString()));
assertNotNull(UUID.fromString(v.property(strategy.getIdKey()).value().toString()));
@@ -107,10 +107,10 @@ public class IdStrategyTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
public void shouldCreateAnIdAndReturnByCreatedIdForEdge() {
- final IdStrategy strategy = (IdStrategy) ((StrategyGraph) g).getStrategy();
- final Vertex v = g.addVertex("something", "else");
+ final IdStrategy strategy = (IdStrategy) ((StrategyGraph) graph).getStrategy();
+ final Vertex v = graph.addVertex("something", "else");
final Edge e = v.addEdge("self", v, "try", "this");
- tryCommit(g, c -> {
+ tryCommit(graph, c -> {
assertNotNull(e);
assertNotNull(UUID.fromString(e.id().toString()));
assertNotNull(UUID.fromString(e.property(strategy.getIdKey()).value().toString()));
@@ -132,9 +132,9 @@ public class IdStrategyTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldCreateAnIdAndReturnByCreatedId() {
- final IdStrategy strategy = (IdStrategy) ((StrategyGraph) g).getStrategy();
- final Vertex v = g.addVertex("something", "else");
- tryCommit(g, c -> {
+ final IdStrategy strategy = (IdStrategy) ((StrategyGraph) graph).getStrategy();
+ final Vertex v = graph.addVertex("something", "else");
+ tryCommit(graph, c -> {
assertNotNull(v);
assertEquals("100", v.id());
assertEquals("100", v.property(strategy.getIdKey()).value());
@@ -157,10 +157,10 @@ public class IdStrategyTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
public void shouldCreateAnIdAndReturnByCreatedId() {
- final IdStrategy strategy = (IdStrategy) ((StrategyGraph) g).getStrategy();
- final Vertex v = g.addVertex("something", "else");
+ final IdStrategy strategy = (IdStrategy) ((StrategyGraph) graph).getStrategy();
+ final Vertex v = graph.addVertex("something", "else");
final Edge e = v.addEdge("self", v, "try", "this");
- tryCommit(g, c -> {
+ tryCommit(graph, c -> {
assertNotNull(e);
assertEquals("100", e.id());
assertEquals("100", e.property(strategy.getIdKey()).value());
@@ -183,10 +183,10 @@ public class IdStrategyTest {
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
public void shouldInjectAnIdAndReturnBySpecifiedId() {
- final IdStrategy strategy = (IdStrategy) ((StrategyGraph) g).getStrategy();
+ final IdStrategy strategy = (IdStrategy) ((StrategyGraph) graph).getStrategy();
final Object o = GraphManager.getGraphProvider().convertId("1");
- final Vertex v = g.addVertex(T.id, o, "something", "else");
- tryCommit(g, c -> {
+ final Vertex v = graph.addVertex(T.id, o, "something", "else");
+ tryCommit(graph, c -> {
assertNotNull(v);
assertEquals(o, v.id());
assertFalse(v.property(strategy.getIdKey()).isPresent());
@@ -203,10 +203,10 @@ public class IdStrategyTest {
@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = FEATURE_USER_SUPPLIED_IDS)
public void shouldAllowDirectSettingOfIdField() {
- final IdStrategy strategy = (IdStrategy) ((StrategyGraph) g).getStrategy();
+ final IdStrategy strategy = (IdStrategy) ((StrategyGraph) graph).getStrategy();
final Object o = GraphManager.getGraphProvider().convertId("1");
- final Vertex v = g.addVertex(T.id, o, "something", "else", strategy.getIdKey(), "should be ok to set this as supportsEdgeId=true");
- tryCommit(g, c -> {
+ final Vertex v = graph.addVertex(T.id, o, "something", "else", strategy.getIdKey(), "should be ok to set this as supportsEdgeId=true");
+ tryCommit(graph, c -> {
assertNotNull(v);
assertEquals(o, v.id());
assertEquals("should be ok to set this as supportsEdgeId=true", v.property(strategy.getIdKey()).value());
@@ -244,10 +244,10 @@ public class IdStrategyTest {
@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_USER_SUPPLIED_IDS)
public void shouldInjectAnIdAndReturnBySpecifiedId() {
- final IdStrategy strategy = (IdStrategy) ((StrategyGraph) g).getStrategy();
- final Vertex v = g.addVertex(T.id, "test", "something", "else");
+ final IdStrategy strategy = (IdStrategy) ((StrategyGraph) graph).getStrategy();
+ final Vertex v = graph.addVertex(T.id, "test", "something", "else");
final Edge e = v.addEdge("self", v, T.id, "edge-id", "try", "this");
- tryCommit(g, c -> {
+ tryCommit(graph, c -> {
assertNotNull(e);
assertEquals("edge-id", e.id());
assertFalse(e.property(strategy.getIdKey()).isPresent());
@@ -264,10 +264,10 @@ public class IdStrategyTest {
@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
@FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_USER_SUPPLIED_IDS)
public void shouldAllowDirectSettingOfIdField() {
- final IdStrategy strategy = (IdStrategy) ((StrategyGraph) g).getStrategy();
- final Vertex v = g.addVertex(T.id, "test", "something", "else");
+ final IdStrategy strategy = (IdStrategy) ((StrategyGraph) graph).getStrategy();
+ final Vertex v = graph.addVertex(T.id, "test", "something", "else");
final Edge e = v.addEdge("self", v, T.id, "edge-id", "try", "this", strategy.getIdKey(), "should be ok to set this as supportsEdgeId=false");
- tryCommit(g, c -> {
+ tryCommit(graph, c -> {
assertNotNull(e);
assertEquals("edge-id", e.id());
assertEquals("this", e.property("try").value());
@@ -280,7 +280,7 @@ public class IdStrategyTest {
});
try {
- g.addVertex(T.id, "test", "something", "else", strategy.getIdKey(), "this should toss and exception as supportsVertexId=true");
+ graph.addVertex(T.id, "test", "something", "else", strategy.getIdKey(), "this should toss and exception as supportsVertexId=true");
fail("An exception should be tossed here because supportsVertexId=true");
} catch (IllegalArgumentException iae) {
assertNotNull(iae);
[2/2] incubator-tinkerpop git commit: Merge branch 'newapi' of
https://git-wip-us.apache.org/repos/asf/incubator-tinkerpop into newapi
Posted by ok...@apache.org.
Merge branch 'newapi' of https://git-wip-us.apache.org/repos/asf/incubator-tinkerpop into newapi
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/5c2fbbc0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/5c2fbbc0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/5c2fbbc0
Branch: refs/heads/newapi
Commit: 5c2fbbc0514d92e2895a4d495f28800ee54fcaeb
Parents: 12dc2e8 976994e
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Mar 9 15:20:49 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Mar 9 15:20:49 2015 -0600
----------------------------------------------------------------------
.../gremlin/structure/TransactionTest.java | 124 ++++++++-----------
1 file changed, 55 insertions(+), 69 deletions(-)
----------------------------------------------------------------------