Description
Currently TestingService classes can provide a @BeforeSuite
method but there is no corresponding @AfterSuite
. This means if you start a bunch of services in the @BeforeSuite
method there is no easy way to stop them when you are done testing.
One work around is to attach a JVM shutdown hook in your @BeforeSuite
method but this is a bit ugly.
RunListener#testRunFinished in JUnit is basically what we need but a RunListener can only be attached via JUnitCore which would mean forcing users to implement their own main method or use one we provide. That seems much too intrusive.
The proposal in junit-team/junit4#874 may be useful in implementing this but we would need something that could attach the listener while still only requiring the user to add one thing to their tests. Telling people to add the Acai @Rule
and also to register a listener for things to work correctly would be too onerous. Probably Acai could be implemented as a listener rather than a rule.