Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3286 from ZivYan/issue#3281
Browse files Browse the repository at this point in the history
add testcase for #3281
  • Loading branch information
wenshao authored Jun 25, 2020
2 parents 2646f10 + 1bd3c83 commit 2ea933b
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions src/test/java/com/alibaba/json/bvt/issue_3200/Issue3281.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.alibaba.json.bvt.issue_3200;

import com.alibaba.fastjson.JSON;
import junit.framework.TestCase;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import org.junit.Assert;

import java.util.Date;
import java.util.HashMap;

/**
* @Author :Nanqi
* @Date :Created in 10:47 2020/6/22
* @Description:补充测试用例
*/
public class Issue3281 extends TestCase {
public void test_for_issue() {
ModelState modelBack = JSON.parseObject("{\"counterMap\":{\"0\":0,\"100\":0,\"200\":0,\"300\":0,\"400\":0," +
"\"500\":0,\"600\":0,\"700\":0,\"800\":0,\"900\":0,\"1000\":0},\"formatDate\":null," +
"\"modelName\":\"test\",\"modelScores\":{\"Test1-1000\":{\"max\":1.0997832999999515,\"min\":0.0," +
"\"recording\":false}},\"modelVersion\":\"1\",\"pit\":1592470429399,\"useCaseName\":\"test\"," +
"\"variableName\":\"v2\"}", ModelState.class);
Assert.assertNotNull(modelBack.getCounterMap());
Assert.assertNotNull(modelBack.getModelScores());
}

@Builder
@Data
@AllArgsConstructor
public static class ModelState {
private HashMap<String, Long> counterMap;

private Date formatDate;

private HashMap<String, TGigest> modelScores;

private String modelName;

private Long modelVersion;

private Long pit;

private String useCaseName;

private String variableName;
}

@Builder
@Data
@AllArgsConstructor
public static class TGigest {
private Double max;

private Double min;

private Boolean recording;
}
}

0 comments on commit 2ea933b

Please sign in to comment.