MI-153 Avoid showing "null" as a test root node description

When running several JUnit test suites at once, the root node description is shown as "null", because that's what `org.junit.runners.model.TestClass.getName` returns when `clazz == null`.

Let's not send a custom root node description in such case, and instead show the default "Test Results" label.

GitOrigin-RevId: d1b78f795be700da19804fb2695df8d6245a8c26
This commit is contained in:
Egor Zhdan
2021-04-12 15:42:04 +00:00
committed by intellij-monorepo-bot
parent 04bff6a265
commit 6c5ac52475
@@ -61,7 +61,7 @@ public class JUnit4TestListener extends RunListener {
@Override
public void testRunStarted(Description description) {
if (myRootName != null && !myRootName.startsWith("[")) {
if (myRootName != null && !myRootName.equals("null") && !myRootName.startsWith("[")) {
JUnitTestTreeNodeManager.TestNodePresentation rootNodePresentation = NODE_NAMES_MANAGER.getRootNodePresentation(myRootName);
myPrintStream.println("##teamcity[rootName name = '" + escapeName(rootNodePresentation.getName()) +