I have a slightly complicated test structure so bear with me,
I have a series of testng test cases and during each I collect some data about the test( not directly b
You can in general do one of the following:
1) By making the main Thread wait for another Thread using
Thread.join();
2) Making the another Thread as Non Daemon or a user thread:link
Thread.setDaemon(false);
The Java Virtual Machine exits when the only threads running are all daemon threads.This method must be called before the thread is started.