Program: 36216
Project: 36216
Buggy source:
private void makeResultResource(ITestResult result,String status){
  String className=result.getTestClass().getName();
  className=className.substring(className.lastIndexOf("String_Node_Str") + 1);
  Resource assertionResource=model.createResource(null,Earl.Assertion);
  Resource resultResource=model.createResource(null,Earl.TestResult);
  Resource subjectResource=model.getResource(assertor);
  assertionResource.addProperty(Earl.testSubject,subjectResource);
  assertionResource.addProperty(Earl.test,model.getResource(createTestCaseURL(className,result.getName())));
  Method method=result.getMethod().getConstructorOrMethod().getMethod();
  if (method.getAnnotation(SpecTest.class) != null) {
    SpecTest specTest=method.getAnnotation(SpecTest.class);
    if (specTest.coveredByGroups().length > 0 && specTest.coveredByGroups().length > 0) {
      ArrayList<String> testResults=new ArrayList<String>();
      for (      Class<?> classVal : specTest.coveredByTests()) {
        Method[] classMethod=classVal.getDeclaredMethods();
        for (        Method methodName : classMethod) {
          if (methodName.getAnnotation(Test.class) != null) {
            String group=Arrays.toString(methodName.getAnnotation(Test.class).groups());
            for (            String groupCover : specTest.coveredByGroups()) {
              if (group.contains(groupCover) && !methodName.getName().contains("String_Node_Str")) {
                testResults.add(findTestResult(methodName.getName()));
              }
            }
          }
        }
      }
      if (testResults.size() > 0) {
        if (testResults.contains(FAIL))         status=FAIL;
 else         if (testResults.contains(PASS) && !testResults.contains(FAIL))         status=PASS;
 else         if (testResults.contains(SKIP) && !testResults.contains(FAIL) && !testResults.contains(PASS))         status=SKIP;
      }
    }
  }
switch (status) {
case FAIL:
    resultResource.addProperty(Earl.outcome,Earl.failed);
  break;
case PASS:
resultResource.addProperty(Earl.outcome,Earl.passed);
break;
case SKIP:
resultResource.addProperty(Earl.outcome,Earl.untested);
break;
default :
break;
}
if (result.getThrowable() != null) {
createExceptionProperty(result.getThrowable(),resultResource);
}
if (result.getMethod().getConstructorOrMethod().getMethod().getAnnotation(SpecTest.class) != null) {
SpecTest test=result.getMethod().getConstructorOrMethod().getMethod().getAnnotation(SpecTest.class);
METHOD type=test.testMethod();
switch (type) {
case AUTOMATED:
assertionResource.addProperty(Earl.mode,Earl.automatic);
break;
case MANUAL:
assertionResource.addProperty(Earl.mode,Earl.manual);
break;
case INDIRECT:
assertionResource.addProperty(Earl.mode,Earl.automatic);
break;
default :
assertionResource.addProperty(Earl.mode,Earl.notTested);
break;
}
}
assertionResource.addProperty(Earl.assertedBy,subjectResource);
assertionResource.addLiteral(ranAsClass,result.getTestClass().getRealClass().getSimpleName());
resultResource.addProperty(DCTerms.date,model.createTypedLiteral(GregorianCalendar.getInstance()));
assertionResource.addProperty(Earl.testResult,resultResource);
}

Fixed version (ground truth):
private void makeResultResource(ITestResult result,String status){
  String className=result.getTestClass().getName();
  className=className.substring(className.lastIndexOf("String_Node_Str") + 1);
  Resource assertionResource=model.createResource(null,Earl.Assertion);
  Resource resultResource=model.createResource(null,Earl.TestResult);
  Resource subjectResource=model.getResource(homepage);
  Resource assertorResource=model.getResource(assertor);
  assertionResource.addProperty(Earl.testSubject,subjectResource);
  assertionResource.addProperty(Earl.test,model.getResource(createTestCaseURL(className,result.getName())));
  Method method=result.getMethod().getConstructorOrMethod().getMethod();
  if (method.getAnnotation(SpecTest.class) != null) {
    SpecTest specTest=method.getAnnotation(SpecTest.class);
    if (specTest.coveredByGroups().length > 0 && specTest.coveredByGroups().length > 0) {
      ArrayList<String> testResults=new ArrayList<String>();
      for (      Class<?> classVal : specTest.coveredByTests()) {
        Method[] classMethod=classVal.getDeclaredMethods();
        for (        Method methodName : classMethod) {
          if (methodName.getAnnotation(Test.class) != null) {
            String group=Arrays.toString(methodName.getAnnotation(Test.class).groups());
            for (            String groupCover : specTest.coveredByGroups()) {
              if (group.contains(groupCover) && !methodName.getName().contains("String_Node_Str")) {
                testResults.add(findTestResult(methodName.getName()));
              }
            }
          }
        }
      }
      if (testResults.size() > 0) {
        if (testResults.contains(FAIL))         status=FAIL;
 else         if (testResults.contains(PASS) && !testResults.contains(FAIL))         status=PASS;
 else         if (testResults.contains(SKIP) && !testResults.contains(FAIL) && !testResults.contains(PASS))         status=SKIP;
      }
    }
  }
switch (status) {
case FAIL:
    resultResource.addProperty(Earl.outcome,Earl.failed);
  break;
case PASS:
resultResource.addProperty(Earl.outcome,Earl.passed);
break;
case SKIP:
resultResource.addProperty(Earl.outcome,Earl.untested);
break;
default :
break;
}
if (result.getThrowable() != null) {
createExceptionProperty(result.getThrowable(),resultResource);
}
if (result.getMethod().getConstructorOrMethod().getMethod().getAnnotation(SpecTest.class) != null) {
SpecTest test=result.getMethod().getConstructorOrMethod().getMethod().getAnnotation(SpecTest.class);
METHOD type=test.testMethod();
switch (type) {
case AUTOMATED:
assertionResource.addProperty(Earl.mode,Earl.automatic);
break;
case MANUAL:
assertionResource.addProperty(Earl.mode,Earl.manual);
break;
case INDIRECT:
assertionResource.addProperty(Earl.mode,Earl.automatic);
break;
default :
assertionResource.addProperty(Earl.mode,Earl.notTested);
break;
}
}
assertionResource.addProperty(Earl.assertedBy,assertorResource);
assertionResource.addLiteral(ranAsClass,result.getTestClass().getRealClass().getSimpleName());
resultResource.addProperty(DCTerms.date,model.createTypedLiteral(GregorianCalendar.getInstance()));
assertionResource.addProperty(Earl.testResult,resultResource);
}