From: SourceForge.net <no...@so...> - 2008-08-11 20:12:10
|
Bugs item #1918179, was opened at 2008-03-18 09:42 Message generated for change (Comment added) made by dsaff You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115278&aid=1918179&group_id=15278 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Pending Resolution: None Priority: 5 Private: No Submitted By: Cees Bos (cbos_ec) Assigned to: Nobody/Anonymous (nobody) Summary: testRunFinished not called in JUnit3.8 support mode Initial Comment: When running in the old mode, the notifier is not called correct. The 'testRunFinished' method is not called on the notifier. public void testRunFinished(Result result) throws Exception { } When I run JUnit in ANT the junit.framework.JUnit4TestAdapter is used by ANT. At that moment at the end the testRunFinished method is not called on the notifier, so also not received in the listeners. ---------------------------------------------------------------------- >Comment By: David Saff (dsaff) Date: 2008-08-11 16:12 Message: Logged In: YES user_id=325156 Originator: NO What version of ant are you using? ---------------------------------------------------------------------- Comment By: Cees Bos (cbos_ec) Date: 2008-03-19 10:13 Message: Logged In: YES user_id=2039588 Originator: YES I think the implementation of run in JUnit4TestAdapter should be like this: public void run(TestResult finalResult) { RunNotifier notifier = fCache.getNotifier(finalResult, this); Result result= new Result(); RunListener listener= result.createListener(); notifier.addFirstListener(listener); try { notifier.fireTestRunStarted(fRunner.getDescription()); fRunner.run(notifier); notifier.fireTestRunFinished(result); } finally { notifier.removeListener(listener); } } This is similar to how org.junit.runner.JUnitCore does the execution. It is also possible to do the execution via JUnitCore directly, that save duplication. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=115278&aid=1918179&group_id=15278 |