diff --git a/janusgraph-hadoop-parent/janusgraph-hadoop-core/src/test/java/org/janusgraph/hadoop/CassandraInputFormatIT.java b/janusgraph-hadoop-parent/janusgraph-hadoop-core/src/test/java/org/janusgraph/hadoop/CassandraInputFormatIT.java index c8d0627563..95a6c7d0e8 100644 --- a/janusgraph-hadoop-parent/janusgraph-hadoop-core/src/test/java/org/janusgraph/hadoop/CassandraInputFormatIT.java +++ b/janusgraph-hadoop-parent/janusgraph-hadoop-core/src/test/java/org/janusgraph/hadoop/CassandraInputFormatIT.java @@ -14,16 +14,28 @@ package org.janusgraph.hadoop; +import org.apache.commons.configuration.ConfigurationException; +import org.apache.commons.configuration.PropertiesConfiguration; import org.janusgraph.CassandraStorageSetup; import org.janusgraph.diskstorage.configuration.ModifiableConfiguration; import org.janusgraph.diskstorage.configuration.WriteConfiguration; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.util.GraphFactory; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + public class CassandraInputFormatIT extends AbstractInputFormatIT { - protected Graph getGraph() { - return GraphFactory.open("target/test-classes/cassandra-read.properties"); + protected Graph getGraph() throws ConfigurationException, IOException { + final PropertiesConfiguration config = new PropertiesConfiguration("target/test-classes/cassandra-read.properties"); + Path baseOutDir = Paths.get((String) config.getProperty("gremlin.hadoop.outputLocation")); + baseOutDir.toFile().mkdirs(); + String outDir = Files.createTempDirectory(baseOutDir, null).toAbsolutePath().toString(); + config.setProperty("gremlin.hadoop.outputLocation", outDir); + return GraphFactory.open(config); } @Override diff --git a/janusgraph-hadoop-parent/janusgraph-hadoop-core/src/test/resources/cassandra-read.properties b/janusgraph-hadoop-parent/janusgraph-hadoop-core/src/test/resources/cassandra-read.properties index e27cc5272b..507ca41342 100644 --- a/janusgraph-hadoop-parent/janusgraph-hadoop-core/src/test/resources/cassandra-read.properties +++ b/janusgraph-hadoop-parent/janusgraph-hadoop-core/src/test/resources/cassandra-read.properties @@ -5,7 +5,7 @@ gremlin.hadoop.graphOutputFormat=org.apache.hadoop.mapreduce.lib.output.NullOutp gremlin.hadoop.jarsInDistributedCache=true gremlin.hadoop.inputLocation=none -gremlin.hadoop.outputLocation=output +gremlin.hadoop.outputLocation=target/output janusgraphmr.ioformat.conf.storage.backend=cassandrathrift janusgraphmr.ioformat.conf.storage.cassandra.keyspace=CassandraInputFormatIT janusgraphmr.ioformat.conf.storage.hostname=localhost