use of org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 in project janusgraph by JanusGraph.
the class JanusGraphIoRegistryTest method testTokenIoRegistyInConfig.
@Test
public void testTokenIoRegistyInConfig() throws SerializationException {
final GraphSONMessageSerializerV3d0 serializer = new GraphSONMessageSerializerV3d0();
final Map<String, Object> config = new HashMap<>();
config.put(TOKEN_IO_REGISTRIES, Collections.singletonList(JanusGraphIoRegistry.class.getName()));
serializer.configure(config, Collections.emptyMap());
GraphTraversal traversal = EmptyGraph.instance().traversal().addV().property("loc", Geoshape.point(1.0f, 1.0f));
Bytecode expectedBytecode = traversal.asAdmin().getBytecode();
String serializedMessage = serializer.serializeRequestAsString(RequestMessage.build(Tokens.OPS_BYTECODE).processor("traversal").addArg(Tokens.ARGS_GREMLIN, expectedBytecode).create());
RequestMessage requestMessage1 = serializer.deserializeRequest(serializedMessage);
Bytecode result = (Bytecode) requestMessage1.getArgs().get(Tokens.ARGS_GREMLIN);
assertEquals(expectedBytecode, result);
}
Aggregations