Examples of readAndSkipBlank()


Examples of com.firefly.utils.json.JsonReader.readAndSkipBlank()

public class TestReader {
  @Test
  public void testReadAndSkipBlank() throws IOException {
    JsonReader reader = new JsonStringReader("  tt".trim());
    Assert.assertThat(reader.readAndSkipBlank(), is('t'));
//    Assert.assertThat(reader.position(), is(1));
    reader.close();
  }
 
  @Test
View Full Code Here

Examples of com.firefly.utils.json.JsonReader.readAndSkipBlank()

    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.readDouble(), is(3332.44));
    char ch = reader.readAndSkipBlank();
    Assert.assertThat(ch, is('}'));
    reader.close();
  }
 
  @Test
View Full Code Here

Examples of com.firefly.utils.json.JsonReader.readAndSkipBlank()

    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();
  }
 
  @Test
View Full Code Here

Examples of com.firefly.utils.json.JsonReader.readAndSkipBlank()

    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();
  }
 
  @Test
View Full Code Here

Examples of com.firefly.utils.json.JsonReader.readAndSkipBlank()

    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.readLong(), is(-3334L));
    char ch = reader.readAndSkipBlank();
    Assert.assertThat(ch, is('}'));
    reader.close();
  }
 
  @Test
View Full Code Here

Examples of com.firefly.utils.json.JsonReader.readAndSkipBlank()

    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.readString(), is("ddsfseee"));
    char ch = reader.readAndSkipBlank();
    Assert.assertThat(ch, is(','));
   
    ret = reader.readField(t1);
    Assert.assertThat(new String(ret), is("testField2"));
    Assert.assertThat(reader.isColon(), is(true));
View Full Code Here

Examples of com.firefly.utils.json.JsonReader.readAndSkipBlank()

   
    ret = reader.readField(t1);
    Assert.assertThat(new String(ret), is("testField2"));
    Assert.assertThat(reader.isColon(), is(true));
    Assert.assertThat(reader.readString(), is("dddfd"));
    ch = reader.readAndSkipBlank();
    Assert.assertThat(ch, is('}'));
    reader.close();
  }
 
  @Test
View Full Code Here

Examples of com.firefly.utils.json.JsonReader.readAndSkipBlank()

    Assert.assertThat(new String(ret), is("testField"));
    Assert.assertThat(reader.isColon(), is(true));
    String s = reader.readString();
    System.out.println(s);
    Assert.assertThat(s, is("dds\"fseee"));
    char ch = reader.readAndSkipBlank();
    Assert.assertThat(ch, is(','));
   
    ret = reader.readField(t1);
    Assert.assertThat(new String(ret), is("testField2"));
    Assert.assertThat(reader.isColon(), is(true));
View Full Code Here

Examples of com.firefly.utils.json.JsonReader.readAndSkipBlank()

    Assert.assertThat(new String(ret), is("testField2"));
    Assert.assertThat(reader.isColon(), is(true));
    s = reader.readString();
    System.out.println(s);
    Assert.assertThat(s, is("d\nddfd"));
    ch = reader.readAndSkipBlank();
    Assert.assertThat(ch, is('}'));
    reader.close();
  }
 
  @Test
View Full Code Here

Examples of com.firefly.utils.json.JsonReader.readAndSkipBlank()

    char[] ret = reader.readField(t1);
    Assert.assertThat(new String(ret), is("testField"));
    Assert.assertThat(reader.isColon(), is(true));
    String s = reader.readString();
    Assert.assertThat(s, nullValue());
    char ch = reader.readAndSkipBlank();
    Assert.assertThat(ch, is(','));
    reader.close();
  }
 
  @Test
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.