Package krati.io.serializer

Examples of krati.io.serializer.IntSerializer


*/
public class TestIntSerializer2 extends TestIntSerializer {
   
    @Override
    protected IntSerializer createSerializer() {
        return new IntSerializer(ByteOrder.LITTLE_ENDIAN);
    }
View Full Code Here


*/
public class TestIntSerializer extends AbstractTestNumberSerializer<Integer> {
   
    @Override
    protected IntSerializer createSerializer() {
        return new IntSerializer();
    }
View Full Code Here

    protected Integer maxValue() {
        return Integer.MAX_VALUE;
    }
   
    public void testCustomApi() {
        IntSerializer serializer = createSerializer();
       
        int val = 0;
        assertEquals(val, serializer.intValue(serializer.intBytes(val)));
        val = minValue();
        assertEquals(val, serializer.intValue(serializer.intBytes(val)));
        val = maxValue();
        assertEquals(val, serializer.intValue(serializer.intBytes(val)));
        val = anyValue();
        assertEquals(val, serializer.intValue(serializer.intBytes(val)));
    }
View Full Code Here

    protected void setUp() {
        keyLen = rand.nextInt(10);
        keyLen++;
       
        valueStart = rand.nextInt();
        serializer = new IntSerializer();
    }
View Full Code Here

   
    @Override
    protected void setUp() {
        keyStart = rand.nextInt();
        valueStart = rand.nextInt();
        serializer = new IntSerializer();
    }
View Full Code Here

   
    @Override
    protected void setUp() {
        keyStart = rand.nextInt();
        valueStart = rand.nextLong();
        keySerializer = new IntSerializer();
        valueSerializer = new LongSerializer();
    }
View Full Code Here

        }
    }
   
    public void testStaticObjectArrayFactory1() throws IOException {
        ObjectStoreFactory<Integer, String> storeFactory = new StaticObjectArrayFactory<String>();
        ObjectStore<Integer, String> store = storeFactory.create(_config, new IntSerializer(), new StringSerializerUtf8());
        assertEquals(SerializableObjectArray.class, store.getClass());
        assertEquals(StaticDataArray.class, ((SerializableObjectArray<String>)store).getStore().getClass());
        store.close();
    }
View Full Code Here

   
    public void testStaticObjectArrayFactory2() throws IOException {
        setUpStorePartitionConfig();
       
        ObjectStoreFactory<Integer, String> storeFactory = new StaticObjectArrayFactory<String>();
        ObjectStore<Integer, String> store = storeFactory.create(_config, new IntSerializer(), new StringSerializerUtf8());
        assertEquals(SerializableObjectArray.class, store.getClass());
        assertEquals(StaticArrayStorePartition.class, ((SerializableObjectArray<String>)store).getStore().getClass());
        store.close();
    }
View Full Code Here

        store.close();
    }
   
    public void testDynamicObjectArrayFactory() throws IOException {
        ObjectStoreFactory<Integer, String> storeFactory = new DynamicObjectArrayFactory<String>();
        ObjectStore<Integer, String> store = storeFactory.create(_config, new IntSerializer(), new StringSerializerUtf8());
        assertEquals(SerializableObjectArray.class, store.getClass());
        assertEquals(DynamicDataArray.class, ((SerializableObjectArray<String>)store).getStore().getClass());
        store.close();
    }
View Full Code Here

        store.close();
    }
   
    public void testStaticObjectStoreFactory() throws IOException {
        ObjectStoreFactory<Integer, String> storeFactory = new StaticObjectStoreFactory<Integer, String>();
        ObjectStore<Integer, String> store = storeFactory.create(_config, new IntSerializer(), new StringSerializerUtf8());
        assertEquals(SerializableObjectStore.class, store.getClass());
        assertEquals(StaticDataStore.class, ((SerializableObjectStore<Integer, String>)store).getStore().getClass());
        store.close();
    }
View Full Code Here

TOP

Related Classes of krati.io.serializer.IntSerializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.