use of org.ff4j.audit.EventRejectedExecutionHandler in project ff4j by ff4j.
the class ExceptionsTest method testExceptionHandler.
@Test
public void testExceptionHandler() {
EventRejectedExecutionHandler ereh = new EventRejectedExecutionHandler();
final BlockingQueue<Runnable> queue = new ArrayBlockingQueue<Runnable>(2);
// Executor with worker to process threads
RejectedExecutionHandler rej = new EventRejectedExecutionHandler();
ThreadFactory tFactorty = new PublisherThreadFactory();
ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, queue, tFactorty, rej);
ereh.rejectedExecution(new Thread(), executor);
}
use of org.ff4j.audit.EventRejectedExecutionHandler in project ff4j by ff4j.
the class ExceptionsTest method testExceptionHandlerInterrupted.
@Test
public void testExceptionHandlerInterrupted() throws InterruptedException {
EventRejectedExecutionHandler.setMock(true);
EventRejectedExecutionHandler ereh = new EventRejectedExecutionHandler();
ereh.rejectedExecution(new Thread(), null);
EventRejectedExecutionHandler.setMock(false);
Assert.assertNotNull(ereh);
}
Aggregations