public static String getTestUrl(hudson.tasks.test.TestResult result) {
String buildUrl = getBuildURL(result.getOwner());
@SuppressWarnings("rawtypes")
AbstractTestResultAction action = result.getTestResultAction();
TestObject parent = result.getParent();
TestResult testResultRoot = null;
while(parent != null) {
if (parent instanceof TestResult) {
testResultRoot = (TestResult) parent;
break;
}
parent = parent.getParent();
}
String testUrl = action.getUrlName()
+ (testResultRoot != null ? testResultRoot.getUrl() : "")
+ result.getUrl();