1. import org.testng.ITestResult;
  2. //it contains the threadlocal instance with test results
  3. public class TestResultThreadLocal {
  4. private static final ThreadLocal<ITestResult> results = new ThreadLocal<ITestResult>();
  5. public static void set(ITestResult result)
  6. {
  7. results.set(result);
  8. }
  9. public static ITestResult get()
  10. {
  11. return results.get();
  12. }
  13. }