Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
608d2b96
Commit
608d2b96
authored
Oct 28, 2024
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
身份证识别
parent
9237735b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
TestJsonHelper.java
yzg-util-base/src/test/java/helper/TestJsonHelper.java
+18
-1
MapSub.java
yzg-util-base/src/test/java/helper/vo/MapSub.java
+16
-0
No files found.
yzg-util-base/src/test/java/helper/TestJsonHelper.java
View file @
608d2b96
...
...
@@ -2,6 +2,8 @@ package helper;
import
com.alibaba.fastjson.TypeReference
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
com.yanzuoguang.util.vo.MapRow
;
import
helper.vo.MapSub
;
import
org.junit.Assert
;
import
org.junit.Test
;
...
...
@@ -42,6 +44,20 @@ public class TestJsonHelper {
Assert
.
assertNotNull
(
to
.
getList
());
Assert
.
assertNull
(
to
.
getListNull
());
}
@Test
public
void
testMapRow
()
{
String
key
=
"age"
;
MapSub
from
=
new
MapSub
();
from
.
setName
(
"颜佐光"
);
from
.
put
(
"age"
,
15
);
String
json
=
JsonHelper
.
serialize
(
from
);
MapSub
to
=
JsonHelper
.
deserialize
(
json
,
new
TypeReference
<
MapSub
>()
{
});
Assert
.
assertEquals
(
from
.
getName
(),
to
.
getName
());
Assert
.
assertEquals
(
from
.
get
(
key
),
to
.
get
(
key
));
Assert
.
assertEquals
(
from
,
to
);
}
}
...
...
@@ -129,4 +145,5 @@ class FanxingData {
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
\ No newline at end of file
}
yzg-util-base/src/test/java/helper/vo/MapSub.java
0 → 100644
View file @
608d2b96
package
helper
.
vo
;
import
com.yanzuoguang.util.vo.MapRow
;
public
class
MapSub
extends
MapRow
{
private
String
name
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
Write
Preview
Markdown
is supported
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