Code example for ListeningExecutorService

Methods: shutdown

0
        executor = listeningDecorator(newCachedThreadPool());
    } 
 
    @After 
    public void tearDown() { 
        executor.shutdown();
    } 
 
    @Test(expected = IllegalStateException.class)
    public void notStarted() throws ExecutionException, InterruptedException {
        ManagementOperation<Integer> op = ManagementOperation.done("test", 42);
        assertTrue(op.isDone());
        assertEquals(42, (int) op.get());
        sameThreadExecutor().execute(op);
    } 
 
    @Test
    public void succeeded() throws InterruptedException, ExecutionException, TimeoutException {
        ManagementOperation<Long> op = newManagementOperation("test", new Callable<Long>() {
            @Override