@@ -0,0 +1,2029 @@
+package com.alibaba.json.bvt.bug;%0A%0Aimport java.lang.reflect.Type;%0A%0Aimport org.junit.Assert;%0A%0Aimport com.alibaba.fastjson.JSON;%0Aimport com.alibaba.fastjson.parser.DefaultJSONParser;%0Aimport com.alibaba.fastjson.parser.JSONToken;%0Aimport com.alibaba.fastjson.parser.ParserConfig;%0Aimport com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;%0A%0Aimport junit.framework.TestCase;%0A%0Apublic class Bug_for_Issue_603 extends TestCase %7B%0A%0A    public void test_for_issue() throws Exception %7B%0A        ParserConfig.getGlobalInstance().putDeserializer(OrderActionEnum.class, new OrderActionEnumDeser());%0A%0A        %7B%0A            Msg msg = JSON.parseObject(%22%7B%5C%22actionEnum%5C%22:1,%5C%22body%5C%22:%5C%22A%5C%22%7D%22, Msg.class);%0A            Assert.assertEquals(msg.body, %22A%22);%0A            Assert.assertEquals(msg.actionEnum, OrderActionEnum.FAIL);%0A        %7D%0A        %7B%0A            Msg msg = JSON.parseObject(%22%7B%5C%22actionEnum%5C%22:0,%5C%22body%5C%22:%5C%22B%5C%22%7D%22, Msg.class);%0A            Assert.assertEquals(msg.body, %22B%22);%0A            Assert.assertEquals(msg.actionEnum, OrderActionEnum.SUCC);%0A        %7D%0A    %7D%0A%0A    public static class OrderActionEnumDeser implements ObjectDeserializer %7B%0A%0A        @SuppressWarnings(%22unchecked%22)%0A        @Override%0A        public %3CT%3E T deserialze(DefaultJSONParser parser, Type type, Object fieldName) %7B%0A            Integer intValue = parser.parseObject(int.class);%0A            if (intValue == 1) %7B%0A                return (T) OrderActionEnum.FAIL;%0A            %7D else if (intValue == 0) %7B%0A                return (T) OrderActionEnum.SUCC;%0A            %7D%0A            throw new IllegalStateException();%0A        %7D%0A%0A        @Override%0A        public int getFastMatchToken() %7B%0A            return JSONToken.LITERAL_INT;%0A        %7D%0A%0A    %7D%0A%0A    public static enum OrderActionEnum %7B%0A                                        FAIL(1), SUCC(0);%0A%0A        private int code;%0A%0A        OrderActionEnum(int code)%7B%0A            this.code = code;%0A        %7D%0A    %7D%0A%0A    public static class Msg %7B%0A%0A        public OrderActionEnum actionEnum;%0A        public String          body;%0A    %7D%0A%7D%0A

add testcase for issue 603. https://github.com/alibaba/fastjson/issues/603