use of voldemort.serialization.DefaultSerializerFactory in project voldemort by voldemort.
the class ProtoBufSerializerTest method testGetSerializer.
public void testGetSerializer() {
SerializerDefinition def = new SerializerDefinition("protobuf", "java=" + MessageStub.class.getName());
Serializer<?> serializer = new DefaultSerializerFactory().getSerializer(def);
assertEquals(ProtoBufSerializer.class, serializer.getClass());
}
use of voldemort.serialization.DefaultSerializerFactory in project voldemort by voldemort.
the class ThriftSerializerTest method testGetSerializer6.
public void testGetSerializer6() {
try {
SerializerDefinition def = new SerializerDefinition("thrift", "java=" + MockMessage.class.getName() + ",protocol=bongus");
new DefaultSerializerFactory().getSerializer(def);
} catch (IllegalArgumentException e) {
return;
}
fail("IllegalArgumentException should have been thrown for bogus Thrift protocol");
}
use of voldemort.serialization.DefaultSerializerFactory in project voldemort by voldemort.
the class ThriftSerializerTest method testGetSerializer3.
public void testGetSerializer3() {
try {
SerializerDefinition def = new SerializerDefinition("thrift", "protocol=json");
new DefaultSerializerFactory().getSerializer(def);
} catch (IllegalArgumentException e) {
return;
}
fail("IllegalArgumentException should have been thrown for missing Thrift class");
}
use of voldemort.serialization.DefaultSerializerFactory in project voldemort by voldemort.
the class ThriftSerializerTest method testGetSerializer.
public void testGetSerializer() {
SerializerDefinition def = new SerializerDefinition("thrift", "java=" + MockMessage.class.getName() + ", protocol=binary ");
Serializer<?> serializer = new DefaultSerializerFactory().getSerializer(def);
assertEquals(ThriftSerializer.class, serializer.getClass());
}
use of voldemort.serialization.DefaultSerializerFactory in project voldemort by voldemort.
the class ThriftSerializerTest method testGetSerializer5.
public void testGetSerializer5() {
try {
SerializerDefinition def = new SerializerDefinition("thrift", "java=com.abc.FooBar,protocol=simple-json");
new DefaultSerializerFactory().getSerializer(def);
} catch (IllegalArgumentException e) {
return;
}
fail("IllegalArgumentException should have been thrown for non-existing Thrift class");
}
Aggregations