1112131415161718192021
public void test_0() throws Exception { StringWriter out = new StringWriter(); JSONWriter writer = new JSONWriter(out); writer.writeStartObject(); writer.writeEndObject(); writer.flush(); Assert.assertEquals("{}", out.toString()); }
2223242526272829303132
public void test_1() throws Exception { StringWriter out = new StringWriter(); JSONWriter writer = new JSONWriter(out); writer.writeStartObject(); writer.writeKey("id"); writer.writeValue(33); writer.writeEndObject(); writer.flush();
3536373839404142434445
public void test_2() throws Exception { StringWriter out = new StringWriter(); JSONWriter writer = new JSONWriter(out); writer.writeStartObject(); writer.writeKey("id"); writer.writeValue(33); writer.writeKey("name");
5354555657585960616263
public void test_3() throws Exception { StringWriter out = new StringWriter(); JSONWriter writer = new JSONWriter(out); writer.writeStartObject(); writer.writeKey("id"); writer.writeValue(33); writer.writeKey("name");
6465666768697071727374
writer.writeValue("jobs"); writer.writeKey("children"); writer.writeStartArray(); writer.writeStartObject(); writer.writeEndObject(); writer.writeStartObject(); writer.writeEndObject();
6768697071727374757677
writer.writeStartArray(); writer.writeStartObject(); writer.writeEndObject(); writer.writeStartObject(); writer.writeEndObject(); writer.writeEndArray(); writer.writeEndObject();
8586878889909192939495
JSONWriter writer = new JSONWriter(out); writer.writeStartArray(); writer.writeStartObject(); writer.writeEndObject(); writer.writeStartObject(); writer.writeEndObject();
8889909192939495969798
writer.writeStartArray(); writer.writeStartObject(); writer.writeEndObject(); writer.writeStartObject(); writer.writeEndObject(); writer.writeStartArray(); writer.writeEndArray(); {
1213141516171819202122
2324252627282930313233