[2/3] tinkerpop git commit: TinkerGraph's would not save on close()
TinkerGraph's would not save on close() if the path was just a file name. Tested "just a file name" manually and added a test for relative paths - didn't want to generate test data outside of our test directories. TINKERPOP-1451 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/371bb39c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/371bb39c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/371bb39c Branch: refs/heads/tp31 Commit: 371bb39c5c23bb766f391974ea024219a5941fe8 Parents: e7e7481 Author: Stephen MalletteAuthored: Thu Sep 15 13:51:33 2016 -0400 Committer: Stephen Mallette Committed: Thu Sep 15 14:41:00 2016 -0400 -- CHANGELOG.asciidoc | 1 + .../tinkergraph/structure/TinkerGraph.java | 4 +++- .../tinkergraph/structure/TinkerGraphTest.java | 22 3 files changed, 26 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/371bb39c/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 4d990ee..6984b58 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -27,6 +27,7 @@ TinkerPop 3.1.5 (Release Date: NOT OFFICIALLY RELEASED YET) ~~~ * Removed the `appveyor.yml` file as the AppVeyor build is no longer enabled by Apache Infrastructure. +* Fixed TinkerGraph which was not saving on `close()` if the path only consisted of the file name. * Fixed a bug in `RangeByIsCountStrategy` which didn't use the `NotStep` properly. [[release-3-1-4]] http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/371bb39c/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java -- diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java index af7245a..5df47b6 100644 --- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java +++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java @@ -299,7 +299,9 @@ public final class TinkerGraph implements Graph { f.delete(); } else { final File parent = f.getParentFile(); -if (!parent.exists()) { + +// the parent would be null in the case of an relative path if the graphLocation was simply: "f.gryo" +if (parent != null && !parent.exists()) { parent.mkdirs(); } } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/371bb39c/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java -- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java index fca1275..e9b7f7b 100644 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java @@ -440,6 +440,28 @@ public class TinkerGraphTest { } @Test +public void shouldPersistWithRelativePath() { +final String graphLocation = "shouldPersistToGryoRelative.kryo"; +final File f = new File(graphLocation); +if (f.exists() && f.isFile()) f.delete(); + +try { +final Configuration conf = new BaseConfiguration(); +conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, "gryo"); +conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, graphLocation); +final TinkerGraph graph = TinkerGraph.open(conf); +TinkerFactory.generateModern(graph); +graph.close(); + +final TinkerGraph reloadedGraph = TinkerGraph.open(conf); +IoTest.assertModernGraph(reloadedGraph, true, false); +reloadedGraph.close(); +} catch (Exception ex) { +if (f.exists() && f.isFile()) f.delete(); +} +} + +@Test public void shouldPersistToAnyGraphFormat() { final String graphLocation = TestHelper.makeTestDataDirectory(TinkerGraphTest.class) + "shouldPersistToAnyGraphFormat.dat"; final File f = new
[3/3] tinkerpop git commit: Merge branch 'TINKERPOP-1451' into tp31
Merge branch 'TINKERPOP-1451' into tp31 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ec10b62d Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ec10b62d Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ec10b62d Branch: refs/heads/tp31 Commit: ec10b62d9a59be80858276a062aaea74e50d0cf0 Parents: 4ed0095 356b7c8 Author: Stephen MalletteAuthored: Tue Sep 20 06:57:46 2016 -0400 Committer: Stephen Mallette Committed: Tue Sep 20 06:57:46 2016 -0400 -- CHANGELOG.asciidoc | 1 + .../tinkergraph/structure/TinkerGraph.java | 4 +- .../tinkergraph/structure/TinkerGraphTest.java | 39 3 files changed, 43 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ec10b62d/CHANGELOG.asciidoc -- diff --cc CHANGELOG.asciidoc index a9dae9d,6984b58..8c5f7c7 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@@ -26,8 -26,8 +26,9 @@@ image::https://raw.githubusercontent.co TinkerPop 3.1.5 (Release Date: NOT OFFICIALLY RELEASED YET) ~~~ +* Improved session cleanup when a close is triggered by the client. * Removed the `appveyor.yml` file as the AppVeyor build is no longer enabled by Apache Infrastructure. + * Fixed TinkerGraph which was not saving on `close()` if the path only consisted of the file name. * Fixed a bug in `RangeByIsCountStrategy` which didn't use the `NotStep` properly. [[release-3-1-4]]
[4/4] tinkerpop git commit: Merge remote-tracking branch 'origin/tp31'
Merge remote-tracking branch 'origin/tp31' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ba58ca1b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ba58ca1b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ba58ca1b Branch: refs/heads/master Commit: ba58ca1b0791bd1dde6616e63e0d4fde830a6ba7 Parents: 554bbb8 ec10b62 Author: Stephen MalletteAuthored: Tue Sep 20 06:58:12 2016 -0400 Committer: Stephen Mallette Committed: Tue Sep 20 06:58:12 2016 -0400 -- CHANGELOG.asciidoc | 1 + .../tinkergraph/structure/TinkerGraph.java | 4 +- .../tinkergraph/structure/TinkerGraphTest.java | 39 3 files changed, 43 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ba58ca1b/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ba58ca1b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ba58ca1b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java --
[1/3] tinkerpop git commit: Added a test for persisting multi-properties in TinkerGraph
Repository: tinkerpop Updated Branches: refs/heads/tp31 4ed009525 -> ec10b62d9 Added a test for persisting multi-properties in TinkerGraph Changed the test back to using a relative path in the data directory - didn't like it polluting the source control directories. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/356b7c81 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/356b7c81 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/356b7c81 Branch: refs/heads/tp31 Commit: 356b7c81a9517c89204efb1f0e0e30037bd04ae0 Parents: 371bb39 Author: Stephen MalletteAuthored: Thu Sep 15 14:08:31 2016 -0400 Committer: Stephen Mallette Committed: Thu Sep 15 14:41:00 2016 -0400 -- .../tinkergraph/structure/TinkerGraphTest.java | 47 +--- 1 file changed, 32 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/356b7c81/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java -- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java index e9b7f7b..f5797ca 100644 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java @@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.structure.VertexProperty; import org.apache.tinkerpop.gremlin.structure.io.Io; import org.apache.tinkerpop.gremlin.structure.io.GraphReader; import org.apache.tinkerpop.gremlin.structure.io.GraphWriter; @@ -440,25 +441,41 @@ public class TinkerGraphTest { } @Test +public void shouldPersistToGryoAndHandleMultiProperties() { +final String graphLocation = TestHelper.makeTestDataDirectory(TinkerGraphTest.class) + "shouldPersistToGryoMulti.kryo"; +final File f = new File(graphLocation); +if (f.exists() && f.isFile()) f.delete(); + +final Configuration conf = new BaseConfiguration(); +conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, "gryo"); +conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, graphLocation); +final TinkerGraph graph = TinkerGraph.open(conf); +TinkerFactory.generateTheCrew(graph); +graph.close(); + + conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_DEFAULT_VERTEX_PROPERTY_CARDINALITY, VertexProperty.Cardinality.list.toString()); +final TinkerGraph reloadedGraph = TinkerGraph.open(conf); +IoTest.assertCrewGraph(reloadedGraph, false); +reloadedGraph.close(); +} + +@Test public void shouldPersistWithRelativePath() { -final String graphLocation = "shouldPersistToGryoRelative.kryo"; +final String graphLocation = TestHelper.convertToRelative(TinkerGraphTest.class, +new File(TestHelper.makeTestDataDirectory(TinkerGraphTest.class))) + "shouldPersistToGryoRelative.kryo"; final File f = new File(graphLocation); if (f.exists() && f.isFile()) f.delete(); -try { -final Configuration conf = new BaseConfiguration(); -conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, "gryo"); -conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, graphLocation); -final TinkerGraph graph = TinkerGraph.open(conf); -TinkerFactory.generateModern(graph); -graph.close(); - -final TinkerGraph reloadedGraph = TinkerGraph.open(conf); -IoTest.assertModernGraph(reloadedGraph, true, false); -reloadedGraph.close(); -} catch (Exception ex) { -if (f.exists() && f.isFile()) f.delete(); -} +final Configuration conf = new BaseConfiguration(); +conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, "gryo"); +conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, graphLocation); +final TinkerGraph graph = TinkerGraph.open(conf); +TinkerFactory.generateModern(graph); +graph.close(); + +final TinkerGraph reloadedGraph = TinkerGraph.open(conf); +IoTest.assertModernGraph(reloadedGraph, true, false); +reloadedGraph.close(); }
[3/4] tinkerpop git commit: Merge branch 'TINKERPOP-1451' into tp31
Merge branch 'TINKERPOP-1451' into tp31 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ec10b62d Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ec10b62d Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ec10b62d Branch: refs/heads/master Commit: ec10b62d9a59be80858276a062aaea74e50d0cf0 Parents: 4ed0095 356b7c8 Author: Stephen MalletteAuthored: Tue Sep 20 06:57:46 2016 -0400 Committer: Stephen Mallette Committed: Tue Sep 20 06:57:46 2016 -0400 -- CHANGELOG.asciidoc | 1 + .../tinkergraph/structure/TinkerGraph.java | 4 +- .../tinkergraph/structure/TinkerGraphTest.java | 39 3 files changed, 43 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ec10b62d/CHANGELOG.asciidoc -- diff --cc CHANGELOG.asciidoc index a9dae9d,6984b58..8c5f7c7 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@@ -26,8 -26,8 +26,9 @@@ image::https://raw.githubusercontent.co TinkerPop 3.1.5 (Release Date: NOT OFFICIALLY RELEASED YET) ~~~ +* Improved session cleanup when a close is triggered by the client. * Removed the `appveyor.yml` file as the AppVeyor build is no longer enabled by Apache Infrastructure. + * Fixed TinkerGraph which was not saving on `close()` if the path only consisted of the file name. * Fixed a bug in `RangeByIsCountStrategy` which didn't use the `NotStep` properly. [[release-3-1-4]]
[1/4] tinkerpop git commit: Added a test for persisting multi-properties in TinkerGraph
Repository: tinkerpop Updated Branches: refs/heads/master 554bbb82e -> ba58ca1b0 Added a test for persisting multi-properties in TinkerGraph Changed the test back to using a relative path in the data directory - didn't like it polluting the source control directories. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/356b7c81 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/356b7c81 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/356b7c81 Branch: refs/heads/master Commit: 356b7c81a9517c89204efb1f0e0e30037bd04ae0 Parents: 371bb39 Author: Stephen MalletteAuthored: Thu Sep 15 14:08:31 2016 -0400 Committer: Stephen Mallette Committed: Thu Sep 15 14:41:00 2016 -0400 -- .../tinkergraph/structure/TinkerGraphTest.java | 47 +--- 1 file changed, 32 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/356b7c81/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java -- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java index e9b7f7b..f5797ca 100644 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java @@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.structure.VertexProperty; import org.apache.tinkerpop.gremlin.structure.io.Io; import org.apache.tinkerpop.gremlin.structure.io.GraphReader; import org.apache.tinkerpop.gremlin.structure.io.GraphWriter; @@ -440,25 +441,41 @@ public class TinkerGraphTest { } @Test +public void shouldPersistToGryoAndHandleMultiProperties() { +final String graphLocation = TestHelper.makeTestDataDirectory(TinkerGraphTest.class) + "shouldPersistToGryoMulti.kryo"; +final File f = new File(graphLocation); +if (f.exists() && f.isFile()) f.delete(); + +final Configuration conf = new BaseConfiguration(); +conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, "gryo"); +conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, graphLocation); +final TinkerGraph graph = TinkerGraph.open(conf); +TinkerFactory.generateTheCrew(graph); +graph.close(); + + conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_DEFAULT_VERTEX_PROPERTY_CARDINALITY, VertexProperty.Cardinality.list.toString()); +final TinkerGraph reloadedGraph = TinkerGraph.open(conf); +IoTest.assertCrewGraph(reloadedGraph, false); +reloadedGraph.close(); +} + +@Test public void shouldPersistWithRelativePath() { -final String graphLocation = "shouldPersistToGryoRelative.kryo"; +final String graphLocation = TestHelper.convertToRelative(TinkerGraphTest.class, +new File(TestHelper.makeTestDataDirectory(TinkerGraphTest.class))) + "shouldPersistToGryoRelative.kryo"; final File f = new File(graphLocation); if (f.exists() && f.isFile()) f.delete(); -try { -final Configuration conf = new BaseConfiguration(); -conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, "gryo"); -conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, graphLocation); -final TinkerGraph graph = TinkerGraph.open(conf); -TinkerFactory.generateModern(graph); -graph.close(); - -final TinkerGraph reloadedGraph = TinkerGraph.open(conf); -IoTest.assertModernGraph(reloadedGraph, true, false); -reloadedGraph.close(); -} catch (Exception ex) { -if (f.exists() && f.isFile()) f.delete(); -} +final Configuration conf = new BaseConfiguration(); +conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, "gryo"); +conf.setProperty(TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, graphLocation); +final TinkerGraph graph = TinkerGraph.open(conf); +TinkerFactory.generateModern(graph); +graph.close(); + +final TinkerGraph reloadedGraph = TinkerGraph.open(conf); +IoTest.assertModernGraph(reloadedGraph, true, false); +reloadedGraph.close(); }
[4/4] tinkerpop git commit: Merge branch 'TINKERPOP-1437'
Merge branch 'TINKERPOP-1437' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/554bbb82 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/554bbb82 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/554bbb82 Branch: refs/heads/master Commit: 554bbb82ee565ca0e170e6a5fa03e70a27e1d9e9 Parents: 54ed33d f93 Author: Stephen MalletteAuthored: Tue Sep 20 06:56:21 2016 -0400 Committer: Stephen Mallette Committed: Tue Sep 20 06:56:21 2016 -0400 -- CHANGELOG.asciidoc | 1 + .../step/filter/GroovyDedupTest.groovy | 10 + .../process/AbstractGremlinProcessTest.java | 16 .../traversal/step/filter/DedupTest.java| 40 4 files changed, 60 insertions(+), 7 deletions(-) --
[2/4] tinkerpop git commit: Used assertThat for better output on failure.
Used assertThat for better output on failure. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c621154e Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c621154e Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c621154e Branch: refs/heads/master Commit: c621154e2e1f1c7163266148d5591700555a5ac1 Parents: 9666bb3 Author: Stephen MalletteAuthored: Sat Sep 17 03:18:15 2016 -0400 Committer: Stephen Mallette Committed: Sat Sep 17 03:18:15 2016 -0400 -- .../gremlin/process/AbstractGremlinProcessTest.java | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c621154e/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java -- diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java index 201822c..1e37478 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java @@ -36,6 +36,8 @@ import java.util.Map; import java.util.UUID; import java.util.stream.Collectors; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -92,13 +94,13 @@ public abstract class AbstractGremlinProcessTest extends AbstractGremlinTest { counter++; final String key = (String) keysClasses[i]; final Class clazz = (Class) keysClasses[i + 1]; -assertTrue(sideEffects.keys().contains(key)); -assertTrue(sideEffects.exists(key)); +assertThat(sideEffects.keys().contains(key), is(true)); +assertThat(sideEffects.exists(key), is(true)); assertEquals(clazz, sideEffects.get((String) keysClasses[i]).getClass()); -assertFalse(sideEffects.exists(UUID.randomUUID().toString())); +assertThat(sideEffects.exists(UUID.randomUUID().toString()), is(false)); } assertEquals(sideEffects.keys().size(), counter); -assertFalse(sideEffects.keys().contains(UUID.randomUUID().toString())); +assertThat(sideEffects.keys().contains(UUID.randomUUID().toString()), is(false)); assertEquals(StringFactory.traversalSideEffectsString(sideEffects), sideEffects.toString()); } @@ -113,9 +115,9 @@ public abstract class AbstractGremlinProcessTest extends AbstractGremlinTest { for (T t : results) { if (t instanceof Map) { -assertTrue("Checking map result existence: " + t, expectedResults.stream().filter(e -> e instanceof Map).filter(e -> internalCheckMap((Map) e, (Map) t)).findAny().isPresent()); +assertThat("Checking map result existence: " + t, expectedResults.stream().filter(e -> e instanceof Map).filter(e -> internalCheckMap((Map) e, (Map) t)).findAny().isPresent(), is(true)); } else { -assertTrue("Checking result existence: " + t, expectedResults.contains(t)); +assertThat("Checking result existence: " + t, expectedResults.contains(t), is(true)); } } final Map expectedResultsCount = new HashMap<>(); @@ -124,7 +126,7 @@ public abstract class AbstractGremlinProcessTest extends AbstractGremlinTest { expectedResults.forEach(t -> MapHelper.incr(expectedResultsCount, t, 1l)); results.forEach(t -> MapHelper.incr(resultsCount, t, 1l)); expectedResultsCount.forEach((k, v) -> assertEquals("Checking result group counts", v, resultsCount.get(k))); -assertFalse(traversal.hasNext()); +assertThat(traversal.hasNext(), is(false)); } public static void checkResults(final Map expectedResults, final Traversal traversal) {
[1/4] tinkerpop git commit: Added tests for dedup(Scope, String...) overload in DedupTest
Repository: tinkerpop Updated Branches: refs/heads/master 54ed33df5 -> 554bbb82e Added tests for dedup(Scope,String...) overload in DedupTest Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9666bb3d Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9666bb3d Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9666bb3d Branch: refs/heads/master Commit: 9666bb3dc2f593b66095b3e764678ccfc35630a5 Parents: 4293eb3 Author: Stephen MalletteAuthored: Fri Sep 16 16:17:33 2016 -0400 Committer: Stephen Mallette Committed: Fri Sep 16 16:17:33 2016 -0400 -- CHANGELOG.asciidoc | 1 + .../step/filter/GroovyDedupTest.groovy | 10 .../traversal/step/filter/DedupTest.java| 48 3 files changed, 59 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9666bb3d/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 7c4178d..92aff5a 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -27,6 +27,7 @@ TinkerPop 3.2.3 (Release Date: NOT OFFICIALLY RELEASED YET) ~~~ * Fixed a bug in Gremlin-Python `P` where predicates reversed the order of the predicates. +* Added tests to `DedupTest` for the `dedup(Scope, String...)` overload. * Fixed a naming bug in Gremlin-Python where `P._and` and `P._or` should be `P.and_` and `P.or_`. (*breaking*) * `where()` predicate-based steps now support `by()`-modulation. * `TraversalRing` returns a `null` if it does not contain traversals (previously `IdentityTraversal`). http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9666bb3d/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyDedupTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyDedupTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyDedupTest.groovy index 86c3e15..cfad92b 100644 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyDedupTest.groovy +++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyDedupTest.groovy @@ -19,6 +19,7 @@ package org.apache.tinkerpop.gremlin.process.traversal.step.filter import org.apache.tinkerpop.gremlin.process.traversal.Path +import org.apache.tinkerpop.gremlin.process.traversal.Scope import org.apache.tinkerpop.gremlin.process.traversal.Traversal import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal import org.apache.tinkerpop.gremlin.structure.Vertex @@ -30,6 +31,15 @@ import org.apache.tinkerpop.gremlin.structure.Vertex public abstract class GroovyDedupTest { public static class Traversals extends DedupTest { +@Override +public Traversal get_g_V_out_in_valuesXnameX_fold_dedupXlocalX_unfold() { +return new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out.in.values('name').fold.dedup(Scope.local).unfold;"); +} + +@Override +public Traversal > get_g_V_out_in_asXxX_in_asXyX_selectXx_yX_byXnameX_fold_dedupXlocal_x_yX_unfold() { +return new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out.as('x').in.as('y').select('x','y').by('name').fold.dedup(Scope.local,'x','y').unfold"); +} @Override public Traversal get_g_V_both_dedup_name() { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9666bb3d/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DedupTest.java -- diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DedupTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DedupTest.java index fe1db71..a0cc6e9 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DedupTest.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DedupTest.java @@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest; import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner; import org.apache.tinkerpop.gremlin.process.traversal.Order; import org.apache.tinkerpop.gremlin.process.traversal.Path; +import
[1/2] tinkerpop git commit: Upload only diffs in `publish-docs.sh`. [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-927-master 120cef66d -> 8d718bb2e (forced update) Upload only diffs in `publish-docs.sh`. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/86007ee2 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/86007ee2 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/86007ee2 Branch: refs/heads/TINKERPOP-927-master Commit: 86007ee2029feeaf592b62978e1b3b0f9cfe2ed0 Parents: 4ed0095 Author: Daniel KuppitzAuthored: Mon Sep 19 15:20:50 2016 +0200 Committer: Daniel Kuppitz Committed: Tue Sep 20 14:40:24 2016 +0200 -- bin/publish-docs.awk | 31 +++ bin/publish-docs.sh | 42 +- 2 files changed, 56 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/86007ee2/bin/publish-docs.awk -- diff --git a/bin/publish-docs.awk b/bin/publish-docs.awk new file mode 100644 index 000..d3e0d64 --- /dev/null +++ b/bin/publish-docs.awk @@ -0,0 +1,31 @@ +# 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. + +# +# @author Daniel Kuppitz (http://gremlin.guru) +# +/^Files / { + print "U " gensub("^[^/]*/[^/]*/", "", "g", $2) +} + +/^Only in (java)?docs/ { + print "D " gensub(/:$/, "", "g", gensub("^[^/]*/[^/]*/", "", "g", $3)) "/" $4 +} + +/^Only in \.\./ { + print "A " gensub(/:$/, "", "g", gensub("^[^/]*/[^/]*/[^/]*/", "", "g", $3)) "/" $4 +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/86007ee2/bin/publish-docs.sh -- diff --git a/bin/publish-docs.sh b/bin/publish-docs.sh index 23e2d4d..49ed9bd 100755 --- a/bin/publish-docs.sh +++ b/bin/publish-docs.sh @@ -39,25 +39,33 @@ mkdir -p target/svn ${SVN_CMD} co --depth immediates https://svn.apache.org/repos/asf/tinkerpop/site target/svn pushd target/svn -${SVN_CMD} update --depth empty "docs/${VERSION}" -${SVN_CMD} update --depth empty "javadocs/${VERSION}" -${SVN_CMD} rm "docs/${VERSION}" -${SVN_CMD} rm "javadocs/${VERSION}" -${SVN_CMD} commit . -m "Docs for TinkerPop ${VERSION} are being replaced." -popd -mkdir -p "target/svn/docs/${VERSION}" -mkdir -p "target/svn/javadocs/${VERSION}/core" -mkdir -p "target/svn/javadocs/${VERSION}/full" +${SVN_CMD} update "docs/${VERSION}" +${SVN_CMD} update "javadocs/${VERSION}" -cp -R target/docs/htmlsingle/. "target/svn/docs/${VERSION}" -cp -R target/site/apidocs/core/. "target/svn/javadocs/${VERSION}/core" -cp -R target/site/apidocs/full/. "target/svn/javadocs/${VERSION}/full" +mkdir -p "docs/${VERSION}" +mkdir -p "javadocs/${VERSION}/core" +mkdir -p "javadocs/${VERSION}/full" -pushd target/svn -rm "docs/${VERSION}/images/tinkerpop3.graffle" -${SVN_CMD} update --depth empty "docs/${VERSION}" -${SVN_CMD} update --depth empty "javadocs/${VERSION}" +diff -rq -I '^Last updated' docs/${VERSION}/ ../docs/htmlsingle/ | awk -f ../../bin/publish-docs.awk | sed 's/^\(.\) \//\1 /g' > ../publish-docs.docs +diff -rq -I 'Generated by javadoc' -I '^ ../publish-docs.javadocs + +# copy new / modified files +for file in $(cat ../publish-docs.docs | awk '/^[AU]/ {print $2}' | grep -v '.graffle$') +do + cp "../docs/htmlsingle/${file}" "docs/${VERSION}/${file}" +done +for file in $(cat ../publish-docs.javadocs | awk '/^[AU]/ {print $2}') +do + cp "../site/apidocs/${file}" "javadocs/${VERSION}/${file}" +done + +pushd "docs/${VERSION}/"; cat ../../../publish-docs.docs | awk '/^A/ {print $2}' | grep -v '.graffle$' | xargs --no-run-if-empty svn add; popd +pushd "javadocs/${VERSION}/"; cat ../../../publish-docs.javadocs | awk '/^A/ {print $2}' | xargs --no-run-if-empty svn add; popd + +# delete old files +pushd "docs/${VERSION}/"; cat ../../../publish-docs.docs | awk '/^D/ {print $2}' | xargs --no-run-if-empty svn delete; popd +pushd "javadocs/${VERSION}/"; cat ../../../publish-docs.javadocs | awk '/^D/ {print $2}' | xargs
[3/3] tinkerpop git commit: Merge remote-tracking branch 'origin/tp31'
Merge remote-tracking branch 'origin/tp31' Conflicts: gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f8092a1a Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f8092a1a Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f8092a1a Branch: refs/heads/master Commit: f8092a1a84bbd97a85eefdd8c94dc5c050b5b562 Parents: ba58ca1 02bbdfb Author: Stephen MalletteAuthored: Tue Sep 20 14:51:29 2016 -0400 Committer: Stephen Mallette Committed: Tue Sep 20 14:51:29 2016 -0400 -- CHANGELOG.asciidoc | 1 + .../apache/tinkerpop/gremlin/process/GremlinProcessRunner.java | 3 +-- .../tinkerpop/gremlin/process/traversal/step/map/MapTest.java| 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f8092a1a/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f8092a1a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java --
[1/3] tinkerpop git commit: Corrected test names in MapTest CTR
Repository: tinkerpop Updated Branches: refs/heads/master ba58ca1b0 -> f8092a1a8 Corrected test names in MapTest CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f22ec974 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f22ec974 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f22ec974 Branch: refs/heads/master Commit: f22ec97422464479bacfa31aff0320d1417547a3 Parents: ec10b62 Author: Stephen MalletteAuthored: Tue Sep 20 14:45:00 2016 -0400 Committer: Stephen Mallette Committed: Tue Sep 20 14:45:00 2016 -0400 -- CHANGELOG.asciidoc | 1 + .../tinkerpop/gremlin/process/traversal/step/map/MapTest.java| 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f22ec974/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 8c5f7c7..4b39cc7 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima TinkerPop 3.1.5 (Release Date: NOT OFFICIALLY RELEASED YET) ~~~ +* Corrected naming of `g_withPath_V_asXaX_out_out_mapXa_name_it_nameX` and `g_withPath_V_asXaX_out_mapXa_nameX` in `MapTest`. * Improved session cleanup when a close is triggered by the client. * Removed the `appveyor.yml` file as the AppVeyor build is no longer enabled by Apache Infrastructure. * Fixed TinkerGraph which was not saving on `close()` if the path only consisted of the file name. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f22ec974/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapTest.java -- diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapTest.java index 0ea91ec..40c92e9 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapTest.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MapTest.java @@ -87,7 +87,7 @@ public abstract class MapTest extends AbstractGremlinProcessTest { @Test @LoadGraphWith(MODERN) @IgnoreEngine(TraversalEngine.Type.COMPUTER) -public void g_V_asXaX_out_mapXa_nameX() { +public void g_withPath_V_asXaX_out_mapXa_nameX() { int marko = 0; int peter = 0; int josh = 0; @@ -111,7 +111,7 @@ public abstract class MapTest extends AbstractGremlinProcessTest { @Test @LoadGraphWith(MODERN) @IgnoreEngine(TraversalEngine.Type.COMPUTER) -public void g_V_asXaX_out_out_mapXa_name_it_nameX() { +public void g_withPath_V_asXaX_out_out_mapXa_name_it_nameX() { final Traversal traversal = get_g_withPath_V_asXaX_out_out_mapXa_name_it_nameX(); int counter = 0; while (traversal.hasNext()) {
[2/2] tinkerpop git commit: Finalize variable CTR
Finalize variable CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/02bbdfbc Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/02bbdfbc Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/02bbdfbc Branch: refs/heads/tp31 Commit: 02bbdfbc3712d7b3d988245a5df860838ddb67df Parents: f22ec97 Author: Stephen MalletteAuthored: Tue Sep 20 14:50:07 2016 -0400 Committer: Stephen Mallette Committed: Tue Sep 20 14:50:07 2016 -0400 -- .../org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/02bbdfbc/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java -- diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java index c5d19b5..b761719 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/GremlinProcessRunner.java @@ -36,7 +36,7 @@ import java.io.NotSerializableException; */ public class GremlinProcessRunner extends BlockJUnit4ClassRunner { private static final Logger logger = LoggerFactory.getLogger(GremlinProcessRunner.class); -public GremlinProcessRunner(Class klass) throws InitializationError { +public GremlinProcessRunner(final Class klass) throws InitializationError { super(klass); }
[3/3] tinkerpop git commit: Merge branch 'hasVarargs'
Merge branch 'hasVarargs' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/19a5c389 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/19a5c389 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/19a5c389 Branch: refs/heads/master Commit: 19a5c389e06c3c752b1ad8f5144d34d5c3e2c760 Parents: f8092a1 56d738c Author: Daniel KuppitzAuthored: Wed Sep 21 00:56:04 2016 +0200 Committer: Daniel Kuppitz Committed: Wed Sep 21 00:56:04 2016 +0200 -- .../upgrade/release-3.2.x-incubating.asciidoc | 25 .../traversal/dsl/graph/GraphTraversal.java | 21 +++ .../traversal/step/filter/HasStepTest.java | 66 3 files changed, 98 insertions(+), 14 deletions(-) --
[1/3] tinkerpop git commit: Made `has[Id|Label|Key|Value]` compatible with the old varargs method signature and added tests to ensure the compatibility.
Repository: tinkerpop Updated Branches: refs/heads/master f8092a1a8 -> 19a5c389e Made `has[Id|Label|Key|Value]` compatible with the old varargs method signature and added tests to ensure the compatibility. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5cd2bcaf Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5cd2bcaf Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5cd2bcaf Branch: refs/heads/master Commit: 5cd2bcaff3892a06673f7b0b6db2d45649793700 Parents: 4293eb3 Author: Daniel KuppitzAuthored: Fri Sep 16 18:06:08 2016 +0200 Committer: Daniel Kuppitz Committed: Fri Sep 16 18:06:08 2016 +0200 -- .../traversal/dsl/graph/GraphTraversal.java | 21 +++ .../traversal/step/filter/HasStepTest.java | 66 2 files changed, 73 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5cd2bcaf/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java index d025184..c8af8ca 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java @@ -968,27 +968,20 @@ public interface GraphTraversal extends Traversal{ } public default GraphTraversalhas(final T accessor, final Object value, final Object... values) { -final Object[] objects; if (value instanceof Object[]) { final Object[] arr = (Object[]) value; if (values.length == 0) { if (arr.length == 1) { -return has(accessor, P.eq(arr)); +return has(accessor, P.eq(arr[0])); } -objects = arr; -} else { -objects = new Object[arr.length + values.length]; -System.arraycopy(arr, 0, objects, 0, arr.length); -System.arraycopy(values, 0, objects, arr.length, values.length); +return has(accessor, P.within(arr)); } -} else { -if (values.length == 0) { -return has(accessor, value instanceof P ? (P) value : P.eq(value)); -} -objects = new Object[values.length + 1]; -objects[0] = value; -System.arraycopy(values, 0, objects, 1, values.length); +} else if (values.length == 0) { +return has(accessor, value instanceof P ? (P) value : P.eq(value)); } +final Object[] objects = new Object[values.length + 1]; +objects[0] = value; +System.arraycopy(values, 0, objects, 1, values.length); return has(accessor, P.within(objects)); } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5cd2bcaf/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasStepTest.java -- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasStepTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasStepTest.java index 90ef4a2..63c843d 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasStepTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasStepTest.java @@ -18,14 +18,19 @@ */ package org.apache.tinkerpop.gremlin.process.traversal.step.filter; +import org.apache.tinkerpop.gremlin.process.traversal.Step; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.process.traversal.step.StepTest; +import org.junit.Test; import java.util.Arrays; import java.util.List; +import static org.apache.tinkerpop.gremlin.process.traversal.P.eq; +import static org.apache.tinkerpop.gremlin.process.traversal.P.within; import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.out; +import static org.junit.Assert.assertEquals; /** * @author Daniel Kuppitz (http://gremlin.guru) @@ -50,4 +55,65 @@ public class HasStepTest extends StepTest { __.hasValue("josh") ); } + +/** + * This test ensures
[2/3] tinkerpop git commit: Updated upgrade docs.
Updated upgrade docs. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/56d738ca Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/56d738ca Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/56d738ca Branch: refs/heads/master Commit: 56d738cae77f7e03491e5f7b3192051ae6b6069a Parents: 5cd2bca Author: Daniel KuppitzAuthored: Fri Sep 16 19:09:41 2016 +0200 Committer: Daniel Kuppitz Committed: Fri Sep 16 19:09:41 2016 +0200 -- .../upgrade/release-3.2.x-incubating.asciidoc | 25 1 file changed, 25 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/56d738ca/docs/src/upgrade/release-3.2.x-incubating.asciidoc -- diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc index 5db0522..f9c62e2 100644 --- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc +++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc @@ -83,6 +83,31 @@ gremlin> g.V().as('a').out('knows').as('b'). See: link:https://issues.apache.org/jira/browse/TINKERPOP-1330[TINKERPOP-1330] +Change In has() Method Signatures +^ + +The TinkerPop 3.2.2 release unintentionally intoduced a breaking change for some `has()` method overloads. In particular the +behavior for single item array arguments was changed: + +[source,text] + +gremlin> g.V().hasLabel(["software"] as String[]).count() +==>0 + + +Prior this change single item arrays were treated like there was only that single item: + +[source,text] + +gremlin> g.V().hasLabel(["software"] as String[]).count() +==>2 +gremlin> g.V().hasLabel("software").count() +==>2 + + +TinkerPop 3.2.3 fixes this misbehavior and all `has()` method overloads behave like before, except that they no longer +support no arguments. + TinkerPop 3.2.2 ---
tinkerpop git commit: Removed some OptOuts on RemoteGraph.
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1457 6b03f6172 -> f5ef7c13b Removed some OptOuts on RemoteGraph. More tests seem to be working now after the GraphSON 2.0 implementation. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f5ef7c13 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f5ef7c13 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f5ef7c13 Branch: refs/heads/TINKERPOP-1457 Commit: f5ef7c13bce8f9f2b0a057c6c2c26d26a32c1e09 Parents: 6b03f61 Author: Stephen MalletteAuthored: Tue Sep 20 17:18:18 2016 -0400 Committer: Stephen Mallette Committed: Tue Sep 20 17:18:18 2016 -0400 -- .../gremlin/process/remote/RemoteGraph.java | 44 +--- 1 file changed, 10 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f5ef7c13/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteGraph.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteGraph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteGraph.java index 320a60d..2bc310a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteGraph.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/RemoteGraph.java @@ -51,44 +51,12 @@ import java.util.Iterator; @Graph.OptOut( test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountTest", method = "g_V_hasXnoX_groupCountXaX_capXaX", -reason = "This test asserts an empty side-effect which reflects as a null rather than an \"empty\" and thus doens't assert") -@Graph.OptOut( -test = "org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchTest", -method = "g_V_branchXlabelX_optionXperson__ageX_optionXsoftware__langX_optionXsoftware__nameX", -reason = "Issues with Longs") -@Graph.OptOut( -test = "org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseTest", -method = "g_V_chooseXout_countX_optionX2L__nameX_optionX3L__valueMapX", -reason = "Issues with Longs") -@Graph.OptOut( -test = "org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseTest", -method = "g_V_chooseXlabel_eqXpersonX__outXknowsX__inXcreatedXX_name", -reason = "Issues with Longs") -@Graph.OptOut( -test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SackTest", -method = "g_withSackXBigInteger_TEN_powX1000X_assignX_V_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack", -reason = "Issues with BigInteger") -@Graph.OptOut( -test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest", -method = "g_withSideEffectXa_g_VX2XX_VX1X_out_whereXneqXaXX", -reason = "Issues with Longs") -@Graph.OptOut( -test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest", -method = "g_VXlistXv1_v2_v3XX_name", -reason = "Issues with ids") -@Graph.OptOut( -test = "org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasTest", -method = "g_VXv1X_hasXage_gt_30X", -reason = "Issues with ids") +reason = "This test asserts an empty side-effect which reflects as a null rather than an \"empty\" and thus doesn't assert") @Graph.OptOut( test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.PeerPressureTest", method = "*", reason = "h") @Graph.OptOut( -test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.ProjectTest", -method = "*", -reason = "h") -@Graph.OptOut( test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.PageRankTest", method = "*", reason = "h") @@ -97,9 +65,17 @@ import java.util.Iterator; method = "*", reason = "h") @Graph.OptOut( +test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.ProjectTest", +method = "g_V_hasLabelXpersonX_projectXa_bX_byXoutE_countX_byXageX", +reason = "Not happy in OLAP.") +@Graph.OptOut( +test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.ProjectTest", +method = "g_V_outXcreatedX_projectXa_bX_byXnameX_byXinXcreatedX_countX_order_byXselectXbX__decrX_selectXaX", +reason = "Not happy in OLAP.") +@Graph.OptOut( test = "org.apache.tinkerpop.gremlin.process.traversal.CoreTraversalTest", method = "*", -reason = "RemoteGraph can't serialize a lambda so the test fails before it has a chance for the
tinkerpop git commit: Fixed Lambda serialization in bytecode for java/groovy.
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1457 [created] 6b03f6172 Fixed Lambda serialization in bytecode for java/groovy. Standard tests using lambdas are ignored which is why we didn't catch this in the process tests. I added a single test to GremlinServerIntegrationTest to just validate that lambdas could be sent, so we at least have a basic smoke test for that functionality. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6b03f617 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6b03f617 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6b03f617 Branch: refs/heads/TINKERPOP-1457 Commit: 6b03f61723837809c61951a516d5a8207d8d18f1 Parents: f8092a1 Author: Stephen MalletteAuthored: Tue Sep 20 16:24:34 2016 -0400 Committer: Stephen Mallette Committed: Tue Sep 20 16:27:50 2016 -0400 -- CHANGELOG.asciidoc | 1 + .../io/graphson/GraphSONTypeSerializer.java | 3 +++ .../structure/io/gryo/GryoSerializers.java | 7 - .../AbstractGremlinServerIntegrationTest.java | 2 +- .../server/GremlinServerIntegrateTest.java | 27 5 files changed, 38 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b03f617/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 394cc33..a1b405f 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -28,6 +28,7 @@ TinkerPop 3.2.3 (Release Date: NOT OFFICIALLY RELEASED YET) * Fixed a bug in Gremlin-Python `P` where predicates reversed the order of the predicates. * Added tests to `DedupTest` for the `dedup(Scope, String...)` overload. +* Fixed a bug in serialization of `Lambda` instances in GraphSON, which prevented their use in remote traversals. * Fixed a naming bug in Gremlin-Python where `P._and` and `P._or` should be `P.and_` and `P.or_`. (*breaking*) * `where()` predicate-based steps now support `by()`-modulation. * `TraversalRing` returns a `null` if it does not contain traversals (previously `IdentityTraversal`). http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b03f617/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializer.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializer.java index d1a70af..6198168 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializer.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONTypeSerializer.java @@ -26,6 +26,7 @@ import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Property; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.VertexProperty; +import org.apache.tinkerpop.gremlin.util.function.Lambda; import org.apache.tinkerpop.shaded.jackson.annotation.JsonTypeInfo; import org.apache.tinkerpop.shaded.jackson.core.JsonGenerator; import org.apache.tinkerpop.shaded.jackson.databind.BeanProperty; @@ -198,6 +199,8 @@ public class GraphSONTypeSerializer extends TypeSerializer { return InetAddress.class; } else if (Traverser.class.isAssignableFrom(c)) { return Traverser.class; +} else if (Lambda.class.isAssignableFrom(c)) { +return Lambda.class; } return c; } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6b03f617/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java index f543446..945af87 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializers.java @@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.VertexProperty; import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper; import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion; +import
tinkerpop git commit: SubgraphStrategy no longer filter()-wraps criteria if the criteria is a chain of filters or connectives. This ensures that has() folds to VertexStep and VertexEdgeSteps -- by mos
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1456 d2ae1aaa8 -> 5fc2163df SubgraphStrategy no longer filter()-wraps criteria if the criteria is a chain of filters or connectives. This ensures that has() folds to VertexStep and VertexEdgeSteps -- by most providers. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5fc2163d Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5fc2163d Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5fc2163d Branch: refs/heads/TINKERPOP-1456 Commit: 5fc2163df107ddae830bd68f7a3926d4fcea8211 Parents: d2ae1aa Author: Marko A. RodriguezAuthored: Tue Sep 20 15:05:12 2016 -0600 Committer: Marko A. Rodriguez Committed: Tue Sep 20 15:05:12 2016 -0600 -- CHANGELOG.asciidoc | 1 + .../strategy/decoration/SubgraphStrategy.java | 110 +++ .../decoration/SubgraphStrategyProcessTest.java | 8 +- 3 files changed, 96 insertions(+), 23 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5fc2163d/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 94391b9..4c94aad 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -29,6 +29,7 @@ TinkerPop 3.2.3 (Release Date: NOT OFFICIALLY RELEASED YET) * Fixed a bug in `TraversalVertexProgram` (OLAP) around ordering and connectives (i.e. `and()` and `or()`). * Added `AbstractGremlinProcessTest.checkOrderedResults()` to make testing ordered results easier. * `AbstractLambdaTraversal` now supports a `bypassTraversal` and thus, it is possible for strategies to redefine such lambda traversals. +* `SubgraphStrategy` no longer `filter()`-wraps if the criteria is a chain of filters or connectives. * `SubgraphStrategy` now supports vertex property filtering. * Fixed a bug in Gremlin-Python `P` where predicates reversed the order of the predicates. * Fixed a naming bug in Gremlin-Python where `P._and` and `P._or` should be `P.and_` and `P.or_`. (*breaking*) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5fc2163d/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java index 475a3d7..de7649d 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java @@ -24,6 +24,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.process.traversal.lambda.ElementValueTraversal; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent; +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.ConnectiveStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep; import org.apache.tinkerpop.gremlin.process.traversal.step.filter.LambdaFilterStep; import org.apache.tinkerpop.gremlin.process.traversal.step.filter.OrStep; import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep; @@ -48,7 +50,9 @@ import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.VertexProperty; import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -68,24 +72,47 @@ public final class SubgraphStrategy extends AbstractTraversalStrategy vertexCriterion; private final Traversal.Admin edgeCriterion; private final Traversal.Admin vertexPropertyCriterion; + +private final boolean vertexCriterionIsAllFilter; +private final boolean edgeCriterionIsAllFilter; +private final boolean vertexPropertyCriterionIsAllFilter; + +private static final Set POSTS = Collections.singleton(ConnectiveStrategy.class); + private final String MARKER = Graph.Hidden.hide(UUID.randomUUID().toString()); private SubgraphStrategy(final Traversal vertexCriterion, final Traversal edgeCriterion, final Traversal vertexPropertyCriterion) { +this.vertexCriterionIsAllFilter