diff options
Diffstat (limited to 'src/test/java/com/thinkaurelius/titan/graphdb/thrift/ThriftGraphSpeedTest.java')
-rw-r--r-- | src/test/java/com/thinkaurelius/titan/graphdb/thrift/ThriftGraphSpeedTest.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/test/java/com/thinkaurelius/titan/graphdb/thrift/ThriftGraphSpeedTest.java b/src/test/java/com/thinkaurelius/titan/graphdb/thrift/ThriftGraphSpeedTest.java new file mode 100644 index 0000000..6f01f0b --- /dev/null +++ b/src/test/java/com/thinkaurelius/titan/graphdb/thrift/ThriftGraphSpeedTest.java @@ -0,0 +1,56 @@ +package com.thinkaurelius.titan.graphdb.thrift; + +import com.thinkaurelius.titan.diskstorage.BackendException; +import com.thinkaurelius.titan.graphdb.SpeedTestSchema; +import org.junit.BeforeClass; +import org.junit.experimental.categories.Category; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.thinkaurelius.titan.CassandraStorageSetup; +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.graphdb.TitanGraphSpeedTest; +import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration; +import com.thinkaurelius.titan.graphdb.database.StandardTitanGraph; +import com.thinkaurelius.titan.testcategory.PerformanceTests; + +@Category({PerformanceTests.class}) +public class ThriftGraphSpeedTest extends TitanGraphSpeedTest { + + private static StandardTitanGraph graph; + private static SpeedTestSchema schema; + + private static final Logger log = + LoggerFactory.getLogger(ThriftGraphSpeedTest.class); + + public ThriftGraphSpeedTest() throws BackendException { + super(CassandraStorageSetup.getCassandraThriftGraphConfiguration(ThriftGraphSpeedTest.class.getSimpleName())); + } + + @BeforeClass + public static void beforeClass() { + CassandraStorageSetup.startCleanEmbedded(); + } + + @Override + protected StandardTitanGraph getGraph() throws BackendException { + + + if (null == graph) { + GraphDatabaseConfiguration graphconfig = new GraphDatabaseConfiguration(conf); + graphconfig.getBackend().clearStorage(); + log.debug("Cleared backend storage"); + graph = (StandardTitanGraph)TitanFactory.open(conf); + initializeGraph(graph); + } + return graph; + } + + @Override + protected SpeedTestSchema getSchema() { + if (null == schema) { + schema = SpeedTestSchema.get(); + } + return schema; + } +}
\ No newline at end of file |