Package com.alibaba.json.bvt.serializer

Source Code of com.alibaba.json.bvt.serializer.FontSerializerTest$VO

package com.alibaba.json.bvt.serializer;

import java.awt.Font;

import junit.framework.Assert;
import junit.framework.TestCase;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.FontSerializer;
import com.alibaba.fastjson.serializer.JSONSerializer;
import com.alibaba.fastjson.serializer.SerializeConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;


public class FontSerializerTest extends TestCase {
   
    public void test_null() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        Assert.assertEquals(FontSerializer.class, serializer.getObjectWriter(Font.class).getClass());
       
        VO vo = new VO();
       
        Assert.assertEquals("{\"value\":null}", JSON.toJSONString(vo, SerializerFeature.WriteMapNullValue));
    }

    private static class VO {

        private Font value;

        public Font getValue() {
            return value;
        }

        public void setValue(Font value) {
            this.value = value;
        }

    }
}
TOP

Related Classes of com.alibaba.json.bvt.serializer.FontSerializerTest$VO

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.