Package com.firefly.utils.json.io

Examples of com.firefly.utils.json.io.JsonStringReader.readInt()


    Assert.assertThat(reader.isComma(), is(true));
   
    ret = reader.readField(t1);
    Assert.assertThat(new String(ret), is("testField2"));
    Assert.assertThat(reader.isColon(), is(true));
    Assert.assertThat(reader.readInt(), is(-334));
    reader.close();
  }
 
  @Test
  public void testReadFloat() throws IOException {
View Full Code Here


    Assert.assertThat(reader.isComma(), is(true));
   
    ret = reader.readField(t1);
    Assert.assertThat(new String(ret), is("testField2"));
    Assert.assertThat(reader.isColon(), is(true));
    Assert.assertThat(reader.readInt(), is(-334));
    reader.close();
  }
 
  @Test
  public void testReadInt() throws IOException {
View Full Code Here

    Assert.assertThat(reader.isObject(), is(true));
    char[] t1 = "dsffsfsf".toCharArray();
    char[] ret = reader.readField(t1);
    Assert.assertThat(new String(ret), is("testField"));
    Assert.assertThat(reader.isColon(), is(true));
    Assert.assertThat(reader.readInt(), is(333));
    char ch = reader.readAndSkipBlank();
    Assert.assertThat(ch, is('}'));
    reader.close();
  }
 
View Full Code Here

    Assert.assertThat(reader.isObject(), is(true));
    char[] t1 = "dsffsfsf".toCharArray();
    char[] ret = reader.readField(t1);
    Assert.assertThat(new String(ret), is("testField"));
    Assert.assertThat(reader.isColon(), is(true));
    Assert.assertThat(reader.readInt(), is(-333));
    Assert.assertThat(reader.isComma(), is(true));
   
    ret = reader.readField(t1);
    Assert.assertThat(new String(ret), is("testField2"));
    Assert.assertThat(reader.isColon(), is(true));
View Full Code Here

    Assert.assertThat(reader.isComma(), is(true));
   
    ret = reader.readField(t1);
    Assert.assertThat(new String(ret), is("testField2"));
    Assert.assertThat(reader.isColon(), is(true));
    Assert.assertThat(reader.readInt(), is(-334));
    reader.close();
  }
 
  @Test
  public void testReadInt3() throws IOException {
View Full Code Here

  }
 
  @Test
  public void testReadInt3() throws IOException {
    JsonReader reader = new JsonStringReader("  \" -333\" ");
    Assert.assertThat(reader.readInt(), is(-333));
    reader.close();
  }
 
  @Test
  public void testReadInt4() throws IOException {
View Full Code Here

  }
 
  @Test
  public void testReadInt4() throws IOException {
    JsonReader reader = new JsonStringReader("   -333 ");
    Assert.assertThat(reader.readInt(), is(-333));
    reader.close();
  }
 
  @Test
  public void testReadInt5() throws IOException {
View Full Code Here

    Assert.assertThat(reader.isObject(), is(true));
    char[] t1 = "dsffsfsf".toCharArray();
    char[] ret = reader.readField(t1);
    Assert.assertThat(new String(ret), is("testField"));
    Assert.assertThat(reader.isColon(), is(true));
    Assert.assertThat(reader.readInt(), is(0));
    char ch = reader.readAndSkipBlank();
    Assert.assertThat(ch, is('}'));
    reader.close();
  }
 
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.