You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
although I think this approach can be problematic and potentially deadlock when there are other shutdown hooks added by the system under test. For that reason I'm hesitant to add such a feature into Acai proper until there is a more reliable mechanism provided in JUnit that it could be built upon.
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.The text was updated successfully, but these errors were encountered: