Package com.alibaba.fastjson.serializer

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


public class SerializeWriterTest_16 extends TestCase {

    public void test_writer_1() throws Exception {
        StringWriter strOut = new StringWriter();
        SerializeWriter out = new SerializeWriter(strOut, 14);
        out.config(SerializerFeature.BrowserCompatible, true);

        try {
            JSONSerializer serializer = new JSONSerializer(out);

            VO vo = new VO();
View Full Code Here


public class SerializeWriterTest_15 extends TestCase {
    @SuppressWarnings("rawtypes")
    public void test_writer_1() throws Exception {
        StringWriter strOut = new StringWriter();
        SerializeWriter out = new SerializeWriter(strOut, 1);
        out.config(SerializerFeature.UseSingleQuotes, true);

        try {
            JSONSerializer serializer = new JSONSerializer(out);

            Map map = Collections.singletonMap("", "a");
View Full Code Here

   
   
    public void test_writer_2() throws Exception {
        StringWriter strOut = new StringWriter();
        SerializeWriter out = new SerializeWriter(strOut, 1);
        out.config(SerializerFeature.UseSingleQuotes, true);

        try {
            JSONSerializer serializer = new JSONSerializer(out);

            Map map = Collections.singletonMap("ab", "a");
View Full Code Here

    }
   
    public void test_writer_3() throws Exception {
        StringWriter strOut = new StringWriter();
        SerializeWriter out = new SerializeWriter(strOut, 1);
        out.config(SerializerFeature.UseSingleQuotes, true);

        try {
            JSONSerializer serializer = new JSONSerializer(out);

            Map map = Collections.singletonMap("ab\t", "a");
View Full Code Here

        }
    }

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

        try {
            JSONSerializer serializer = new JSONSerializer(out);

            serializer.write(Collections.singletonMap("", ""));
View Full Code Here

public class StreamWriterTest_writeFieldValue_int extends TestCase {
    public void test_0() throws Exception {
        StringWriter out = new StringWriter();
       
        SerializeWriter writer = new SerializeWriter(out, 10);
        writer.config(SerializerFeature.QuoteFieldNames, true);
        Assert.assertEquals(10, writer.getBufferLength());
       
        writer.writeFieldValue(',', "abcde01245abcde", 123);
        writer.close();
       
View Full Code Here

public class StreamWriterTest_writeFieldValue_long extends TestCase {
    public void test_0() throws Exception {
        StringWriter out = new StringWriter();
       
        SerializeWriter writer = new SerializeWriter(out, 10);
        writer.config(SerializerFeature.QuoteFieldNames, true);
        Assert.assertEquals(10, writer.getBufferLength());
       
        writer.writeFieldValue(',', "abcde01245abcde", 123L);
        writer.close();
       
View Full Code Here

public class StreamWriterTest_writeFieldValue_string extends TestCase {
    public void test_0() throws Exception {
        StringWriter out = new StringWriter();
       
        SerializeWriter writer = new SerializeWriter(out, 10);
        writer.config(SerializerFeature.QuoteFieldNames, true);
        Assert.assertEquals(10, writer.getBufferLength());
       
        writer.writeFieldValue(',', "abcde01245abcde", "123");
        writer.close();
       
View Full Code Here

public class StreamWriterTest_writeFieldValue_string_singQuote extends TestCase {
    public void test_0() throws Exception {
        StringWriter out = new StringWriter();
       
        SerializeWriter writer = new SerializeWriter(out, 10);
        writer.config(SerializerFeature.QuoteFieldNames, true);
        writer.config(SerializerFeature.UseSingleQuotes, true);
        Assert.assertEquals(10, writer.getBufferLength());
       
        writer.writeFieldValue(',', "abcde01245abcde", "123");
        writer.close();
View Full Code Here

    public void test_0() throws Exception {
        StringWriter out = new StringWriter();
       
        SerializeWriter writer = new SerializeWriter(out, 10);
        writer.config(SerializerFeature.QuoteFieldNames, true);
        writer.config(SerializerFeature.UseSingleQuotes, true);
        Assert.assertEquals(10, writer.getBufferLength());
       
        writer.writeFieldValue(',', "abcde01245abcde", "123");
        writer.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.