From 6c5ac5247520d07aff17cd2b83362bc3a1c92c94 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Mon, 12 Apr 2021 17:49:36 +0300 Subject: [PATCH] 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 --- .../junit_rt/src/com/intellij/junit4/JUnit4TestListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestListener.java b/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestListener.java index 4e4532161d9c..0405f527be03 100644 --- a/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestListener.java +++ b/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestListener.java @@ -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()) +