• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package test.thread;
2 
3 import org.testng.annotations.Test;
4 
5 public class ThreadPoolSampleBugTest {
6   private static final long TIMEOUT = 500;
7 
8   @Test(invocationCount = 1, threadPoolSize = 5)
shouldPass1()9   public void shouldPass1() throws InterruptedException {
10     Thread.sleep(TIMEOUT);
11   }
12 
13   @Test(invocationCount = 2, threadPoolSize = 5)
shouldPass2()14   public void shouldPass2() throws InterruptedException {
15     Thread.sleep(TIMEOUT);
16   }
17 
18   @Test(timeOut = 10, invocationCount = 1, threadPoolSize = 5)
shouldFail1()19   public void shouldFail1() throws InterruptedException {
20     Thread.sleep(TIMEOUT);
21   }
22 
23   @Test(timeOut = 10, invocationCount = 2, threadPoolSize = 5)
shouldFail2()24   public void shouldFail2() throws InterruptedException {
25     Thread.sleep(TIMEOUT);
26   }
27 }
28