I am writing automated tests for a Swing application using Jemmy framework.
My test suite run this application by invoking the main method of its Main class in a new thread.
I have already written a lot of GUI-related tests but now I have got a more complex task.
I need to check if the tested application does some clean up of folders when it is being closed. This action is probably executed as a shutdown hook. Is it somehow possible to invoke shutdown hooks of that application without calling System.exit(0)?
When this command is called both threads will be terminated. But I want the thread with my tests to continue running after the tested application is closed so I can check if those folders still exist or not. Is it somehow possible to invoke the shutdown hooks without changing the architecture of my test suite?