Browse Source

bz-64952 junitlauncher - properly report JUnit4 Parametrized test, in the XML report

Closes #125 pull request at github/apache/ant repo
master
Gösen Jaikiran Pai 5 years ago
parent
commit
dee3715270
4 changed files with 15 additions and 1 deletions
  1. +1
    -0
      CONTRIBUTORS
  2. +4
    -0
      WHATSNEW
  3. +4
    -0
      contributors.xml
  4. +6
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LegacyXmlResultFormatter.java

+ 1
- 0
CONTRIBUTORS View File

@@ -158,6 +158,7 @@ Gilles Querret
Gilles Scokart
Glenn McAllister
Glenn Twiggs
Gösen
Greg Nelson
Greg Roodt
Greg Schueler


+ 4
- 0
WHATSNEW View File

@@ -19,6 +19,10 @@ Fixed bugs:
and system-out
Bugzilla Report 63436

* Fixes a bug in junitlauncher task's legacy-xml formatter, where the testcase
representing a @Parameterized JUnit4 test wasn't being reported in the XML.
Bugzilla Report 64952

Other changes:
--------------



+ 4
- 0
contributors.xml View File

@@ -664,6 +664,10 @@
<first>Glenn</first>
<last>Twiggs</last>
</name>
<name>
<first>Gösen</first>
<last></last>
</name>
<name>
<first>Greg</first>
<last>Nelson</last>


+ 6
- 1
src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/LegacyXmlResultFormatter.java View File

@@ -407,9 +407,14 @@ class LegacyXmlResultFormatter extends AbstractJUnitResultFormatter implements T

private Optional<ClassSource> findFirstParentClassSource(final TestIdentifier testId) {
final Optional<TestIdentifier> parent = testPlan.getParent(testId);
if (!parent.isPresent() || !parent.get().getSource().isPresent()) {
if (!parent.isPresent()) {
return Optional.empty();
}
if (!parent.get().getSource().isPresent()) {
// the source of the parent is unknown, so we move up the
// hierarchy and try and find a class source
return findFirstParentClassSource(parent.get());
}
final TestSource parentSource = parent.get().getSource().get();
return parentSource instanceof ClassSource ? Optional.of((ClassSource) parentSource)
: findFirstParentClassSource(parent.get());


Loading…
Cancel
Save