@Override public void complete() { final PipelineKey pipeline = selectPipelinePage.getPipeline(); Map<String, String> params = buildPipelineParams(); final String runtime = params.get(RUNTIME_NAME); runtimeService.call((Void aVoid) -> onPipelineStartSuccess(), popupHelper.getPopupErrorCallback()).createRuntime(provider.getKey(), runtime, pipeline, buildPipelineParams()); }
@Test public void testDeletePipelineConfirmNo() { preparePipelineDelete(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).deletePipelineExecution(any(PipelineExecutionTraceKey.class)); }
@Test public void testDeleteRuntimeConfirmNo() { prepareRuntimeDelete(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).deleteRuntime(any(RuntimeKey.class), anyBoolean()); }
@Test public void testStopPipelineConfirmNo() { preparePipelineStop(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).stopPipelineExecution(any(PipelineExecutionTraceKey.class)); }
@Test public void testStopRuntimeConfirmNo() { prepareRuntimeStop(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).stopRuntime(any(RuntimeKey.class)); }
@Test public void testStartRuntime() { ProviderKey providerKey = mock(ProviderKey.class); RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID); service.startRuntime(runtimeKey); verify(runtimeProvisioningService, times(1)).startRuntime(RUNTIME_ID); verify(runtimeChangeEvent, times(1)).fire(new RuntimeChangeEvent(RuntimeChange.STARTED, runtimeKey)); }
protected void onAddNewRuntime(@Observes final AddNewRuntimeEvent event) { if (event.getProvider() != null) { runtimeService.call((Collection<PipelineKey> result) -> { newDeployWizard.start(event.getProvider(), result); }).getPipelines(event.getProvider().getKey().getProviderTypeKey()); } }
protected void refresh(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { runtimeService.call(getLoadItemSuccessCallback(), getDefaultErrorCallback()).getRuntimeItem(pipelineExecutionTraceKey); }
@Override public boolean hasRuntimes(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); return !runtimeService.getRuntimeItems(providerKey).isEmpty(); } }
@Test public void testStopPipelineConfirmNo() { preparePipelineStop(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).stopPipelineExecution(any(PipelineExecutionTraceKey.class)); }
@Test public void testStopRuntimeConfirmNo() { prepareRuntimeStop(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).stopRuntime(any(RuntimeKey.class)); }
@Test public void testStartRuntime() { ProviderKey providerKey = mock(ProviderKey.class); RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID); service.startRuntime(runtimeKey); verify(runtimeProvisioningService, times(1)).startRuntime(RUNTIME_ID); verify(runtimeChangeEvent, times(1)).fire(new RuntimeChangeEvent(RuntimeChange.STARTED, runtimeKey)); }
@Test public void testGetPipelines() { ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION); when(pipelineService.getPipelineNames(any(org.guvnor.ala.runtime.providers.ProviderType.class), anyInt(), anyInt(), anyString(), anyBoolean())).thenReturn(pipelineNames); Collection<PipelineKey> result = service.getPipelines(providerTypeKey); assertEquals(pipelineKeys, result); }
protected void refresh(final RuntimeKey runtimeKey) { runtimeService.call(getLoadItemSuccessCallback(), getDefaultErrorCallback()).getRuntimeItem(runtimeKey); }
@Override public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final Provider provider = providerService.getProvider(providerKey); if (provider == null) { return null; } final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey); return new RuntimesInfo(provider, items); }
private void testDeleteRuntime(boolean forced) { ProviderKey providerKey = mock(ProviderKey.class); RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID); service.deleteRuntime(runtimeKey, forced); verify(runtimeProvisioningService, times(1)).destroyRuntime(RUNTIME_ID, forced); verify(runtimeChangeEvent, times(1)).fire(new RuntimeChangeEvent(RuntimeChange.DELETED, runtimeKey)); }
@Override public void complete() { final PipelineKey pipeline = selectPipelinePage.getPipeline(); Map<String, String> params = buildPipelineParams(); final String runtime = params.get(RUNTIME_NAME); runtimeService.call((Void aVoid) -> onPipelineStartSuccess(), popupHelper.getPopupErrorCallback()).createRuntime(provider.getKey(), runtime, pipeline, buildPipelineParams()); }
@Test public void testStopPipelineConfirmYesAndFailed() { preparePipelineStop(); PipelineExecutionTraceKey currentKey = trace.getKey(); doThrow(new RuntimeException(ERROR_MESSAGE)) .when(runtimeService) .stopPipelineExecution(currentKey); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).stopPipelineExecution(currentKey); verify(defaultErrorCallback, times(1)).error(any(Message.class), exceptionCaptor.capture()); assertEquals(ERROR_MESSAGE, exceptionCaptor.getValue().getMessage()); }
@Test public void testStopRuntime() { ProviderKey providerKey = mock(ProviderKey.class); RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID); service.stopRuntime(runtimeKey); verify(runtimeProvisioningService, times(1)).stopRuntime(RUNTIME_ID); verify(runtimeChangeEvent, times(1)).fire(new RuntimeChangeEvent(RuntimeChange.STOPPED, runtimeKey)); }
@Test public void testDeletePipelineConfirmNo() { preparePipelineDelete(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).deletePipelineExecution(any(PipelineExecutionTraceKey.class)); }