use of org.apache.tinkerpop.gremlin.structure.io.GraphReader in project titan by thinkaurelius.
the class TitanIoTest method testGeoShapeSerializationReadWriteAsGraphSONEmbedded.
@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);
}
Aggregations