From be5fc9a8db358921c01679929d361c7073dfd465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E9=93=81?= Date: Sat, 21 May 2016 04:00:59 +0800 Subject: [PATCH] improved testcase --- .../java/com/alibaba/json/bvt/bug/Bug_for_DiffType.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/alibaba/json/bvt/bug/Bug_for_DiffType.java b/src/test/java/com/alibaba/json/bvt/bug/Bug_for_DiffType.java index 1f752d7bb8..37f2438c6f 100644 --- a/src/test/java/com/alibaba/json/bvt/bug/Bug_for_DiffType.java +++ b/src/test/java/com/alibaba/json/bvt/bug/Bug_for_DiffType.java @@ -1,5 +1,7 @@ package com.alibaba.json.bvt.bug; +import org.junit.Assert; + import com.alibaba.fastjson.JSON; import junit.framework.TestCase; @@ -9,7 +11,9 @@ public void test_for_diff_type() throws Exception { Model model = new Model(); model.setValue(1001); - JSON.toJSONString(model); + String text = JSON.toJSONString(model); + Model model2 = JSON.parseObject(text, Model.class); + Assert.assertEquals(model.value, model2.value); } public static class Model {