forked from alibaba/fastjson
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCase0.java
More file actions
54 lines (37 loc) · 1.1 KB
/
Copy pathCase0.java
File metadata and controls
54 lines (37 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.alibaba.json.bvt.asm;
import junit.framework.Assert;
import junit.framework.TestCase;
import com.alibaba.fastjson.JSON;
public class Case0 extends TestCase {
public void test_0() throws Exception {
V0 entity = new V0();
entity.setValue("abc");
String jsonString = JSON.toJSONString(entity);
System.out.println(jsonString);
V0 entity2 = JSON.parseObject(jsonString, V0.class);
Assert.assertEquals(entity.getValue(), entity2.getValue());
}
public static class V0 {
private int id;
private String value;
private long v2;
public long getV2() {
return v2;
}
public void setV2(long v2) {
this.v2 = v2;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
}