use of org.apache.apex.malhar.lib.appdata.ThreadUtils.ExceptionSaverExceptionHandler in project apex-malhar by apache.
the class SimpleDoneQueryQueueManagerTest method simpleExpireBlockThenUnblock.
@Test
public void simpleExpireBlockThenUnblock() throws Exception {
SimpleDoneQueueManager<Query, Void> sdqqm = new SimpleDoneQueueManager<Query, Void>();
sdqqm.setup(null);
sdqqm.beginWindow(0);
Query query = new MockQuery("1");
MutableBoolean expire = new MutableBoolean(false);
sdqqm.enqueue(query, null, expire);
sdqqm.endWindow();
sdqqm.beginWindow(1);
// Expire
expire.setValue(true);
ExceptionSaverExceptionHandler eseh = new ExceptionSaverExceptionHandler();
testBlockingNoStop(sdqqm, eseh);
query = new MockQuery("2");
sdqqm.enqueue(query, null, new MutableBoolean(false));
Thread.sleep(1000);
Assert.assertNull(eseh.getCaughtThrowable());
sdqqm.endWindow();
sdqqm.teardown();
}
Aggregations