package com.alibaba.json.bvt.issue_1100;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import junit.framework.TestCase;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by wenshao on 08/05/2017.
 */
public class Issue1152 extends TestCase {
    public void test_for_issue() throws Exception {
        TestBean tb = JSONObject.parseObject("{shijian:\"0000-00-00T00:00:00\"}",TestBean.class);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        assertNull(tb.getShijian());
    }

    public static class TestBean {

        private Date shijian;

        public Date getShijian() {
            return shijian;
        }
        @JSONField(name="shijian" )
        public void setShijian(Date shijian) {
            this.shijian = shijian;
        }
    }
}

@@ -467,73 +467,199 @@
     
-SimpleDateFormat sdf = new SimpleDateFormat(%22yyyy-MM-dd HH:mm:
+assertNull(tb.getShijian());%0A    %7D%0A%0A    public void test_for_issue_2() throws Exception %7B%0A        TestBean tb = JSONObject.parseObject(%22%7Bshijian:%5C%220001-01-01T00:00:00+08:00%5C%22%7D%22,TestBean.cla
 ss
-%22
 );%0A 

add testcase for issue #1152