/** * Tests the {@link com.thinkaurelius.titan.example.GraphOfTheGodsFactory#load(com.thinkaurelius.titan.core.TitanGraph)} * method used as the standard example that ships with Titan. */ @Test public void testGraphOfTheGods() { GraphOfTheGodsFactory.load(graph); assertGraphOfTheGods(graph); }
/** * Test {@link com.thinkaurelius.titan.example.GraphOfTheGodsFactory#create(String)}. */ @Test public void testGraphOfTheGodsFactoryCreate() { File bdbtmp = new File("target/gotgfactory"); IOUtils.deleteDirectory(bdbtmp, true); TitanGraph gotg = GraphOfTheGodsFactory.create(bdbtmp.getPath()); TitanIndexTest.assertGraphOfTheGods(gotg); gotg.close(); } }
@Test public void testGeoShapeSerializationReadWriteAsGryo() throws Exception { GraphOfTheGodsFactory.loadWithoutMixedIndex(graph, true); graph.io(IoCore.gryo()).writeGraph("/tmp/test.kryo"); clearGraph(config); open(config); graph.io(IoCore.gryo()).readGraph("/tmp/test.kryo"); TitanIndexTest.assertGraphOfTheGods(graph); } }
@Test public void testGeoShapeSerializationReadWriteAsGraphSONEmbedded() throws Exception { GraphOfTheGodsFactory.loadWithoutMixedIndex(graph, true); GraphSONMapper m = graph.io(IoCore.graphson()).mapper().embedTypes(true).create(); GraphWriter writer = graph.io(IoCore.graphson()).writer().mapper(m).create(); FileOutputStream fos = new FileOutputStream("/tmp/test.json"); writer.writeGraph(fos, graph); clearGraph(config); open(config); GraphReader reader = graph.io(IoCore.graphson()).reader().mapper(m).create(); FileInputStream fis = new FileInputStream("/tmp/test.json"); reader.readGraph(fis, graph); TitanIndexTest.assertGraphOfTheGods(graph); }
/** * Tests the {@link com.thinkaurelius.titan.example.GraphOfTheGodsFactory#load(com.thinkaurelius.titan.core.TitanGraph)} * method used as the standard example that ships with Titan. */ @Test public void testGraphOfTheGods() { GraphOfTheGodsFactory.load(graph); assertGraphOfTheGods(graph); }