Github user spmallette commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/705#discussion_r137840343
  
    --- Diff: 
tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
 ---
    @@ -592,6 +592,31 @@ public void 
shouldSerializeWithColorClassResolverToTinkerGraphUsingDeprecatedTin
             }
         }
     
    +    @Test
    +    public void shouldClone() {
    +        final TinkerGraph g = TinkerGraph.open();
    +
    +        Vertex marko = g.addVertex("name", "marko", "age", 29);
    +        Vertex stephen = g.addVertex("name", "stephen", "age", 35);
    +        marko.addEdge("knows", stephen);
    +
    +        final TinkerGraph g2 = g.clone();
    +        Vertex michael = g2.addVertex("name", "michael");
    +        michael.addEdge("likes", marko);
    +        michael.addEdge("likes", stephen);
    +        g2.traversal().V().property("newProperty", "someValue").toList();
    +        g2.traversal().E().property("newProperty", "someValue").toList();
    +
    +        assertEquals("original graph should be unchanged", new Long(2), 
g.traversal().V().count().next());
    --- End diff --
    
    perhaps it's a good idea to add an assertion for vertices/edges in the 
clone showing they are not the same object since it is a deep copy?


---

Reply via email to