*/
@Test(groups = "functional", testName = "executors.BlockingTaskAwareExecutorServiceTest")
public class BlockingTaskAwareExecutorServiceTest extends AbstractInfinispanTest {
public void testSimpleExecution() throws Exception {
BlockingTaskAwareExecutorService executorService = createExecutorService();
try {
final DoSomething doSomething = new DoSomething();
executorService.execute(doSomething);
Thread.sleep(100);
assert !doSomething.isReady();
assert !doSomething.isExecuted();
doSomething.markReady();
executorService.checkForReadyTasks();
assert doSomething.isReady();
eventually(new Condition() {
@Override
public boolean isSatisfied() throws Exception {
return doSomething.isExecuted();
}
});
} finally {
executorService.shutdownNow();
}
}