Search in sources :

Example 41 with SerializerDefinition

use of voldemort.serialization.SerializerDefinition 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");
}
Also used : DefaultSerializerFactory(voldemort.serialization.DefaultSerializerFactory) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Example 42 with SerializerDefinition

use of voldemort.serialization.SerializerDefinition 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");
}
Also used : DefaultSerializerFactory(voldemort.serialization.DefaultSerializerFactory) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Example 43 with SerializerDefinition

use of voldemort.serialization.SerializerDefinition in project voldemort by voldemort.

the class ThriftSerializerTest method testGetSerializer7.

public void testGetSerializer7() {
    try {
        SerializerDefinition def = new SerializerDefinition("thrift", "php=FooBar,protocol=bongus");
        new DefaultSerializerFactory().getSerializer(def);
    } catch (IllegalArgumentException e) {
        return;
    }
    fail("IllegalArgumentException should have been thrown for non-Java Thrift client");
}
Also used : DefaultSerializerFactory(voldemort.serialization.DefaultSerializerFactory) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Example 44 with SerializerDefinition

use of voldemort.serialization.SerializerDefinition in project voldemort by voldemort.

the class ThriftSerializerTest method testGetSerializer4.

public void testGetSerializer4() {
    try {
        SerializerDefinition def = new SerializerDefinition("thrift", "");
        new DefaultSerializerFactory().getSerializer(def);
    } catch (IllegalArgumentException e) {
        return;
    }
    fail("IllegalArgumentException should have been thrown for missing Thrift class and protocol");
}
Also used : DefaultSerializerFactory(voldemort.serialization.DefaultSerializerFactory) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Example 45 with SerializerDefinition

use of voldemort.serialization.SerializerDefinition in project voldemort by voldemort.

the class ThriftSerializerTest method testGetSerializer1.

public void testGetSerializer1() {
    SerializerDefinition def = new SerializerDefinition("thrift", "java=" + MockMessage.class.getName() + ",protocol=BiNary");
    Serializer<?> serializer = new DefaultSerializerFactory().getSerializer(def);
    assertEquals(ThriftSerializer.class, serializer.getClass());
}
Also used : DefaultSerializerFactory(voldemort.serialization.DefaultSerializerFactory) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Aggregations

SerializerDefinition (voldemort.serialization.SerializerDefinition)65 StoreDefinitionBuilder (voldemort.store.StoreDefinitionBuilder)46 StoreDefinition (voldemort.store.StoreDefinition)38 HashMap (java.util.HashMap)31 ArrayList (java.util.ArrayList)22 ByteArray (voldemort.utils.ByteArray)19 Test (org.junit.Test)18 DefaultSerializerFactory (voldemort.serialization.DefaultSerializerFactory)15 File (java.io.File)14 Cluster (voldemort.cluster.Cluster)12 Node (voldemort.cluster.Node)11 LinkedList (java.util.LinkedList)10 IOException (java.io.IOException)9 Serializer (voldemort.serialization.Serializer)9 List (java.util.List)8 VoldemortException (voldemort.VoldemortException)8 StoreDefinitionsMapper (voldemort.xml.StoreDefinitionsMapper)8 StatTrackingStore (voldemort.store.stats.StatTrackingStore)7 Before (org.junit.Before)6 Store (voldemort.store.Store)6