use of com.alibaba.fastjson.serializer.SerializeWriter in project fastjson by alibaba.
the class StringSerializerTest method test_11_d.
public void test_11_d() throws Exception {
SerializeWriter out = new SerializeWriter();
out.writeString("123\na\nb\nc\nd\"'e", ':');
Assert.assertEquals("\"123\\na\\nb\\nc\\nd\\\"'e\":", out.toString());
}
use of com.alibaba.fastjson.serializer.SerializeWriter in project fastjson by alibaba.
the class SerializeWriterTest method test_error_5.
public void test_error_5() throws Exception {
Exception error = null;
try {
SerializeWriter out = new SerializeWriter(16);
out.write(new char[0], 0, 1);
} catch (IndexOutOfBoundsException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.serializer.SerializeWriter in project fastjson by alibaba.
the class SerializeWriterTest method test_13.
public void test_13() throws Exception {
SerializeWriter out = new SerializeWriter(1);
out.writeInt(Integer.MIN_VALUE);
Assert.assertEquals(Integer.toString(Integer.MIN_VALUE), out.toString());
}
use of com.alibaba.fastjson.serializer.SerializeWriter in project fastjson by alibaba.
the class SerializeWriterTest method test_error_3.
public void test_error_3() throws Exception {
Exception error = null;
try {
SerializeWriter out = new SerializeWriter(16);
out.write(new char[0], 2, 0);
} catch (IndexOutOfBoundsException ex) {
error = ex;
}
Assert.assertNotNull(error);
}
use of com.alibaba.fastjson.serializer.SerializeWriter in project fastjson by alibaba.
the class SerializeWriterTest method test_13_long.
public void test_13_long() throws Exception {
SerializeWriter out = new SerializeWriter(1);
out.writeLong(Long.MIN_VALUE);
Assert.assertEquals(Long.toString(Long.MIN_VALUE), out.toString());
}
Aggregations