void (Description description, Description parent, List<Description> currentParents) { List<Description> pParents = new ArrayList<>(3); pParents.addAll(currentParents); if (parent != null) { final String parentClassName = JUnit4ReflectionUtil.getClassName(parent); if (!myRootName.equals(parentClassName)) { pParents.add(0, parent); } } List<List<Description>> parents = myParents.get(description); if (parents == null) { parents = new ArrayList<>(1); myParents.put(description, parents); } parents.add(pParents); String className = JUnit4ReflectionUtil.getClassName(description); if (description.isTest()) { final String methodName = getFullMethodName(description, parent, true); if (methodName != null ) { if (isWarning(methodName, className) && parent != null) { className = JUnit4ReflectionUtil.getClassName(parent); } myPrintStream.println("##teamcity[suiteTreeNode name='" + escapeName(methodName.replaceFirst("/", ".")) + "' " + NODE_NAMES_MANAGER.getTestLocation(description, className, methodName) + "]"); } else { myPrintStream.println("##teamcity[suiteTreeStarted name='" + escapeName(getShortName(className)) + "' locationHint='java:suite://" + escapeName(className) + "']"); myPrintStream.println("##teamcity[suiteTreeEnded name='" + escapeName(getShortName(className)) + "']"); } return; } List<Description> tests = description.getChildren(); boolean pass = false; for (final Description nextDescription : tests) { if ((myRootName == null || !myRootName.equals(className)) && !pass) { pass = true; myPrintStream.println("##teamcity[suiteTreeStarted name='" + escapeName(getShortName(className)) + "'" + getSuiteLocation(description, nextDescription, className) + "]"); } sendTree(nextDescription, description, pParents); } if (pass) { myPrintStream.println( "##teamcity[suiteTreeEnded name='" + escapeName(getShortName(JUnit4ReflectionUtil.getClassName(description))) + "']"); } }