I want to create custom html report for test run in JUnit. Problem I have is releasing resources and closing tags after all tests are done.
I keep one FileChannel opened for writing to report. Since it should be table with row for each test and there are hundreds of them, I don't want to open and close the channel for each test. Problem that appears here is tests organization - I have nested suites, so testRunFinished is not an option (refers to single suite, not all tests, and I saw this question). TestWatcher also will not help me, since it refers to single test only.
Tools used: maven 3.0.5, ff webdriver, junit 4.11.
I was considering two options: 1) opening and closing channel on each test run 2) overwriting finalize() to make it close the channel
None of them seems pretty... I've searched through many pages, but nobody seems to have the same problem I have.
Any prettier solutions?