@@ -0,0 +1,2728 @@
+package com.alibaba.json.bvt;%0A%0Aimport java.io.StringReader;%0Aimport java.util.Map;%0A%0Aimport org.junit.Assert;%0A%0Aimport com.alibaba.fastjson.JSONException;%0Aimport com.alibaba.fastjson.JSONReader;%0Aimport com.alibaba.fastjson.TypeReference;%0A%0Aimport junit.framework.TestCase;%0A%0Apublic class EnumFieldTest extends TestCase %7B%0A%0A    public void test_special() throws Exception %7B%0A        JSONReader read = new JSONReader(new StringReader(%22%7B%5C%22value%5C%22:1%7D%22));%0A        Model model = read.readObject(Model.class);%0A        Assert.assertEquals(Type.B, model.value);%0A        read.close();%0A    %7D%0A    %0A    public void test_1() throws Exception %7B%0A        JSONReader read = new JSONReader(new StringReader(%22%7B%5C%22value%5C%22:%5C%22A%5C%22,%5C%22value1%5C%22:%5C%22B%5C%22%7D%22));%0A        Model model = read.readObject(Model.class);%0A        Assert.assertEquals(Type.A, model.value);%0A        Assert.assertEquals(Type.B, model.value1);%0A        read.close();%0A    %7D%0A    %0A    public void test_map() throws Exception %7B%0A        JSONReader read = new JSONReader(new StringReader(%22%7B%5C%22model%5C%22:%7B%5C%22value%5C%22:%5C%22A%5C%22,%5C%22value1%5C%22:%5C%22B%5C%22%7D%7D%22));%0A        Map%3CString, Model%3E map = read.readObject(new TypeReference%3CMap%3CString, Model%3E%3E()%7B%7D);%0A        Model model = (Model) map.get(%22model%22);%0A        Assert.assertEquals(Type.A, model.value);%0A        Assert.assertEquals(Type.B, model.value1);%0A        read.close();%0A    %7D%0A%0A    public void test_error() throws Exception %7B%0A        Exception error = null;%0A        try %7B%0A            JSONReader read = new JSONReader(new StringReader(%22%7B%5C%22value%5C%22:%5C%22a%5C%5Cb%5C%22%7D%22));%0A            read.readObject(Model.class);%0A        %7D catch (JSONException ex) %7B%0A            error = ex;%0A        %7D%0A        Assert.assertNotNull(error);%0A    %7D%0A    %0A    public void test_error_1() throws Exception %7B%0A        Exception error = null;%0A        try %7B%0A            JSONReader read = new JSONReader(new StringReader(%22%7B%5C%22value%5C%22:%5C%22A%5C%22,%5C%22value1%5C%22:%5C%22B%5C%22%5B%22));%0A            Model model = read.readObject(Model.class);%0A            read.readObject(Model.class);%0A        %7D catch (JSONException ex) %7B%0A            error = ex;%0A        %7D%0A        Assert.assertNotNull(error);%0A    %7D%0A    %0A    public void test_error_2() throws Exception %7B%0A        Exception error = null;%0A        try %7B%0A            JSONReader read = new JSONReader(new StringReader(%22%7B%5C%22model%5C%22:%7B%5C%22value%5C%22:%5C%22A%5C%22,%5C%22value1%5C%22:%5C%22B%5C%22%7D%5B%22));%0A            Map%3CString, Model%3E map = read.readObject(new TypeReference%3CMap%3CString, Model%3E%3E()%7B%7D);%0A            read.readObject(Model.class);%0A        %7D catch (JSONException ex) %7B%0A            error = ex;%0A        %7D%0A        Assert.assertNotNull(error);%0A    %7D%0A%0A    private static class Model %7B%0A%0A        public Type value;%0A        public Type value1;%0A%0A    %7D%0A%0A    public static enum Type %7B%0A                             A, B, C%0A    %7D%0A%7D%0A

add testcase