junit: don't send one-node tree to avoid confusions ala @Unroll (IDEA-146619)

This commit is contained in:
Anna Kozlova
2015-10-27 19:35:24 +01:00
parent 772c519a1e
commit ca76f15df5
2 changed files with 7 additions and 10 deletions
@@ -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");
}
@@ -423,7 +422,6 @@ public class JUnitTreeByDescriptionHierarchyTest {
final Description rootDescription = Description.createTestDescription("TestA", "testName");
doTest(rootDescription, Collections.singletonList(rootDescription),
"##teamcity[enteredTheMatrix]\n" +
"##teamcity[suiteTreeNode name='TestA.testName' locationHint='java:test://TestA.testName']\n" +
"##teamcity[treeEnded]\n",
"##teamcity[rootName name = 'TestA' location = 'java:suite://TestA']\n" +
"##teamcity[testStarted name='TestA.testName' locationHint='java:test://TestA.testName']\n" +
@@ -325,15 +325,14 @@ public class JUnit4TestListener extends RunListener {
String className = JUnit4ReflectionUtil.getClassName(description);
if (description.getChildren().isEmpty()) {
final String methodName = getFullMethodName((Description)description, parent);
if (methodName != null) {
if (parent != null) {
List parents = (List)myParents.get(description);
if (parents == null) {
parents = new ArrayList(1);
myParents.put(description, parents);
}
parents.add(pParents);
if (methodName != null && parent != null) {
List parents = (List)myParents.get(description);
if (parents == null) {
parents = new ArrayList(1);
myParents.put(description, parents);
}
parents.add(pParents);
if (isWarning(methodName, className)) {
className = JUnit4ReflectionUtil.getClassName(parent);
}