I want to create a custom html report for a test run in JUnit. The problem is that you are freeing resources and closing tags after all tests have completed.
I keep one FileChannel open for writing to report. Since there should be a table with a row for each test, and there are hundreds of them, I do not want to open and close the channel for each test. The problem that appears here is the organization of the tests. I have nested packages, so testRunFinished is not an option (applies to a single set, not to all tests, and I saw this question ). TestWatcher will also not help me, since it refers to only one test.
Tools used: maven 3.0.5, ff webdriver, junit 4.11.
I considered two options: 1) open and close channel on each test run 2) rewrite finalize () to close the channel
None of them look pretty ... I have looked through many pages, but I do not have the same problem.
Any more beautiful solutions?
source
share