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/04/24 18:57:31 UTC

incubator-tinkerpop git commit: added ReferenceGraphTest which ONLY tests Attachable.Method.GET as CREATE only creates ids, no data.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master e790a89b0 -> 1ea7692d3


added ReferenceGraphTest which ONLY tests Attachable.Method.GET as CREATE only creates ids, no data.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/1ea7692d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/1ea7692d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/1ea7692d

Branch: refs/heads/master
Commit: 1ea7692d304243ad36ae896bc86c9739995e9aa3
Parents: e790a89
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Fri Apr 24 10:57:27 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Fri Apr 24 10:57:27 2015 -0600

----------------------------------------------------------------------
 .../structure/StructureStandardSuite.java       |  2 +
 .../util/reference/ReferenceGraphTest.java      | 54 ++++++++++++++++++++
 2 files changed, 56 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1ea7692d/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
index f65eb65..b18fdcf 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureStandardSuite.java
@@ -29,6 +29,7 @@ import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedPropertyTest
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexPropertyTest;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexTest;
 import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdgeTest;
+import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceGraphTest;
 import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertexPropertyTest;
 import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertexTest;
 import org.apache.tinkerpop.gremlin.structure.util.star.StarGraphTest;
@@ -91,6 +92,7 @@ public class StructureStandardSuite extends AbstractGremlinSuite {
             VertexPropertyTest.class,
             VariablesTest.class,
             PropertyTest.class,
+            ReferenceGraphTest.class,
             ReferenceEdgeTest.class,
             ReferenceVertexPropertyTest.class,
             ReferenceVertexTest.class,

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1ea7692d/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceGraphTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceGraphTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceGraphTest.java
new file mode 100644
index 0000000..6423096
--- /dev/null
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/reference/ReferenceGraphTest.java
@@ -0,0 +1,54 @@
+/*
+ *
+ *  * 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.structure.util.reference;
+
+import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
+import org.apache.tinkerpop.gremlin.LoadGraphWith;
+import org.apache.tinkerpop.gremlin.TestHelper;
+import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.apache.tinkerpop.gremlin.structure.util.Attachable;
+import org.junit.Test;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class ReferenceGraphTest extends AbstractGremlinTest {
+
+    @Test
+    @LoadGraphWith(LoadGraphWith.GraphData.CREW)
+    public void testAttachableGetMethod() {
+        // vertex host
+        g.V().forEachRemaining(vertex -> TestHelper.validateEquality(vertex, ReferenceFactory.detach(vertex).attach(Attachable.Method.get(vertex))));
+        g.V().forEachRemaining(vertex -> vertex.properties().forEachRemaining(vertexProperty -> TestHelper.validateEquality(vertexProperty, ReferenceFactory.detach(vertexProperty).attach(Attachable.Method.get(vertex)))));
+        g.V().forEachRemaining(vertex -> vertex.properties().forEachRemaining(vertexProperty -> vertexProperty.properties().forEachRemaining(property -> TestHelper.validateEquality(property, ReferenceFactory.detach(property).attach(Attachable.Method.get(vertex))))));
+        g.V().forEachRemaining(vertex -> vertex.edges(Direction.OUT).forEachRemaining(edge -> TestHelper.validateEquality(edge, ReferenceFactory.detach(edge).attach(Attachable.Method.get(vertex)))));
+        g.V().forEachRemaining(vertex -> vertex.edges(Direction.OUT).forEachRemaining(edge -> edge.properties().forEachRemaining(property -> TestHelper.validateEquality(property, ReferenceFactory.detach(property).attach(Attachable.Method.get(vertex))))));
+
+        // graph host
+        g.V().forEachRemaining(vertex -> TestHelper.validateEquality(vertex, ReferenceFactory.detach(vertex).attach(Attachable.Method.get(graph))));
+        g.V().forEachRemaining(vertex -> vertex.properties().forEachRemaining(vertexProperty -> TestHelper.validateEquality(vertexProperty, ReferenceFactory.detach(vertexProperty).attach(Attachable.Method.get(graph)))));
+        g.V().forEachRemaining(vertex -> vertex.properties().forEachRemaining(vertexProperty -> vertexProperty.properties().forEachRemaining(property -> TestHelper.validateEquality(property, ReferenceFactory.detach(property).attach(Attachable.Method.get(graph))))));
+        g.V().forEachRemaining(vertex -> vertex.edges(Direction.OUT).forEachRemaining(edge -> TestHelper.validateEquality(edge, ReferenceFactory.detach(edge).attach(Attachable.Method.get(graph)))));
+        g.V().forEachRemaining(vertex -> vertex.edges(Direction.OUT).forEachRemaining(edge -> edge.properties().forEachRemaining(property -> TestHelper.validateEquality(property, ReferenceFactory.detach(property).attach(Attachable.Method.get(graph))))));
+
+    }
+}
\ No newline at end of file