Skip to content

Add verification that framework object references have been released

Choose a tag to compare

@sbabcoc sbabcoc released this 24 Jun 19:35
· 73 commits to master since this release

This release is a follow-up to previous work that added management of stored references to JUnit framework objects. The unit test collection now verifies that these references are released within the scope where they should be. To maintain the encapsulation of the underlying collections, the test implementation accesses these collections via Java reflection. This necessarily results in tight coupling between the API implementation and the corresponding tests, which is perhaps a good thing in this context.

  • I revised the behavior of AtomicTest.isTest() to check the attached annotations, instead of relying on the isTest() method of the wrapped Description object. The documentation for the latter states that this method indicates whether the represented method is an "atomic test", but in actuality only indicates that the described framework object has no children.
  • I dug deeper into the weird world of JUnitParams, implementing a more comprehensive augmentation of the incomplete Description objects it creates.
  • I added code to recover from the NullPointerException thrown from within the guts of JUnitParams if you ask it to describe a configuration method (@​BeforeClass, @​Before, @​After, or @​AfterClass).
  • I expanded the scope that will be searched for attached run listeners, enabling clients to access listeners that are attached directly to the run notifier.
  • I also resolved the warnings that were reported by the Sonatype Lift static analysis tool.