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:26:39 UTC
[1/3] incubator-tinkerpop git commit: Add some extra output to the
printTraversalForm method.
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/newapi 3ae30a4c6 -> 94cc1de23
Add some extra output to the printTraversalForm method.
Added the test name and before/after labels to traversal toString'ing.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/43ae5727
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/43ae5727
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/43ae5727
Branch: refs/heads/newapi
Commit: 43ae5727584e43154ff691aff08d195c9f9bdb57
Parents: d06a179
Author: Stephen Mallette <sp...@apache.org>
Authored: Mon Mar 9 15:08:57 2015 -0400
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Mar 9 15:26:33 2015 -0600
----------------------------------------------------------------------
.../java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/43ae5727/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 2507934..da117a3 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
@@ -223,9 +223,10 @@ public abstract class AbstractGremlinTest {
public void printTraversalForm(final Traversal traversal) {
final boolean muted = Boolean.parseBoolean(System.getProperty("muteTestLogs", "false"));
- if (!muted) System.out.println("Testing: " + traversal);
+ if (!muted) System.out.println(String.format("Testing: %s", name.getMethodName()));
+ if (!muted) System.out.println(" pre-strategy:" + traversal);
traversal.hasNext();
- if (!muted) System.out.println(" " + traversal);
+ if (!muted) System.out.println(" post-strategy:" + traversal);
}
public static Consumer<Graph> assertVertexEdgeCounts(final int expectedVertexCount, final int expectedEdgeCount) {
[3/3] incubator-tinkerpop git commit: yet more.
Posted by ok...@apache.org.
yet more.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/94cc1de2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/94cc1de2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/94cc1de2
Branch: refs/heads/newapi
Commit: 94cc1de2380e5690824ef9d391edbba42cccfdf6
Parents: 43ae572
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Mar 9 15:24:15 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Mar 9 15:26:34 2015 -0600
----------------------------------------------------------------------
.../ranking/PageRankVertexProgramTest.java | 5 ++---
.../computer/util/ComputerDataStrategyTest.java | 6 +++---
.../util/detached/DetachedVertexTest.java | 18 +++++++++---------
3 files changed, 14 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/94cc1de2/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/PageRankVertexProgramTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/PageRankVertexProgramTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/PageRankVertexProgramTest.java
index 49264d7..c5cb3d1 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/PageRankVertexProgramTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/ranking/PageRankVertexProgramTest.java
@@ -38,9 +38,8 @@ public class PageRankVertexProgramTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
public void shouldExecutePageRank() throws Exception {
- final ComputerResult result = g.compute().program(PageRankVertexProgram.build().create()).submit().get();
- //result.graph().engine(StandardTraversalEngine.standard);
- result.graph().V().forEachRemaining(v -> {
+ final ComputerResult result = graph.compute().program(PageRankVertexProgram.build().create()).submit().get();
+ result.graph().traversal().V().forEachRemaining(v -> {
assertTrue(v.keys().contains("name"));
assertFalse(v.keys().contains(PageRankVertexProgram.PAGE_RANK));
final String name = v.value("name");
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/94cc1de2/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerDataStrategyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerDataStrategyTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerDataStrategyTest.java
index 582d6bf..c9e95b6 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerDataStrategyTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/ComputerDataStrategyTest.java
@@ -44,7 +44,7 @@ public class ComputerDataStrategyTest extends AbstractGremlinTest {
@Test
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
public void shouldFilterHiddenProperties() {
- final StrategyGraph sg = g.strategy(new ComputerDataStrategy(new HashSet<>(Arrays.asList("***hidden-guy"))));
+ final StrategyGraph sg = graph.strategy(new ComputerDataStrategy(new HashSet<>(Arrays.asList("***hidden-guy"))));
final Vertex v = sg.addVertex("***hidden-guy", "X", "not-hidden-guy", "Y");
final Iterator<VertexProperty<String>> props = v.properties();
@@ -61,7 +61,7 @@ public class ComputerDataStrategyTest extends AbstractGremlinTest {
@Test
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
public void shouldAccessHiddenProperties() {
- final StrategyGraph sg = g.strategy(new ComputerDataStrategy(new HashSet<>(Arrays.asList("***hidden-guy"))));
+ final StrategyGraph sg = graph.strategy(new ComputerDataStrategy(new HashSet<>(Arrays.asList("***hidden-guy"))));
final Vertex v = sg.addVertex("***hidden-guy", "X", "not-hidden-guy", "Y");
final Iterator<VertexProperty<String>> props = v.properties("***hidden-guy");
@@ -78,7 +78,7 @@ public class ComputerDataStrategyTest extends AbstractGremlinTest {
@Test
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
public void shouldHideHiddenKeys() {
- final StrategyGraph sg = g.strategy(new ComputerDataStrategy(new HashSet<>(Arrays.asList("***hidden-guy"))));
+ final StrategyGraph sg = graph.strategy(new ComputerDataStrategy(new HashSet<>(Arrays.asList("***hidden-guy"))));
final Vertex v = sg.addVertex("***hidden-guy", "X", "not-hidden-guy", "Y");
final Set<String> keys = v.keys();
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/94cc1de2/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java
index bbb8e0a..3df9810 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java
@@ -46,7 +46,7 @@ public class DetachedVertexTest extends AbstractGremlinTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldNotConstructNewWithSomethingAlreadyDetached() {
- final Vertex v = g.addVertex();
+ final Vertex v = graph.addVertex();
final DetachedVertex dv = DetachedFactory.detach(v, true);
assertSame(dv, DetachedFactory.detach(dv, true));
}
@@ -54,7 +54,7 @@ public class DetachedVertexTest extends AbstractGremlinTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldConstructDetachedVertex() {
- final Vertex v = g.addVertex("test", "123");
+ final Vertex v = graph.addVertex("test", "123");
final DetachedVertex detachedVertex = DetachedFactory.detach(v, true);
assertEquals(v.id(), detachedVertex.id());
@@ -66,7 +66,7 @@ public class DetachedVertexTest extends AbstractGremlinTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldConstructDetachedVertexAsReference() {
- final Vertex v = g.addVertex("test", "123", "test", "321");
+ final Vertex v = graph.addVertex("test", "123", "test", "321");
final DetachedVertex detachedVertex = DetachedFactory.detach(v, false);
assertEquals(v.id(), detachedVertex.id());
@@ -77,7 +77,7 @@ public class DetachedVertexTest extends AbstractGremlinTest {
@Test
@LoadGraphWith(LoadGraphWith.GraphData.CREW)
public void shouldDetachVertexWithMultiPropertiesAndMetaProperties() {
- final DetachedVertex v1 = DetachedFactory.detach(convertToVertex(g, "marko"), true);
+ final DetachedVertex v1 = DetachedFactory.detach(convertToVertex(graph, "marko"), true);
assertEquals("person", v1.label());
assertEquals(2, v1.keys().size());
@@ -121,7 +121,7 @@ public class DetachedVertexTest extends AbstractGremlinTest {
public void shouldAttachToGraph() {
final Vertex toDetach = g.V(convertToVertexId("josh")).next();
final DetachedVertex detachedVertex = DetachedFactory.detach(toDetach, true);
- final Vertex attached = detachedVertex.attach(g);
+ final Vertex attached = detachedVertex.attach(graph);
assertEquals(toDetach, attached);
assertFalse(attached instanceof DetachedVertex);
@@ -144,7 +144,7 @@ public class DetachedVertexTest extends AbstractGremlinTest {
@FeatureRequirement(featureClass = Graph.Features.EdgePropertyFeatures.class, feature = Graph.Features.EdgePropertyFeatures.FEATURE_INTEGER_VALUES)
public void shouldNotEvaluateToEqualDifferentId() {
final DetachedVertex originalMarko = DetachedFactory.detach(g.V(convertToVertexId("marko")).next(), true);
- final Vertex secondMarko = g.addVertex("name", "marko", "age", 29);
+ final Vertex secondMarko = graph.addVertex("name", "marko", "age", 29);
assertFalse(DetachedFactory.detach(secondMarko, true).equals(originalMarko));
}
@@ -235,7 +235,7 @@ public class DetachedVertexTest extends AbstractGremlinTest {
@Test(expected = UnsupportedOperationException.class)
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldNotAllowAddEdge() {
- final Vertex v = g.addVertex();
+ final Vertex v = graph.addVertex();
final DetachedVertex detachedVertex = DetachedFactory.detach(v, true);
detachedVertex.addEdge("test", null);
}
@@ -243,7 +243,7 @@ public class DetachedVertexTest extends AbstractGremlinTest {
@Test(expected = UnsupportedOperationException.class)
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldNotAllowSetProperty() {
- final Vertex v = g.addVertex();
+ final Vertex v = graph.addVertex();
final DetachedVertex detachedVertex = DetachedFactory.detach(v, true);
detachedVertex.property("test", "test");
}
@@ -251,7 +251,7 @@ public class DetachedVertexTest extends AbstractGremlinTest {
@Test(expected = UnsupportedOperationException.class)
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldNotAllowRemove() {
- final Vertex v = g.addVertex();
+ final Vertex v = graph.addVertex();
final DetachedVertex detachedVertex = DetachedFactory.detach(v, true);
detachedVertex.remove();
}
[2/3] incubator-tinkerpop git commit: Remove groovy specific version
of ArrayIterator.
Posted by ok...@apache.org.
Remove groovy specific version of ArrayIterator.
This class was already implemented in gremlin-core - didn't need both.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/d06a179d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/d06a179d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/d06a179d
Branch: refs/heads/newapi
Commit: d06a179db2264de2313a1ecf57526b41aef7afcc
Parents: 3ae30a4
Author: Stephen Mallette <sp...@apache.org>
Authored: Mon Mar 9 14:23:39 2015 -0400
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Mar 9 15:26:33 2015 -0600
----------------------------------------------------------------------
.../tinkerpop/gremlin/console/Console.groovy | 2 +-
.../gremlin/console/util/ArrayIterator.groovy | 49 --------------------
2 files changed, 1 insertion(+), 50 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d06a179d/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
index efdabf5..db50891 100644
--- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
+++ b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
@@ -20,10 +20,10 @@ package org.apache.tinkerpop.gremlin.console
import org.apache.tinkerpop.gremlin.console.commands.*
import org.apache.tinkerpop.gremlin.console.plugin.PluggedIn
-import org.apache.tinkerpop.gremlin.console.util.ArrayIterator
import org.apache.tinkerpop.gremlin.groovy.loaders.GremlinLoader
import org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin
import jline.console.history.FileHistory
+import org.apache.tinkerpop.gremlin.util.iterator.ArrayIterator
import org.codehaus.groovy.tools.shell.ExitNotification
import org.codehaus.groovy.tools.shell.Groovysh
import org.codehaus.groovy.tools.shell.IO
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d06a179d/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/util/ArrayIterator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/util/ArrayIterator.groovy b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/util/ArrayIterator.groovy
deleted file mode 100644
index b6503ef..0000000
--- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/util/ArrayIterator.groovy
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.console.util
-
-import org.apache.tinkerpop.gremlin.process.FastNoSuchElementException
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-class ArrayIterator implements Iterator {
-
- private final Object[] array
- private int count = 0
-
- public ArrayIterator(final Object[] array) {
- this.array = array
- }
-
- public void remove() {
- throw new UnsupportedOperationException()
- }
-
- public Object next() {
- if (count > array.length)
- throw FastNoSuchElementException.instance()
-
- return array[count++]
- }
-
- public boolean hasNext() {
- return count < array.length
- }
-}