Skip to content

Instantly share code, notes, and snippets.

@tadas-subonis
Created April 23, 2013 21:58
Show Gist options
  • Save tadas-subonis/5447772 to your computer and use it in GitHub Desktop.
Save tadas-subonis/5447772 to your computer and use it in GitHub Desktop.
private ThreadPoolExecutor threadPoolExecutor;
@BeforeMethod
void setUp() {
threadPoolExecutor = prepareThreadPoolExecutor();
}
@AfterMethod
void tearDown() throws InterruptedException {
threadPoolExecutor.shutdown();
while (!threadPoolExecutor.isTerminated()) {
Thread.sleep(20);
}
/*
* Clean up our threadpool
*/
assertTrue(threadPoolExecutor.awaitTermination(10, TimeUnit.SECONDS));
threadPoolExecutor = null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment