When we have a FlexUnit 4 test that uses:
[RunWith("org.flexunit.runners.Parameterized")]
...Flex Mojos stops listening to test results in the middle of a test
and returns incomplete results.Rummaging around the source, this seems to be because org.sonatype.flexmojos.unitestingsupport.flexunit4.FlexUnit4Listener counts the number of functions with [Test] metadata and, during the course of the tests, the SocketReporter will send the results back and terminate when the number of tests that have been run equals the number of counted [Test]s. This is a great assumption for the default test runner, but with the Parameterized test runner, some test functions will get run multiple times if they have [Datapoints], and as such the test counts will get out of sync and early termination will occur. I've bodged around this problem by making FlexUnit4Listener.run return int.MAX_VALUE for the number of tests, and then in testRunFinished I'm doing _socketReporter.totalTestCount = _socketReporter.numTestsRun. A "proper" fix to this issue would query custom test runners for the number of tests that they intend to run, but from a cursory glance this doesn't seem possible. Maybe there should be a special case when any [RunWith] metadata is encountered? Should I file a bug for this issue? Thanks, Stephen -- You received this message because you are subscribed to the Google Groups "Flex Mojos" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex-mojos http://flexmojos.sonatype.org/
