Created
October 1, 2019 21:49
-
-
Save sauceaaron/8cd7ebb7a4add3f9dfbf6aff1e68f68e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.testng.annotations.Test; | |
| public class TestNGThreadTest | |
| { | |
| public int count = 0; | |
| @Test | |
| public void test1() throws InterruptedException | |
| { | |
| count++; | |
| Thread.sleep(1000); | |
| System.out.println(count + " " + Thread.currentThread().getThreadGroup() + Thread.currentThread().getName() + Thread.currentThread().getId()); | |
| } | |
| @Test | |
| public void test2() throws InterruptedException | |
| { | |
| Thread.sleep(1000); | |
| count++; | |
| System.out.println(count + " " + Thread.currentThread().getThreadGroup() + Thread.currentThread().getName() + Thread.currentThread().getId()); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment