carrotsearch/randomizedtesting — Issue #9: Context facility to track and dispose of test-scope resources
Author: dweiss
Created: 2011-11-02 10:54:59+00:00
State: open

There are numerous resources that require proper cleanup: scratch folders, sockets, connections... This can be done manually (finally blocks), via fields and @After hooks, whatever. It would be nice to have a facility to which such a resource could be registered and then it'd be automatically "closed" at the end of the lifecycle in which it was registered (test-scope or suite scope).

If closing fails, the test case (or suite) would also fail, signalling the stack trace and thread of where exactly the resource was registered.