Package com.alibaba.fastjson.serializer

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


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

  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 {
View Full Code Here


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

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

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

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

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

  public void test_13() throws Exception {
    SerializeWriter out = new SerializeWriter(4);
    out.config(SerializerFeature.UseSingleQuotes, true);

    out.writeString("1'");
    Assert.assertEquals("'1\\''", out.toString());
  }
View Full Code Here

    Assert.assertEquals("'1\\''", out.toString());
  }

  public void test_14() throws Exception {
    SerializeWriter out = new SerializeWriter(4);
    out.config(SerializerFeature.UseSingleQuotes, false);

    out.writeString("1\"");
    Assert.assertEquals("\"1\\\"\"", out.toString());
  }
View Full Code Here

@SuppressWarnings("deprecation")
public class SerializeWriterTest_4 extends TestCase {

    public void test_0() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
        out.config(SerializerFeature.QuoteFieldNames, true);
        out.config(SerializerFeature.WriteTabAsSpecial, true);
        out.writeFieldValue(',', "name", "\t");
        Assert.assertEquals(",\"name\":\"\\t\"", out.toString());
        out.close();
    }
View Full Code Here

public class SerializeWriterTest_4 extends TestCase {

    public void test_0() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
        out.config(SerializerFeature.QuoteFieldNames, true);
        out.config(SerializerFeature.WriteTabAsSpecial, true);
        out.writeFieldValue(',', "name", "\t");
        Assert.assertEquals(",\"name\":\"\\t\"", out.toString());
        out.close();
    }
   
View Full Code Here

        out.close();
    }
   
    public void test_1() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
        out.config(SerializerFeature.QuoteFieldNames, true);
        out.config(SerializerFeature.WriteTabAsSpecial, true);
        out.writeFieldValue(',', "name", "\t\n");
        Assert.assertEquals(",\"name\":\"\\t\\n\"", out.toString());
        out.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.