-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JSONType.parserFeatures support 'Feature.NonPublicFieldSupport'
- Loading branch information
Showing
3 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.alibaba.json.bvt.bug; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.alibaba.fastjson.parser.Feature; | ||
import com.alibaba.json.bvtVO.Issue900_CurrencyListResult; | ||
import junit.framework.TestCase; | ||
|
||
import java.util.ArrayList; | ||
|
||
/** | ||
* Created by wenshao on 2016/11/18. | ||
*/ | ||
public class Issue_900_4 extends TestCase { | ||
public void test_for_issue() throws Exception { | ||
Issue900_CurrencyListResult result = JSON.parseObject("{\"payCurrencyList\":[\"abc\"]}", Issue900_CurrencyListResult.class, Feature.SupportNonPublicField); | ||
assertEquals(1, result.getPayCurrencyList().size()); | ||
assertEquals("abc", result.getPayCurrencyList().get(0)); | ||
} | ||
|
||
public static class CurrencyListResult { | ||
public static final int VERSION = 1; // cache version, 如果结构改变, 需要同步修改版本号 | ||
|
||
// 可支付币种列表 | ||
private ArrayList<String> payCurrencyList; | ||
|
||
public ArrayList<String> getPayCurrencyList() { | ||
return payCurrencyList; | ||
} | ||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/test/java/com/alibaba/json/bvtVO/Issue900_CurrencyListResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.alibaba.json.bvtVO; | ||
|
||
import java.util.ArrayList; | ||
|
||
/** | ||
* Created by wenshao on 2016/11/18. | ||
*/ | ||
public class Issue900_CurrencyListResult { | ||
public static final int VERSION = 1; // cache version, 如果结构改变, 需要同步修改版本号 | ||
|
||
// 可支付币种列表 | ||
private ArrayList<String> payCurrencyList = new ArrayList<String>(); | ||
|
||
public ArrayList<String> getPayCurrencyList() { | ||
return payCurrencyList; | ||
} | ||
} |