use of hudson.tasks.junit.JUnitParser in project jenkin-qtest-plugin by QASymphony.
the class PatternScanParser method parse.
/**
* Read test results with test result location pattern
*
* @param request request
* @param testResultLocation testResultLocation
* @return a list of {@link AutomationTestResult}
* @throws Exception Exception
*/
public List<AutomationTestResult> parse(ParseRequest request, String testResultLocation) throws Exception {
JUnitParser jUnitParser = new JUnitParser(true);
Run<?, ?> build = request.getBuild();
Launcher launcher = request.getLauncher();
TaskListener listener = request.getListener();
List<TestResult> testResults = new ArrayList<>();
testResults.add(jUnitParser.parseResult(testResultLocation, build, request.getWorkSpace(), launcher, listener));
GregorianCalendar gregorianCalendar = new GregorianCalendar();
gregorianCalendar.setTimeInMillis(build.getStartTimeInMillis());
return CommonParsingUtils.toAutomationTestResults(request, testResults, gregorianCalendar.getTime());
}
Aggregations