diff --git a/plugins/junit/test/com/intellij/execution/junit/JUnitTreeByDescriptionHierarchyTest.java b/plugins/junit/test/com/intellij/execution/junit/JUnitTreeByDescriptionHierarchyTest.java index aa3aa51e2a21..46830d4c8761 100644 --- a/plugins/junit/test/com/intellij/execution/junit/JUnitTreeByDescriptionHierarchyTest.java +++ b/plugins/junit/test/com/intellij/execution/junit/JUnitTreeByDescriptionHierarchyTest.java @@ -34,7 +34,6 @@ public class JUnitTreeByDescriptionHierarchyTest { @Test public void testEmptySuite() throws Exception { doTest(Description.createSuiteDescription("empty suite"), "##teamcity[enteredTheMatrix]\n" + - "##teamcity[suiteTreeNode name='empty suite' locationHint='java:test://empty suite.empty suite']\n" + "##teamcity[treeEnded]\n"); } diff --git a/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestListener.java b/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestListener.java index 0f668d99287d..aa5ff995547d 100644 --- a/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestListener.java +++ b/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestListener.java @@ -306,6 +306,12 @@ public class JUnit4TestListener extends RunListener { } private String getFullMethodName(Description description, Description parent) { + return getFullMethodName(description, parent, false); + } + + private String getFullMethodName(Description description, + Description parent, + boolean acceptNull) { String methodName = (String)myMethodNames.get(description); if (methodName == null) { methodName = JUnit4ReflectionUtil.getMethodName(description); @@ -313,7 +319,7 @@ public class JUnit4TestListener extends RunListener { methodName = getShortName(JUnit4ReflectionUtil.getClassName(description)) + "." + methodName; } - if (methodName == null && description.getChildren().isEmpty()) { + if (!acceptNull && methodName == null && description.getChildren().isEmpty()) { methodName = getShortName(description.getDisplayName()); } @@ -463,7 +469,7 @@ public class JUnit4TestListener extends RunListener { String className = JUnit4ReflectionUtil.getClassName(description); if (description.isTest()) { - final String methodName = getFullMethodName((Description)description, parent); + final String methodName = getFullMethodName((Description)description, parent, true); if (methodName != null ) { if (isWarning(methodName, className) && parent != null) { className = JUnit4ReflectionUtil.getClassName(parent);