On Thu, 2004-10-14 at 05:12, Stefan Bodewig wrote: > If there is a way to predict the number of tests before running them, > we could extend JUnitTest to hold that information and your new > formatter could capture it in startTestSuite.
junit.swingui.TestRunner uses junit.framework.Test.countTestCases() to set the total test number. TestSuite.countTestCases() iterates over its list of tests (which might contain other suites), so a complete count could be made available to startTestSuite(). There are two problems I found with a custom formatter approach: first, JUnitTestRunner buffers all formatter output until all tests are run, so that the test counter does nothing for a long time and then goes immediately to 100%. Second, NetBeans supports any ant scripts, so we don't want to modify their scripts to add our formatter attribute. We just want to listen to JUnit execution without disturbing anything. Currently I'm working on having JUnitTestRunner print TestListener event messages as text to stdout, which get logged and filtered out by JUnitTask's output redirectors. This approach is less intrusive than it sounds, and so far appears to work for both in-process and forked without any changes to either the task's output or any formatters (since they see the same stream as before). I also "fire" an initial test-count event, which gets logged and filtered like the others. I want to test this thoroughly before submitting an enhancement request and suggested patch, of course. Thanks for your help, Tom --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]