Package com.google.common.util.concurrent

Examples of com.google.common.util.concurrent.ListeningExecutorService.shutdownNow()


      getTaskFuture.get();
      assertEquals(1, umbilical.getTaskInvocations);

    } finally {
      executor.shutdownNow();
    }
  }

  // Potential new tests
  // Different states - initialization failure, close failure
View Full Code Here


      }
    } catch (Throwable t) {
      t.printStackTrace();
      failedCallables.addAll((List) callablesToRun);
    } finally {
      es.shutdownNow();
    }
  }

  synchronized private void startReadyJobs() {
    Map<Integer, CrunchControlledJob> oldJobs = null;
View Full Code Here

         }
         fail("Did not throw TimeoutException");
      } catch (TimeoutException te) {
         // expected
      } finally {
         userExecutor.shutdownNow();
      }
   }
}
View Full Code Here

      Closer closer = i.getInstance(Closer.class);
      ListeningExecutorService executor = createMock(ListeningExecutorService.class);
      ExecutorServiceModule.shutdownOnClose(executor, closer);

      expect(executor.shutdownNow()).andReturn(ImmutableList.<Runnable> of()).atLeastOnce();

      replay(executor);
      closer.close();

      verify(executor);
View Full Code Here

            assertEquals(response.getError(), "");
            assertEquals(response.getOutput().trim(), "localhost".equals(sshHost) ? InetAddress.getLocalHost().getHostName()
                     : sshHost);
         }
      } finally {
         userExecutor.shutdownNow();
         client.disconnect();
      }
   }
  
   @Test
View Full Code Here

         "http://mock");

   public void testApiClosesExecutorServiceOnClose() throws IOException {
      ListeningExecutorService executor = createMock(ListeningExecutorService.class);

      expect(executor.shutdownNow()).andReturn(ImmutableList.<Runnable> of()).atLeastOnce();

      replay(executor);

      DelegatingApi api = ContextBuilder.newBuilder(provider)
                                        .modules(ImmutableSet.<Module> builder()
View Full Code Here

      Closer closer = i.getInstance(Closer.class);
      ListeningExecutorService executor = createMock(ListeningExecutorService.class);
      ExecutorServiceModule.shutdownOnClose(executor, closer);

      expect(executor.shutdownNow()).andReturn(ImmutableList.<Runnable> of()).atLeastOnce();

      replay(executor);
      closer.close();

      verify(executor);
View Full Code Here

         "http://mock");

   public void testApiClosesExecutorServiceOnClose() throws IOException {
      ListeningExecutorService executor = createMock(ListeningExecutorService.class);

      expect(executor.shutdownNow()).andReturn(ImmutableList.<Runnable> of()).atLeastOnce();

      replay(executor);

      DelegatingApi api = ContextBuilder.newBuilder(provider)
                                        .modules(ImmutableSet.<Module> builder()
View Full Code Here

         "http://mock");

   public void testApiClosesExecutorServiceOnClose() throws IOException {
      ListeningExecutorService executor = createMock(ListeningExecutorService.class);

      expect(executor.shutdownNow()).andReturn(ImmutableList.<Runnable> of()).atLeastOnce();

      replay(executor);

      DelegatingApi api = ContextBuilder.newBuilder(provider)
                                        .modules(ImmutableSet.<Module> builder()
View Full Code Here

         }
         fail("Did not throw TimeoutException");
      } catch (TimeoutException te) {
         // expected
      } finally {
         userExecutor.shutdownNow();
      }
   }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.