|
|
@@ -407,9 +407,14 @@ class LegacyXmlResultFormatter extends AbstractJUnitResultFormatter implements T |
|
|
|
|
|
|
|
private Optional<ClassSource> findFirstParentClassSource(final TestIdentifier testId) { |
|
|
|
final Optional<TestIdentifier> parent = testPlan.getParent(testId); |
|
|
|
if (!parent.isPresent() || !parent.get().getSource().isPresent()) { |
|
|
|
if (!parent.isPresent()) { |
|
|
|
return Optional.empty(); |
|
|
|
} |
|
|
|
if (!parent.get().getSource().isPresent()) { |
|
|
|
// the source of the parent is unknown, so we move up the |
|
|
|
// hierarchy and try and find a class source |
|
|
|
return findFirstParentClassSource(parent.get()); |
|
|
|
} |
|
|
|
final TestSource parentSource = parent.get().getSource().get(); |
|
|
|
return parentSource instanceof ClassSource ? Optional.of((ClassSource) parentSource) |
|
|
|
: findFirstParentClassSource(parent.get()); |
|
|
|