ProductionServiceImpl extends Observable implements ProductionService { @Override public void close() throws ProductionException { try { try { stagingService.close(); executorService.shutdown(); } finally { try { processingService.close(); } finally { productionStore.close(); } } } catch (Exception e) { throw new ProductionException("Failed to close production service: " + e.getMessage(), e); } } ProductionServiceImpl(FileSystemService fileSystemService,
                                 ProcessingService processingService,
                                 StagingService stagingService,
                                 ProductionStore productionStore,
                                 ProductionType... productionTypes); @Override ProcessingService getProcessingService(); @Override BundleDescriptor[] getBundles(String username, BundleFilter filter); @Override MaskDescriptor[] getMasks(String userName); @Override synchronized Production[] getProductions(String filter); @Override Production getProduction(String id); @Override ProductionResponse orderProduction(ProductionRequest productionRequest); @Override ProductionResponse orderProduction(ProductionRequest productionRequest, HadoopJobHook jobHook); @Override synchronized void stageProductions(String... productionIds); @Override synchronized void scpProduction(final String productionId, final String scpPath); @Override void cancelProductions(String... productionIds); @Override void deleteProductions(String... productionIds); @Override synchronized void updateStatuses(String username); @Override void close(); @Override synchronized void setChanged(); @Override String[][] loadRegionDataInfo(String username, String url); @Override void invalidateBundleCache();  }
@Test public void testClose() throws Exception { assertEquals(false, stagingServiceMock.isClosed()); assertEquals(false, processingServiceMock.isClosed()); assertEquals(false, productionStoreMock.isClosed()); productionServiceUnderTest.close(); assertEquals(true, stagingServiceMock.isClosed()); assertEquals(true, processingServiceMock.isClosed()); assertEquals(true, productionStoreMock.isClosed()); }