Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
383 additions
and
13 deletions.
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
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
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
25 changes: 25 additions & 0 deletions
25
src/test/java/com/alibaba/json/bvt/issue_1800/Issue1821.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,25 @@ | ||
package com.alibaba.json.bvt.issue_1800; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.alibaba.fastjson.annotation.JSONField; | ||
import com.alibaba.fastjson.annotation.JSONType; | ||
import junit.framework.TestCase; | ||
|
||
public class Issue1821 extends TestCase { | ||
public void test_for_issue() throws Exception { | ||
String str = "{\"type\":800,\"data\":\"HuYgMIxwfqdtvOJNv6kK025g5fh3yFHI2kaByO7udKk6FOBC3PGRWkGfwV0\\/vWQW6roN5ftKDHFZ3PWl0715OYue0rZj\\/VwrNsMvIL4MqTUNBBUGFU9SgZu87ss7RqmyijH6\\/sM968cK1Dv5U7Rrw79idl\\/hW8SILLn1YXvUa60=\"}"; | ||
Model m = JSON.parseObject(str, Model.class); | ||
|
||
|
||
} | ||
|
||
@JSONType | ||
public static class Model { | ||
@JSONField(name="type") | ||
public int type; | ||
|
||
@JSONField(name="data") | ||
public byte[] data; | ||
} | ||
|
||
} |
75 changes: 75 additions & 0 deletions
75
src/test/java/com/alibaba/json/bvt/issue_1800/Issue_for_dianxing.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,75 @@ | ||
package com.alibaba.json.bvt.issue_1800; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import junit.framework.TestCase; | ||
|
||
public class Issue_for_dianxing extends TestCase { | ||
public void test_0() throws Exception { | ||
String s = "{\"alarmLevel\":null,\"error\":null,\"errorCount\":0,\"maxAlarmCount\":10,\"warn\":null," | ||
+ "\"warnCount\":0}"; | ||
TopAlarm b = JSON.parseObject(s, TopAlarm.class); | ||
System.out.println(JSON.toJSONString(b)); | ||
} | ||
|
||
public static class TopAlarm { | ||
|
||
private Double error; //为null表示不报警 | ||
private int errorCount; | ||
private Double warn; //为null表示不报警 | ||
private int warnCount; | ||
private Integer alarmLevel; | ||
private int maxAlarmCount = 10; | ||
|
||
public TopAlarm() { | ||
} | ||
|
||
public Double getError() { | ||
return error; | ||
} | ||
|
||
public void setError(Double error) { | ||
this.error = error; | ||
} | ||
|
||
public Double getWarn() { | ||
return warn; | ||
} | ||
|
||
public void setWarn(Double warn) { | ||
this.warn = warn; | ||
} | ||
|
||
public int getErrorCount() { | ||
return errorCount; | ||
} | ||
|
||
public void setErrorCount(int errorCount) { | ||
this.errorCount = errorCount; | ||
} | ||
|
||
public int getWarnCount() { | ||
return warnCount; | ||
} | ||
|
||
public void setWarnCount(int warnCount) { | ||
this.warnCount = warnCount; | ||
} | ||
|
||
public Integer getAlarmLevel() { | ||
return alarmLevel; | ||
} | ||
|
||
public void setAlarmLevel(Integer alarmLevel) { | ||
this.alarmLevel = alarmLevel; | ||
} | ||
|
||
public int getMaxAlarmCount() { | ||
return maxAlarmCount; | ||
} | ||
|
||
public void setMaxAlarmCount(int maxAlarmCount) { | ||
this.maxAlarmCount = maxAlarmCount; | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.