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/b1579f38 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b1579f38 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b1579f38 Branch: refs/heads/TINKERPOP-1451 Commit: b1579f38038e85842bb8699e4397b390e24a57c8 Parents: 6a6b44d Author: Stephen Mallette <[email protected]> Authored: Thu Sep 15 13:57:21 2016 -0400 Committer: Stephen Mallette <[email protected]> Committed: Thu Sep 15 13:57:21 2016 -0400 ---------------------------------------------------------------------- .../tinkergraph/structure/TinkerGraphTest.java | 27 +++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b1579f38/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
