Skip to content

Instantly share code, notes, and snippets.

@sauceaaron
Created October 1, 2019 21:51
Show Gist options
  • Save sauceaaron/b0e64199f41484e3e7ab30fcf419bc7e to your computer and use it in GitHub Desktop.
Save sauceaaron/b0e64199f41484e3e7ab30fcf419bc7e to your computer and use it in GitHub Desktop.
import org.junit.Test;
public class JUnitThreadTest
{
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
{
count++;
Thread.sleep(1000);
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