Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Fastjson
Commits
66aecf4d
Commit
66aecf4d
authored
7 years ago
by
wenshao
Browse files
Options
Download
Email Patches
Plain Diff
add testcase.
parent
7fb01dc1
android
1.1.71.android
1.1.68.android
1.1.67.android
1.1.66.android
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/com/alibaba/json/bvt/issue_1500/Issue1583.java
+30
-0
src/test/java/com/alibaba/json/bvt/issue_1500/Issue1583.java
with
30 additions
and
0 deletions
+30
-0
src/test/java/com/alibaba/json/bvt/issue_1500/Issue1583.java
0 → 100644
+
30
-
0
View file @
66aecf4d
package
com.alibaba.json.bvt.issue_1500
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
junit.framework.TestCase
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
Issue1583
extends
TestCase
{
public
void
test_issue
()
throws
Exception
{
Map
<
String
,
List
<
String
>>
totalMap
=
new
HashMap
<
String
,
List
<
String
>>();
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
List
<
String
>
list
=
new
ArrayList
<
String
>();
for
(
int
j
=
0
;
j
<
2
;
j
++)
{
list
.
add
(
"list"
+
j
);
}
totalMap
.
put
(
"map"
+
i
,
list
);
}
List
<
Map
.
Entry
<
String
,
List
<
String
>>>
mapList
=
new
ArrayList
<
Map
.
Entry
<
String
,
List
<
String
>>>(
totalMap
.
entrySet
());
String
jsonString
=
JSON
.
toJSONString
(
mapList
,
SerializerFeature
.
DisableCircularReferenceDetect
);
System
.
out
.
println
(
jsonString
);
List
<
Map
.
Entry
<
String
,
List
<
String
>>>
parse
=
JSON
.
parseObject
(
jsonString
,
new
TypeReference
<
List
<
Map
.
Entry
<
String
,
List
<
String
>>>>()
{});
System
.
out
.
println
(
parse
);
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help