You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/09/15 18:32:36 UTC

[5/6] tinkerpop git commit: Modified TinkerGraph IO test to use just the filename for the path

Modified TinkerGraph IO test to use just the filename for the path

Change my mind from the previous commit. Probably better to have the test for exactly what was failing.
Changed my mind about


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

Branch: refs/heads/TINKERPOP-1451
Commit: 768bd997368755180f094fbe66d6bcfd29bd81d2
Parents: 85b4943
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Sep 15 13:57:21 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Sep 15 14:32:09 2016 -0400

----------------------------------------------------------------------
 .../tinkergraph/structure/TinkerGraphTest.java  | 27 +++++++++++---------
 1 file changed, 15 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/768bd997/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 c527647..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
@@ -441,21 +441,24 @@ public class TinkerGraphTest {
 
     @Test
     public void shouldPersistWithRelativePath() {
-        final String graphLocation = TestHelper.convertToRelative(TinkerGraphTest.class,
-                new File(TestHelper.makeTestDataDirectory(TinkerGraphTest.class)))  + "shouldPersistToGryo.kryo";
+        final String graphLocation = "shouldPersistToGryoRelative.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.generateModern(graph);
-        graph.close();
-
-        final TinkerGraph reloadedGraph = TinkerGraph.open(conf);
-        IoTest.assertModernGraph(reloadedGraph, true, false);
-        reloadedGraph.close();
+        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