}
}
private String getEventPath(TestDescriptor descriptor) {
List<String> names = Lists.newArrayList();
TestDescriptor current = descriptor;
while (current != null) {
if (isAtomicTestWhoseParentIsNotTheTestClass(current)) {
// This deals with the fact that in TestNG, there are no class-level events,
// but we nevertheless want to see the class name. We use "." rather than
// " > " as a separator to make it clear that the class is not a separate
// level. This matters when configuring granularity.
names.add(current.getClassName() + "." + current.getName());
} else {
names.add(current.getName());
}
current = current.getParent();
}
int effectiveDisplayGranularity = displayGranularity == -1
? names.size() - 1 : Math.min(displayGranularity, names.size() - 1);
List<String> displayedNames = Lists.reverse(names).subList(effectiveDisplayGranularity, names.size());