Search in sources :

Example 1 with GraphBinaryMessageSerializerV1

use of org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 in project janusgraph by JanusGraph.

the class AbstractJanusGraphAssemblyIT method createGraphBinaryMessageSerializerV1.

protected MessageSerializer createGraphBinaryMessageSerializerV1() {
    final GraphBinaryMessageSerializerV1 serializer = new GraphBinaryMessageSerializerV1();
    final Map<String, Object> config = new HashMap<>();
    config.put(TOKEN_IO_REGISTRIES, Collections.singletonList(JanusGraphIoRegistry.class.getName()));
    serializer.configure(config, Collections.emptyMap());
    return serializer;
}
Also used : HashMap(java.util.HashMap) GraphBinaryMessageSerializerV1(org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1)

Example 2 with GraphBinaryMessageSerializerV1

use of org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 in project janusgraph by JanusGraph.

the class GeoshapeGraphBinarySerializerTest method shouldSerializeViaIoRegistry.

@ParameterizedTest
@MethodSource("geoshapeProvider")
public void shouldSerializeViaIoRegistry(Geoshape geoshape) throws IOException {
    final GraphBinaryMessageSerializerV1 serializer = new GraphBinaryMessageSerializerV1();
    final Map<String, Object> config = new HashMap<>();
    config.put(TOKEN_IO_REGISTRIES, Collections.singletonList(JanusGraphIoRegistry.class.getName()));
    serializer.configure(config, Collections.emptyMap());
    assertSymmetricGeoshapeSerializationInResponseMessage(serializer, geoshape);
}
Also used : HashMap(java.util.HashMap) GraphBinaryMessageSerializerV1(org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 3 with GraphBinaryMessageSerializerV1

use of org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 in project janusgraph by JanusGraph.

the class RelationIdentifierGraphBinarySerializerTest method shouldSerializeViaIoRegistry.

@ParameterizedTest
@MethodSource("relationIdentifierProvider")
public void shouldSerializeViaIoRegistry(final RelationIdentifier relationIdentifier) throws IOException {
    final GraphBinaryMessageSerializerV1 serializer = new GraphBinaryMessageSerializerV1();
    final Map<String, Object> config = new HashMap<>();
    config.put(TOKEN_IO_REGISTRIES, Collections.singletonList(JanusGraphIoRegistry.class.getName()));
    serializer.configure(config, Collections.emptyMap());
    assertRelationIdentifier(serializer, relationIdentifier);
}
Also used : HashMap(java.util.HashMap) GraphBinaryMessageSerializerV1(org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 4 with GraphBinaryMessageSerializerV1

use of org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 in project janusgraph by JanusGraph.

the class RelationIdentifierGraphBinarySerializerTest method shouldCustomSerialization.

@ParameterizedTest
@MethodSource("relationIdentifierProvider")
public void shouldCustomSerialization(final RelationIdentifier relationIdentifier) throws IOException {
    final GraphBinaryMessageSerializerV1 serializer = new GraphBinaryMessageSerializerV1(TypeSerializerRegistry.build().addCustomType(RelationIdentifier.class, new RelationIdentifierGraphBinarySerializer()).create());
    assertRelationIdentifier(serializer, relationIdentifier);
}
Also used : GraphBinaryMessageSerializerV1(org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 5 with GraphBinaryMessageSerializerV1

use of org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1 in project janusgraph by JanusGraph.

the class JanusGraphPGraphBinarySerializerTest method shouldSerializePersonViaIoRegistry.

@ParameterizedTest
@MethodSource("janusGraphPProvider")
public void shouldSerializePersonViaIoRegistry(final JanusGraphP predicate) throws IOException {
    final GraphBinaryMessageSerializerV1 serializer = new GraphBinaryMessageSerializerV1();
    final Map<String, Object> config = new HashMap<>();
    config.put(TOKEN_IO_REGISTRIES, Collections.singletonList(JanusGraphIoRegistry.class.getName()));
    serializer.configure(config, Collections.emptyMap());
    assertJanusGraphP(serializer, predicate);
}
Also used : HashMap(java.util.HashMap) GraphBinaryMessageSerializerV1(org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

GraphBinaryMessageSerializerV1 (org.apache.tinkerpop.gremlin.driver.ser.GraphBinaryMessageSerializerV1)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)5 MethodSource (org.junit.jupiter.params.provider.MethodSource)5 HashMap (java.util.HashMap)4 JanusGraphP (org.janusgraph.graphdb.tinkerpop.io.JanusGraphP)1