use of org.janusgraph.graphdb.serializer.attributes.TEnum in project janusgraph by JanusGraph.
the class SerializerTestCommon method objectWriteRead.
protected void objectWriteRead() {
TClass1 t1 = new TClass1(3245234223423433123L, 0.333f);
TClass2 t2 = new TClass2("This is a test", 4234234);
TEnum t3 = TEnum.THREE;
TEnum t4 = TEnum.TWO;
DataOutput out = serialize.getDataOutput(128);
out.writeObjectNotNull(t1);
out.writeClassAndObject(t2);
out.writeObject(t3, TEnum.class);
out.writeClassAndObject(t4);
ReadBuffer b = out.getStaticBuffer().asReadBuffer();
assertEquals(t1, serialize.readObjectNotNull(b, TClass1.class));
assertEquals(t2, serialize.readClassAndObject(b));
assertEquals(t3, serialize.readObject(b, TEnum.class));
assertEquals(t4, serialize.readClassAndObject(b));
assertFalse(b.hasRemaining());
}
Aggregations