Package com.esotericsoftware.kryo.io

Examples of com.esotericsoftware.kryo.io.Input.readString()


    assertEquals("1", read.readString());
    assertEquals("22", read.readString());
    assertEquals("uno", read.readString());
    assertEquals("dos", read.readString());
    assertEquals("tres", read.readString());
    assertEquals(null, read.readString());
    assertEquals(value1, read.readString());
    assertEquals(value2, read.readString());
    for (int i = 0; i < 127; i++)
      assertEquals(String.valueOf((char)i), read.readString());
    for (int i = 0; i < 127; i++)
View Full Code Here


    assertEquals("22", read.readString());
    assertEquals("uno", read.readString());
    assertEquals("dos", read.readString());
    assertEquals("tres", read.readString());
    assertEquals(null, read.readString());
    assertEquals(value1, read.readString());
    assertEquals(value2, read.readString());
    for (int i = 0; i < 127; i++)
      assertEquals(String.valueOf((char)i), read.readString());
    for (int i = 0; i < 127; i++)
      assertEquals(String.valueOf((char)i) + "abc", read.readString());
View Full Code Here

    assertEquals("uno", read.readString());
    assertEquals("dos", read.readString());
    assertEquals("tres", read.readString());
    assertEquals(null, read.readString());
    assertEquals(value1, read.readString());
    assertEquals(value2, read.readString());
    for (int i = 0; i < 127; i++)
      assertEquals(String.valueOf((char)i), read.readString());
    for (int i = 0; i < 127; i++)
      assertEquals(String.valueOf((char)i) + "abc", read.readString());
View Full Code Here

    assertEquals("tres", read.readString());
    assertEquals(null, read.readString());
    assertEquals(value1, read.readString());
    assertEquals(value2, read.readString());
    for (int i = 0; i < 127; i++)
      assertEquals(String.valueOf((char)i), read.readString());
    for (int i = 0; i < 127; i++)
      assertEquals(String.valueOf((char)i) + "abc", read.readString());

    read.rewind();
    assertEquals("", read.readStringBuilder().toString());
View Full Code Here

    assertEquals(value1, read.readString());
    assertEquals(value2, read.readString());
    for (int i = 0; i < 127; i++)
      assertEquals(String.valueOf((char)i), read.readString());
    for (int i = 0; i < 127; i++)
      assertEquals(String.valueOf((char)i) + "abc", read.readString());

    read.rewind();
    assertEquals("", read.readStringBuilder().toString());
    assertEquals("1", read.readStringBuilder().toString());
    assertEquals("22", read.readStringBuilder().toString());
View Full Code Here

  @Test
  public void test_read(){
    Kryo kryo = Mockito.mock(Kryo.class);
    Input input = Mockito.mock(Input.class);
 
    Mockito.when(input.readString()).thenReturn("111");
    Mockito.when(input.readInt()).thenReturn(-1);
    MeasurePointIdSerializer measurePointIdSerializer = new MeasurePointIdSerializer();
    assertEquals("111", measurePointIdSerializer.read(kryo, input, String.class));
   
    Mockito.when(input.readString()).thenReturn("?");
View Full Code Here

    Mockito.when(input.readString()).thenReturn("111");
    Mockito.when(input.readInt()).thenReturn(-1);
    MeasurePointIdSerializer measurePointIdSerializer = new MeasurePointIdSerializer();
    assertEquals("111", measurePointIdSerializer.read(kryo, input, String.class));
   
    Mockito.when(input.readString()).thenReturn("?");
    Mockito.when(input.readInt()).thenReturn(0);
    assertEquals("111", measurePointIdSerializer.read(kryo, input, String.class));
   
    Mockito.when(input.readString()).thenReturn("?");
    Mockito.when(input.readInt()).thenReturn(0);
View Full Code Here

   
    Mockito.when(input.readString()).thenReturn("?");
    Mockito.when(input.readInt()).thenReturn(0);
    assertEquals("111", measurePointIdSerializer.read(kryo, input, String.class));
   
    Mockito.when(input.readString()).thenReturn("?");
    Mockito.when(input.readInt()).thenReturn(0);
    assertEquals("111", measurePointIdSerializer.read(kryo, input, String.class));
   
    Mockito.when(input.readString()).thenReturn("222");
    Mockito.when(input.readInt()).thenReturn(-1);
View Full Code Here

   
    Mockito.when(input.readString()).thenReturn("?");
    Mockito.when(input.readInt()).thenReturn(0);
    assertEquals("111", measurePointIdSerializer.read(kryo, input, String.class));
   
    Mockito.when(input.readString()).thenReturn("222");
    Mockito.when(input.readInt()).thenReturn(-1);
    assertEquals("222", measurePointIdSerializer.read(kryo, input, String.class));
   
    Mockito.when(input.readString()).thenReturn("?");
    Mockito.when(input.readInt()).thenReturn(1);
View Full Code Here

   
    Mockito.when(input.readString()).thenReturn("222");
    Mockito.when(input.readInt()).thenReturn(-1);
    assertEquals("222", measurePointIdSerializer.read(kryo, input, String.class));
   
    Mockito.when(input.readString()).thenReturn("?");
    Mockito.when(input.readInt()).thenReturn(1);
    assertEquals("222", measurePointIdSerializer.read(kryo, input, String.class));
  }

}
View Full Code Here

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.