@Test public void testCancelProductions() throws ProductionException, IOException { productionServiceUnderTest.orderProduction(new ProductionRequest("test", "ewa")); productionServiceUnderTest.orderProduction(new ProductionRequest("test", "ewa")); productionServiceUnderTest.orderProduction(new ProductionRequest("test", "ewa")); productionServiceUnderTest.orderProduction(new ProductionRequest("test", "ewa")); processingServiceMock.setJobStatus("job_1_1", new ProcessStatus(ProcessState.SCHEDULED)); processingServiceMock.setJobStatus("job_1_2", new ProcessStatus(ProcessState.RUNNING)); processingServiceMock.setJobStatus("job_2_1", new ProcessStatus(ProcessState.COMPLETED)); processingServiceMock.setJobStatus("job_2_2", new ProcessStatus(ProcessState.COMPLETED)); processingServiceMock.setJobStatus("job_3_1", new ProcessStatus(ProcessState.RUNNING)); processingServiceMock.setJobStatus("job_3_2", new ProcessStatus(ProcessState.COMPLETED)); processingServiceMock.setJobStatus("job_4_1", new ProcessStatus(ProcessState.RUNNING)); processingServiceMock.setJobStatus("job_4_2", new ProcessStatus(ProcessState.RUNNING)); productionServiceUnderTest.updateStatuses("ewa"); Production[] productions = productionServiceUnderTest.getProductions(null); assertNotNull(productions); assertEquals(4, productions.length); assertEquals(ProcessState.RUNNING, productions[0].getProcessingStatus().getState()); assertEquals(ProcessState.COMPLETED, productions[1].getProcessingStatus().getState()); assertEquals(ProcessState.RUNNING, productions[2].getProcessingStatus().getState()); assertEquals(ProcessState.RUNNING, productions[3].getProcessingStatus().getState()); productionServiceUnderTest.cancelProductions("id_1", "id_2", "id_4"); productionServiceUnderTest.updateStatuses("ewa"); productions = productionServiceUnderTest.getProductions(null); assertNotNull(productions); assertEquals(4, productions.length); assertEquals(ProcessState.CANCELLED, productions[0].getProcessingStatus().getState()); assertEquals(ProcessState.COMPLETED, productions[1].getProcessingStatus().getState()); assertEquals(ProcessState.RUNNING, productions[2].getProcessingStatus().getState()); assertEquals(ProcessState.CANCELLED, productions[3].getProcessingStatus().getState()); }
@Override public void cancelProductions(String... productionIds) throws ProductionException { requestProductionKill(productionIds, Action.CANCEL); }
ProductionServiceImpl extends Observable implements ProductionService { @Override public void cancelProductions(String... productionIds) throws ProductionException { requestProductionKill(productionIds, Action.CANCEL); } }
ProductionServiceImpl extends Observable implements ProductionService { @Override public void cancelProductions(String... productionIds) throws ProductionException { requestProductionKill(productionIds, Action.CANCEL); } ProductionServiceImpl(FileSystemService fileSystemService,
                                 ProcessingService processingService,
                                 StagingService stagingService,
                                 ProductionStore productionStore,
                                 ProductionType... productionTypes); }
ProductionServiceImpl extends Observable implements ProductionService { @Override public void cancelProductions(String... productionIds) throws ProductionException { requestProductionKill(productionIds, Action.CANCEL); } 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(); }
ProductionServiceImpl extends Observable implements ProductionService { @Override public void cancelProductions(String... productionIds) throws ProductionException { requestProductionKill(productionIds, Action.CANCEL); } 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();  }