Package com.alibaba.fastjson.serializer

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeFieldName()


  }

  public void test_9() throws Exception {
    SerializeWriter out = new SerializeWriter(1);
    out.config(SerializerFeature.UseSingleQuotes, true);
    out.writeFieldName("\na\nb\nc\nd\"'e");
    Assert.assertEquals("'\\na\\nb\\nc\\nd\"\\'e':", out.toString());
  }

  public void test_9_d() throws Exception {
    SerializeWriter out = new SerializeWriter(1);
View Full Code Here


  }

  public void test_9_d() throws Exception {
    SerializeWriter out = new SerializeWriter(1);

    out.writeFieldName("\na\nb\nc\nd\"'e");
    Assert.assertEquals("\"\\na\\nb\\nc\\nd\\\"'e\":", out.toString());
  }

  public void test_10() throws Exception {
    SerializeWriter out = new SerializeWriter();
View Full Code Here

  }

  public void test_10() throws Exception {
    SerializeWriter out = new SerializeWriter();
    out.config(SerializerFeature.UseSingleQuotes, true);
    out.writeFieldName("123\na\nb\nc\nd\"'e");
    Assert.assertEquals("'123\\na\\nb\\nc\\nd\"\\'e':", out.toString());
  }

  public void test_10_d() throws Exception {
    SerializeWriter out = new SerializeWriter();
View Full Code Here

  }

  public void test_10_d() throws Exception {
    SerializeWriter out = new SerializeWriter();

    out.writeFieldName("123\na\nb\nc\nd\"'e", true);
    Assert.assertEquals("\"123\\na\\nb\\nc\\nd\\\"'e\":", out.toString());
  }

  public void test_11() throws Exception {
    SerializeWriter out = new SerializeWriter();
View Full Code Here

  public void test_1() throws Exception {
    SerializeWriter out = new SerializeWriter(1);
    out.config(SerializerFeature.QuoteFieldNames, true);
    out.config(SerializerFeature.UseSingleQuotes, true);
    out.writeFieldName("名称");
    Assert.assertEquals("'名称':", out.toString());
  }

  public void test_2() throws Exception {
    SerializeWriter out = new SerializeWriter(1);
View Full Code Here

  }

  public void test_2() throws Exception {
    SerializeWriter out = new SerializeWriter(1);
    out.config(SerializerFeature.QuoteFieldNames, false);
    out.writeFieldName("名称");
    Assert.assertEquals("名称:", out.toString());
  }

  public void test_3() throws Exception {
    SerializeWriter out = new SerializeWriter(1);
View Full Code Here

  }

  public void test_3() throws Exception {
    SerializeWriter out = new SerializeWriter(1);
    out.config(SerializerFeature.QuoteFieldNames, false);
    out.writeFieldName("a\n\n\n\n");
    Assert.assertEquals("\"a\\n\\n\\n\\n\":", out.toString());
  }
 
  public void test_4() throws Exception {
    SerializeWriter out = new SerializeWriter(1);
View Full Code Here

 
  public void test_4() throws Exception {
    SerializeWriter out = new SerializeWriter(1);
    out.config(SerializerFeature.QuoteFieldNames, false);
    out.config(SerializerFeature.UseSingleQuotes, true);
    out.writeFieldName("a\n\n\n\n");
    Assert.assertEquals("'a\\n\\n\\n\\n':", out.toString());
  }
}
View Full Code Here

  public void test_11() throws Exception {
    SerializeWriter out = new SerializeWriter();
    out.config(SerializerFeature.QuoteFieldNames, true);
    out.config(SerializerFeature.UseSingleQuotes, true);
    out.writeFieldName("123\na\nb\nc\nd\"'e");
    Assert.assertEquals("'123\\na\\nb\\nc\\nd\"\\'e':", out.toString());
  }

  public void test_11_d() throws Exception {
    SerializeWriter out = new SerializeWriter();
View Full Code Here

  public void test_12() throws Exception {
    SerializeWriter out = new SerializeWriter(1);
    out.config(SerializerFeature.QuoteFieldNames, true);
    out.config(SerializerFeature.UseSingleQuotes, true);
    out.writeFieldName("123\na\nb\nc\nd\"'e");
    Assert.assertEquals("'123\\na\\nb\\nc\\nd\"\\'e':", out.toString());
  }

  public void test_12_d() throws Exception {
    SerializeWriter out = new SerializeWriter(1);
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.