Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import org.testng.annotations.Test;
  2.  
  3. public class TestNGThreadTest
  4. {
  5. public int count = 0;
  6.  
  7. @Test
  8. public void test1() throws InterruptedException
  9. {
  10. count++;
  11. Thread.sleep(1000);
  12. System.out.println(count + " " + Thread.currentThread().getThreadGroup() + Thread.currentThread().getName() + Thread.currentThread().getId());
  13. }
  14.  
  15. @Test
  16. public void test2() throws InterruptedException
  17. {
  18. Thread.sleep(1000);
  19. count++;
  20.  
  21. System.out.println(count + " " + Thread.currentThread().getThreadGroup() + Thread.currentThread().getName() + Thread.currentThread().getId());
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement