修复报告中请求失败数错误的bug

This commit is contained in:
q4speed 2020-05-20 16:29:23 +08:00
parent 5a0863e9a8
commit dc2a1202ae
4 changed files with 9 additions and 6 deletions

View File

@ -88,8 +88,8 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
scenarioResult.addSuccess(); scenarioResult.addSuccess();
testResult.addSuccess(); testResult.addSuccess();
} else { } else {
scenarioResult.addError(); scenarioResult.addError(result.getErrorCount());
testResult.addError(); testResult.addError(result.getErrorCount());
} }
RequestResult requestResult = getRequestResult(result); RequestResult requestResult = getRequestResult(result);
@ -123,6 +123,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
requestResult.setRequestSize(result.getSentBytes()); requestResult.setRequestSize(result.getSentBytes());
requestResult.setTotalAssertions(result.getAssertionResults().length); requestResult.setTotalAssertions(result.getAssertionResults().length);
requestResult.setSuccess(result.isSuccessful()); requestResult.setSuccess(result.isSuccessful());
requestResult.setError(result.getErrorCount());
ResponseResult responseResult = requestResult.getResponseResult(); ResponseResult responseResult = requestResult.getResponseResult();
responseResult.setBody(result.getResponseDataAsString()); responseResult.setBody(result.getResponseDataAsString());

View File

@ -13,6 +13,8 @@ public class RequestResult {
private long requestSize; private long requestSize;
private int error;
private boolean success; private boolean success;
private String headers; private String headers;

View File

@ -28,8 +28,8 @@ public class ScenarioResult {
this.responseTime += time; this.responseTime += time;
} }
public void addError() { public void addError(int count) {
this.error++; this.error += count;
} }
public void addSuccess() { public void addSuccess() {

View File

@ -22,8 +22,8 @@ public class TestResult {
private final List<ScenarioResult> scenarios = new ArrayList<>(); private final List<ScenarioResult> scenarios = new ArrayList<>();
public void addError() { public void addError(int count) {
this.error++; this.error += count;
} }
public void addSuccess() { public void addSuccess() {