Package me.prettyprint.hector.api

Examples of me.prettyprint.hector.api.Serializer


    @Test
    public void ReadingObjectShouldReturnReadingSerializer() {
        ExtensibleTypeInferringSerializer.addSerializer(Reading.class, ReadingSerializer.get());
        Reading reading = new Reading(UUID.randomUUID(), new DateTime(), new BigDecimal(195).movePointLeft(1),
                24, "ESE", BigInteger.valueOf(17L), false);
        Serializer serializer = ExtensibleTypeInferringSerializer.getSerializer(reading);
        assertEquals(serializer.getClass(), ReadingSerializer.class);
    }
View Full Code Here


    }

    @Test
    public void ReadingClassShouldReturnReadingSerializer() {
        ExtensibleTypeInferringSerializer.addSerializer(Reading.class, ReadingSerializer.get());
        Serializer serializer = ExtensibleTypeInferringSerializer.getSerializer(Reading.class);
        assertEquals(serializer.getClass(), ReadingSerializer.class);
    }
View Full Code Here

        DateTime date = new DateTime();

        Reading reading = new Reading(uuid, date, new BigDecimal(195).movePointLeft(1),
                24, "ESE", BigInteger.valueOf(17L), false);

        Serializer serializer = ExtensibleTypeInferringSerializer.getSerializer(Reading.class);

        ByteBuffer buffer = serializer.toByteBuffer(reading);

        Reading deserializedReading = new Reading(uuid, date, (Reading) serializer.fromByteBuffer(buffer));

        assertEquals(reading, deserializedReading);
    }
View Full Code Here

public class TestExtensibleTypeInferrringSerializer {

    @Test
    public void uuidObjectShouldReturnUUIDSerializer() {
        UUID value = new UUID(0, 1);
        Serializer serializer = ExtensibleTypeInferringSerializer.getSerializer(value);
        assertEquals(serializer.getClass(), UUIDSerializer.class);
    }
View Full Code Here

        assertEquals(serializer.getClass(), UUIDSerializer.class);
    }

    @Test
    public void uuidClassShouldReturnUUIDSerializer() {
        Serializer serializer = ExtensibleTypeInferringSerializer.getSerializer(UUID.class);
        assertEquals(serializer.getClass(), UUIDSerializer.class);
    }
View Full Code Here

    }

    @Test
    public void stringObjectShouldReturnStringSerializer() {
        String value = "test";
        Serializer serializer = ExtensibleTypeInferringSerializer.getSerializer(value);
        assertEquals(serializer.getClass(), StringSerializer.class);
    }
View Full Code Here

        assertEquals(serializer.getClass(), StringSerializer.class);
    }

    @Test
    public void stringClassShouldReturnStringSerializer() {
        Serializer serializer = ExtensibleTypeInferringSerializer.getSerializer(String.class);
        assertEquals(serializer.getClass(), StringSerializer.class);
    }
View Full Code Here

    }

    @Test
    public void longValueShouldReturnLongSerializer() {
        long value = 1L;
        Serializer serializer = ExtensibleTypeInferringSerializer.getSerializer(value);
        assertEquals(serializer.getClass(), LongSerializer.class);
    }
View Full Code Here

    }

    @Test
    public void longObjectShouldReturnLongSerializer() {
        Long value = 1L;
        Serializer serializer = ExtensibleTypeInferringSerializer.getSerializer(value);
        assertEquals(serializer.getClass(), LongSerializer.class);
    }
View Full Code Here

        assertEquals(serializer.getClass(), LongSerializer.class);
    }

    @Test
    public void longClassShouldReturnLongSerializer() {
        Serializer serializer = ExtensibleTypeInferringSerializer.getSerializer(Long.class);
        assertEquals(serializer.getClass(), LongSerializer.class);
    }
View Full Code Here

TOP

Related Classes of me.prettyprint.hector.api.Serializer

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.