boolean (List<String> parentsHierarchy, ExposedTestResult result, boolean provideLocation) { int idx = 0; String currentClass; String currentParent; while (idx < myCurrentSuites.size() && idx < parentsHierarchy.size()) { currentClass = myCurrentSuites.get(idx); currentParent =parentsHierarchy.get(parentsHierarchy.size() - 1 - idx); if (!currentClass.equals(getShortName(currentParent))) break; idx++; } for (int i = myCurrentSuites.size() - 1; i >= idx; i--) { currentClass = myCurrentSuites.remove(i); myPrintStream.println("##teamcity[testSuiteFinished name='" + escapeName(currentClass) + "']"); } for (int i = idx; i < parentsHierarchy.size(); i++) { String fqName = parentsHierarchy.get(parentsHierarchy.size() - 1 - i); String currentClassName = getShortName(fqName); String location = "java:suite://" + escapeName(fqName); if (result != null) { final String testName = result.getXmlTestName(); if (fqName.equals(testName)) { final String fileName = result.getFileName(); if (fileName != null) { location = "file://" + fileName; } } } myPrintStream.println("##teamcity[testSuiteStarted name ='" + escapeName(currentClassName) + (provideLocation ? "' locationHint = '" + location : "") + "']"); myCurrentSuites.add(currentClassName); } return false; }