use of com.qasymphony.ci.plugin.model.SubmittedResult in project jenkin-qtest-plugin by QASymphony.
the class StatisticsAction method getTreeResult.
/**
* use to get result in qTest Plugin page
*
* @param page page submitted result
* @return submitted result data
*/
@JavaScriptMethod
public JSONObject getTreeResult(int page) {
Map<Integer, SubmittedResult> results = null;
try {
AbstractProject project = this.getProject();
results = storeResultService.fetchAll(new ReadSubmitLogRequest().setProject(project).setStart(0).setSize(-1)).getResults();
} catch (Exception e) {
LOG.log(Level.WARNING, e.getMessage());
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("data", null == results ? "" : results.values());
return jsonObject;
}
use of com.qasymphony.ci.plugin.model.SubmittedResult in project jenkin-qtest-plugin by QASymphony.
the class StoreResultServiceTests method testStore2.
@LocalData
@Test
public void testStore2() throws Exception {
project.scheduleBuild2(0).get(1, TimeUnit.MINUTES);
int currentBuild = project.getNextBuildNumber() - 1;
SubmittedResult result = new SubmittedResult().setSubmitStatus(JunitSubmitterResult.STATUS_SUCCESS).setTestSuiteName(project.getName()).setNumberTestResult(0).setNumberTestLog(0).setBuildNumber(currentBuild).setStatusBuild("SUCCESS");
storeResultService.store(project, result);
SubmittedResult result2 = new SubmittedResult().setSubmitStatus(JunitSubmitterResult.STATUS_SUCCESS).setTestSuiteName(project.getName()).setNumberTestResult(2).setNumberTestLog(2).setBuildNumber(++currentBuild).setStatusBuild("FAILED");
storeResultService.store(project, result2);
Map<Integer, SubmittedResult> resMap = storeResultService.fetchAll(new ReadSubmitLogRequest().setProject(project)).getResults();
assertEquals("Result size is: ", 2, resMap.size());
assertNotNull("Result 0 is: ", resMap.get(1));
assertNotNull("Result 1 is: ", resMap.get(2));
}
Aggregations