Hello everybody!

I've replicated jUnit plugin behavior to access that URL:

AggregatedTestResultAction testResultAction =  build.getAction(
AggregatedTestResultAction.class);

List<ChildReport> childReports = testResultAction.getChildReports();

for (ChildReport report : childReports) {

   TestResult result = (TestResult)report.result;

      if (result.getFailCount() < 1) {
        continue;
      }

   AbstractProject project = (AbstractProject)report.child.getProject();
   String baseUrl = Jenkins.getInstance().getRootUrl() + build.getUrl() + 
project.getShortUrl() + "testReport";
   List<CaseResult> failedTests = result.getFailedTests();

      for (CaseResult failedTest : failedTests) {
       String url = baseUrl + failedTest.getRelativePathFrom(result);
       url += failedTest.getRelativePathFrom(result);

       System.out.println(failedTest.getFullDisplayName() + ": " + url);
     }

}


Hope it helps!

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to