https://bz.apache.org/bugzilla/show_bug.cgi?id=63446

            Bug ID: 63446
           Summary: JUnitLauncher Task with <testclasses> and <fork> will
                    create a listener per testcase wrongly
           Product: Ant
           Version: 1.10.6
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Optional Tasks
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

When using the following task

<junitlauncher>
    <testclasses outputdir="output_dir">
        <zipfileset src="tests.jar">
            <include name="**/*Test.class"/>
        </zipfileset>
        <listener type="legacy-xml" sendSysOut="true" sendSysErr="true" />
        <fork includeJUnitPlatformLibraries="false">
           <!-- jvm args -->
        </fork>
    </testclasses>
    <classpath>
        <fileset file="tests.jar" />
    </classpath>
</junitlauncher>

the LegacyXmlResultFormatter will be created and executed as often as tests are
found by testclasses/zipfileset. 
This results in crappy xml-files because they will be overridden multiple times
and can have endings like "</testsuite>e>e>" because it happens in parallel.

E.g. if zipfileset finds 100 Test Classes, for each test class 100
LegacyXmlResultFormatter instances are created and executed. 
If zipfileset finds 10 Test Classes, for each test class 10
LegacyXmlResultFormatter instances are created and executed.

This is wrong, there should be only 1 LegacyXmlResultFormatter instance created
per test class.

The bug happens in
org.apache.tools.ant.taskdefs.optional.junitlauncher.confined.TestClasses.fromForkedRepresentation(XMLStreamReader)
where 1 testDefinition is created for all found tests.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to