Commit 608d2b96 authored by yanzg's avatar yanzg

身份证识别

parent 9237735b
......@@ -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
}
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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment