Package me.prettyprint.cassandra.serializers

Source Code of me.prettyprint.cassandra.serializers.LongSerializerTest

package me.prettyprint.cassandra.serializers;

import static org.junit.Assert.assertEquals;

import me.prettyprint.cassandra.serializers.LongSerializer;

import org.junit.Test;

public class LongSerializerTest {

  @Test
  public void testConversions() {
    test(0l);
    test(1l);
    test(-1l);
    test(Long.MAX_VALUE);
    test(Long.MIN_VALUE);
    test(null);
  }

  private void test(Long number) {
    LongSerializer ext = new LongSerializer();
    assertEquals(number, ext.fromByteBuffer(ext.toByteBuffer(number)));
  }
}
TOP

Related Classes of me.prettyprint.cassandra.serializers.LongSerializerTest

TOP
Copyright © 2018 www.massapi.com. 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.