RunnerManagerViewImpl extends BaseView<RunnerManagerView.ActionDelegate> implements RunnerManagerView { @Override public void update(@NotNull Runner runner) { changeButtonsState(runner); moreInfoWidget.update(runner); debugPanel.setVisible(false); } @Inject  RunnerManagerViewImpl(PartStackUIResources partStackUIResources,
                                 RunnerResources resources,
                                 RunnerLocalizationConstant locale,
                                 WidgetFactory widgetFactory,
                                 AppContext appContext,
                                 PopupPanel moreInfoPopup,
                                 final PopupPanel menuPopup); @Override void update(@NotNull Runner runner); @Override void setApplicationURl(@Nullable String applicationUrl); @Override void setDebugPort(@Nullable String port); @Override void setTimeout(@NotNull String timeoutValue); @Override void showMoreInfoPopup(@Nullable Runner runner); @Override void updateMoreInfoPopup(@NotNull Runner runner); @Override void setLeftPanel(@NotNull TabContainer containerPresenter); @Override void setRightPropertiesPanel(@NotNull TabContainer containerPresenter); @Override void setLeftPropertiesPanel(@NotNull TabContainer containerPresenter); @Override void setGeneralPropertiesPanel(@NotNull TabContainer containerPresenter); @Override void hideOtherButtons(); @Override void showOtherButtons(); @Override void setEnableRunButton(boolean isEnable); @Override void setEnableReRunButton(boolean isEnable); @Override void setEnableStopButton(boolean isEnable); @Override void setEnableLogsButton(boolean isEnable); @Override void showLog(@NotNull String url); @UiHandler("appReference") void onAppReferenceClicked(@SuppressWarnings("UnusedParameters") ClickEvent clickEvent);  }
@Test public void allButtonsShouldBeDisabledWhenCurrentProjectIsNull() throws Exception { when(appContext.getCurrentProject()).thenReturn(null); view.update(runner); verify(run, times(2)).setDisable(); verify(stop, times(2)).setDisable(); verify(reRun, times(2)).setDisable(); verify(logs, times(2)).setDisable(); }
@Test public void shouldUpdateWhenRunnerInStatusInQueue() { reset(run, stop, reRun, logs); when(runner.getStatus()).thenReturn(Runner.Status.IN_QUEUE); when(appContext.getCurrentProject()).thenReturn(currentProject); view.update(runner); verifyEnableAllButton(); verify(stop).setDisable(); verify(logs).setDisable(); }
@Test public void shouldUpdateWhenRunnerInStatusFailed() { reset(run, stop, reRun, logs); when(runner.getStatus()).thenReturn(Runner.Status.FAILED); when(appContext.getCurrentProject()).thenReturn(currentProject); view.update(runner); verifyEnableAllButton(); verify(stop).setDisable(); verify(reRun).setEnable(); verify(logs).setDisable(); }
@Test public void shouldUpdateWhenRunnerInStatusStopped() { reset(run, stop, reRun, logs); when(runner.getStatus()).thenReturn(Runner.Status.STOPPED); when(appContext.getCurrentProject()).thenReturn(currentProject); view.update(runner); verifyEnableAllButton(); verify(stop).setDisable(); verify(reRun).setEnable(); verify(logs).setDisable(); }