Extending JUnit4 using a custom Runner
"Anirudh Chandrakant" <[email protected]> Wed, 6 Aug 2008 21:35:44 +0530
| Newsgroups | gmane.comp.java.junit.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello, I am new to this group and the following questions might have been discussed before - however, i was unable to search the archives of this mailing list. I am attempting to extend JUnit4. I have done a couple of things - i have extended RunListener and overridden some methods and i have extended TestClassRunner and created a custom runner to register my listener. My questions follow: 1. Is this the right way to hook into the events framework? After searching online and reading many articles, i tend to believe so. However, i would like to confirm. 2. I never get a callback to testRunStarted and testRunFinished. Even when i debugged through JUnit code, i do not see a code flow that calls these methods. Am i missing something? I would like some action to take place at the end of all the tests. How do i achieve this? 3. I use the internal method notifier.addListener(). Even though this works, i dont feel good using an internal method. Is there any other way to achieve this? Ditto while extending TestClassRunner. Any alternate ways will be helpful. Looking for these answers using Google provided very little information. Any help will be appreciated. Cheers, Anirudh ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Junit-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/junit-devel