I have a weird question. If I get somehow stuck in my tests, I have to terminate them. But still I need to destroy a background process. Meaning I need some method that is called on the jUnit termination to override. Afterclass method or Finalize aren't it. Is there somethin开发者_StackOverflow中文版g?
No, when you terminate a JVM there's not much you can do to react. Depending on how you stop it, shutdown hooks may or may not run, but that's pretty much your only chance.
精彩评论