private boolean isFromCurrentPipeline(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { return item != null && !item.isRuntime() && item.getPipelineTrace().getKey().equals(pipelineExecutionTraceKey); }
private boolean isFromCurrentRuntime(final RuntimeKey runtimeKey) { return item != null && item.isRuntime() && item.getRuntime().getKey().equals(runtimeKey); }
private void setupPipelineTrace(RuntimeListItem item) { PipelineExecutionTrace trace = item.getPipelineTrace(); String itemLabel = item.getItemLabel(); String pipelineName = trace.getPipeline().getKey().getId(); String createdDate = ""; view.setup(itemLabel, createdDate, pipelineName); setupPipeline(trace); processPipelineStatus(trace.getPipelineStatus()); }
@Test public void testBuildRuntimeWithNoPipelineExecution() { prepareRuntime(); RuntimeListItem result = RuntimeListItemBuilder.newInstance().withItem(queryResultItem).build(); assertTrue(result.isRuntime()); assertNotNull(result.getRuntime()); assertNull(result.getPipelineTrace()); assertRuntime(result.getRuntime()); }
private RemoteCallback<Void> getDeleteRuntimeSuccessCallback() { return aVoid -> { popupHelper.hideBusyIndicator(); notification.fire(new NotificationEvent(translationService.format(RuntimePresenter_RuntimeDeleteSuccessMessage, item.getRuntime().getKey().getId()), NotificationEvent.NotificationType.SUCCESS)); }; }
private RemoteCallback<Void> getDeletePipelineSuccessCallback() { return aVoid -> notification.fire(new NotificationEvent(translationService.format(RuntimePresenter_PipelineExecutionDeleteSuccessMessage, item.getPipelineTrace().getKey().getId()), NotificationEvent.NotificationType.SUCCESS)); }
private void preparePipeline() { trace = mockPipelineExecutionTrace(EXECUTION_ID, mockPipeline(PIPELINE_NAME, STAGE_NUMBER), mock(PipelineStatus.class), mock(PipelineStatus.class)); item = new RuntimeListItem(RUNTIME_NAME, trace); presenter.setup(item); } }
private void setupRuntime(RuntimeListItem item) { String itemLabel = item.getItemLabel(); String pipelineName = SYSTEM_PIPELINE_NAME; String createdDate = item.getRuntime().getCreatedDate(); String endpoint = ""; Runtime runtime = item.getRuntime(); PipelineExecutionTrace trace = runtime.getPipelineTrace(); if (trace != null) { pipelineName = trace.getPipeline().getKey().getId(); setupPipeline(trace); } view.setup(itemLabel, createdDate, pipelineName); if (runtime.getEndpoint() != null) { endpoint = runtime.getEndpoint(); } view.setEndpoint(endpoint); processRuntimeStatus(runtime); }
/** * an item with a pipeline execution trace was initially set and a new stage status not yet drawn has changed. */ @Test public void testOnStageStatusChangeNewStageChanged() { preparePipelineExecutionTraceSetup(); RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace); //setup the presenter. presenter.setup(item); int initialStagePresentersSize = stagePresenters.size(); //emulate the next stage consecutive stage finishing. Stage stage = item.getPipelineTrace().getPipeline().getStages().get(displayableStages.size()); presenter.onStageStatusChange(new StageStatusChangeEvent(trace.getKey(), stage.getName(), PipelineStatus.RUNNING)); //an additional stage was added. verify(stagePresenterInstance, times(initialStagePresentersSize + 1)).get(); //the newly stage is set to EXECUTING in the UI StagePresenter stagePresenter = stagePresenters.get(stagePresenters.size() - 1); verify(stagePresenter, times(1)).setup(stage); verify(stagePresenter, times(1)).setState(State.EXECUTING); }
public void setup(final RuntimeListItem runtimeListItem) { this.item = runtimeListItem; clearPipeline(); if (item.isRuntime()) { setupRuntime(runtimeListItem); } else { setupPipelineTrace(runtimeListItem); } view.addExpandedContent(pipelinePresenter.getView()); }
@Test public void testBuildItemLabelForRuntime() { queryResultItem.setRuntimeName(RUNTIME_NAME); RuntimeListItem result = RuntimeListItemBuilder.newInstance().withItem(queryResultItem).build(); assertEquals(RUNTIME_NAME, result.getItemLabel()); }
@Test public void testPipelineTraceBuild() { preparePipelineTrace(); RuntimeListItem result = RuntimeListItemBuilder.newInstance().withItem(queryResultItem).build(); assertFalse(result.isRuntime()); assertNotNull(result.getPipelineTrace()); assertNull(result.getRuntime()); assertPipelineTrace(result.getPipelineTrace()); }
private RemoteCallback<Void> getStartRuntimeSuccessCallback() { return aVoid -> { popupHelper.hideBusyIndicator(); notification.fire(new NotificationEvent(translationService.format(RuntimePresenter_RuntimeStartSuccessMessage, item.getRuntime().getKey().getId()), NotificationEvent.NotificationType.SUCCESS)); }; }
private RemoteCallback<Void> getStopPipelineSuccessCallback() { return aVoid -> notification.fire(new NotificationEvent(translationService.format(RuntimePresenter_PipelineExecutionStopSuccessMessage, item.getPipelineTrace().getKey().getId()), NotificationEvent.NotificationType.SUCCESS)); }
private void prepareRuntime() { runtime = mockRuntime(); item = new RuntimeListItem(RUNTIME_NAME, runtime); presenter.setup(item); }
private void setupRuntime(RuntimeListItem item) { String itemLabel = item.getItemLabel(); String pipelineName = SYSTEM_PIPELINE_NAME; String createdDate = item.getRuntime().getCreatedDate(); String endpoint = ""; Runtime runtime = item.getRuntime(); PipelineExecutionTrace trace = runtime.getPipelineTrace(); if (trace != null) { pipelineName = trace.getPipeline().getKey().getId(); setupPipeline(trace); } view.setup(itemLabel, createdDate, pipelineName); if (runtime.getEndpoint() != null) { endpoint = runtime.getEndpoint(); } view.setEndpoint(endpoint); processRuntimeStatus(runtime); }
/** * an item with a pipeline execution trace was initially set and a new stage status not yet drawn has changed. */ @Test public void testOnStageStatusChangeNewStageChanged() { preparePipelineExecutionTraceSetup(); RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace); //setup the presenter. presenter.setup(item); int initialStagePresentersSize = stagePresenters.size(); //emulate the next stage consecutive stage finishing. Stage stage = item.getPipelineTrace().getPipeline().getStages().get(displayableStages.size()); presenter.onStageStatusChange(new StageStatusChangeEvent(trace.getKey(), stage.getName(), PipelineStatus.RUNNING)); //an additional stage was added. verify(stagePresenterInstance, times(initialStagePresentersSize + 1)).get(); //the newly stage is set to EXECUTING in the UI StagePresenter stagePresenter = stagePresenters.get(stagePresenters.size() - 1); verify(stagePresenter, times(1)).setup(stage); verify(stagePresenter, times(1)).setState(State.EXECUTING); }
public void setup(final RuntimeListItem runtimeListItem) { this.item = runtimeListItem; clearPipeline(); if (item.isRuntime()) { setupRuntime(runtimeListItem); } else { setupPipelineTrace(runtimeListItem); } view.addExpandedContent(pipelinePresenter.getView()); }
@Test public void testBuildItemLabelForRuntimeName() { queryResultItem.setRuntimeName(RUNTIME_ID); RuntimeListItem result = RuntimeListItemBuilder.newInstance().withItem(queryResultItem).build(); assertEquals(RUNTIME_ID, result.getItemLabel()); }
@Test public void testBuildRuntimeWithPipelineExecution() { prepareRuntime(); preparePipelineTrace(); RuntimeListItem result = RuntimeListItemBuilder.newInstance().withItem(queryResultItem).build(); assertTrue(result.isRuntime()); assertNotNull(result.getRuntime()); assertNotNull(result.getRuntime().getPipelineTrace()); assertNull(result.getPipelineTrace()); assertRuntime(result.getRuntime()); assertPipelineTrace(result.getRuntime().getPipelineTrace()); }