* Called when an atomic test is about to be started. ("Number of tests executed : " + result.getRunCount()) Public void testRunFinished(Result result) throws ("Number of tests to execute : " + description.testCount()) Public void testRunStarted(Description description) throws Public class ExecutionListener extends RunListener We are free to override any number of methods RunListener class from including no method at all. This listener will extend the RunListener class provided by JUnit. Public class TestFeatureTwo void void testSecondFeatureIngored() Public class TestFeatureOne void testFirstFeature() We will monitor the logs printed for tests written in these classes. We are writing two test classes below for example only. This listener can be used for various purposes from improved logging to test specific logic. JUnit also provide support for adding listeners while executing the tests via RunListener class. For example, we add listeners to add specific logs, handle UI events in Java GUI programming etc. Listeners, in general, helps in listening the events on which we are interested.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |