@Test public void testUpdateStatusForFailed() { presenter.updateStatus(KieContainerStatus.FAILED); verify(view).enableRemoveButton(); verify(view).setContainerStartState(State.DISABLED); verify(view).setContainerStopState(State.ENABLED); verify(view).disableToggleActivationButton(); }
protected void updateStatus(final KieContainerStatus status) { switch (status) { case CREATING: case STARTED: view.disableRemoveButton(); view.setContainerStartState(State.ENABLED); view.setContainerStopState(State.DISABLED); view.updateToggleActivationButton(false); view.enableToggleActivationButton(); break; case DEACTIVATED: view.disableRemoveButton(); view.setContainerStartState(State.ENABLED); view.setContainerStopState(State.DISABLED); view.updateToggleActivationButton(true); view.enableToggleActivationButton(); break; case STOPPED: view.updateToggleActivationButton(false); case DISPOSING: case FAILED: view.enableRemoveButton(); view.setContainerStartState(State.DISABLED); view.setContainerStopState(State.ENABLED); view.disableToggleActivationButton(); break; } }
ContainerPresenter { protected void updateStatus(final KieContainerStatus status) { switch (status) { case CREATING: case STARTED: view.disableRemoveButton(); view.setContainerStartState(State.ENABLED); view.setContainerStopState(State.DISABLED); view.updateToggleActivationButton(false); view.enableToggleActivationButton(); break; case DEACTIVATED: view.disableRemoveButton(); view.setContainerStartState(State.ENABLED); view.setContainerStopState(State.DISABLED); view.updateToggleActivationButton(true); view.enableToggleActivationButton(); break; case STOPPED: view.updateToggleActivationButton(false); case DISPOSING: case FAILED: view.enableRemoveButton(); view.setContainerStartState(State.DISABLED); view.setContainerStopState(State.ENABLED); view.disableToggleActivationButton(); break; } } }
ContainerPresenter { protected void updateStatus(final KieContainerStatus status) { switch (status) { case CREATING: case STARTED: view.disableRemoveButton(); view.setContainerStartState(State.ENABLED); view.setContainerStopState(State.DISABLED); view.updateToggleActivationButton(false); view.enableToggleActivationButton(); break; case DEACTIVATED: view.disableRemoveButton(); view.setContainerStartState(State.ENABLED); view.setContainerStopState(State.DISABLED); view.updateToggleActivationButton(true); view.enableToggleActivationButton(); break; case STOPPED: view.updateToggleActivationButton(false); case DISPOSING: case FAILED: view.enableRemoveButton(); view.setContainerStartState(State.DISABLED); view.setContainerStopState(State.ENABLED); view.disableToggleActivationButton(); break; } } @Inject  ContainerPresenter(final Logger logger,
                              final View view,
                              final ContainerRemoteStatusPresenter containerRemoteStatusPresenter,
                              final ContainerStatusEmptyPresenter containerStatusEmptyPresenter,
                              final ContainerProcessConfigPresenter containerProcessConfigPresenter,
                              final ContainerRulesConfigPresenter containerRulesConfigPresenter,
                              final Caller<RuntimeManagementService> runtimeManagementService,
                              final Caller<SpecManagementService> specManagementService,
                              final Event<ServerTemplateSelected> serverTemplateSelectedEvent,
                              final Event<NotificationEvent> notification); }
ContainerPresenter { protected void updateStatus(final KieContainerStatus status) { switch (status) { case CREATING: case STARTED: view.disableRemoveButton(); view.setContainerStartState(State.ENABLED); view.setContainerStopState(State.DISABLED); view.updateToggleActivationButton(false); view.enableToggleActivationButton(); break; case DEACTIVATED: view.disableRemoveButton(); view.setContainerStartState(State.ENABLED); view.setContainerStopState(State.DISABLED); view.updateToggleActivationButton(true); view.enableToggleActivationButton(); break; case STOPPED: view.updateToggleActivationButton(false); case DISPOSING: case FAILED: view.enableRemoveButton(); view.setContainerStartState(State.DISABLED); view.setContainerStopState(State.ENABLED); view.disableToggleActivationButton(); break; } } @Inject  ContainerPresenter(final Logger logger,
                              final View view,
                              final ContainerRemoteStatusPresenter containerRemoteStatusPresenter,
                              final ContainerStatusEmptyPresenter containerStatusEmptyPresenter,
                              final ContainerProcessConfigPresenter containerProcessConfigPresenter,
                              final ContainerRulesConfigPresenter containerRulesConfigPresenter,
                              final Caller<RuntimeManagementService> runtimeManagementService,
                              final Caller<SpecManagementService> specManagementService,
                              final Event<ServerTemplateSelected> serverTemplateSelectedEvent,
                              final Event<NotificationEvent> notification); @PostConstruct void init(); View getView(); void onRefresh(@Observes final RefreshRemoteServers refresh); void load(@Observes final ContainerSpecSelected containerSpecSelected); void onInstanceUpdated(@Observes ServerInstanceUpdated instanceUpdated); void loadContainers(@Observes final ContainerSpecData content); void refreshOnContainerUpdateEvent(@Observes final ContainerUpdateEvent updateEvent); void refresh(); void load(final ContainerSpecKey containerSpecKey); void removeContainer(); void stopContainer(); void startContainer(); void toggleActivationContainer(); }
ContainerPresenter { protected void updateStatus(final KieContainerStatus status) { switch (status) { case CREATING: case STARTED: view.disableRemoveButton(); view.setContainerStartState(State.ENABLED); view.setContainerStopState(State.DISABLED); view.updateToggleActivationButton(false); view.enableToggleActivationButton(); break; case DEACTIVATED: view.disableRemoveButton(); view.setContainerStartState(State.ENABLED); view.setContainerStopState(State.DISABLED); view.updateToggleActivationButton(true); view.enableToggleActivationButton(); break; case STOPPED: view.updateToggleActivationButton(false); case DISPOSING: case FAILED: view.enableRemoveButton(); view.setContainerStartState(State.DISABLED); view.setContainerStopState(State.ENABLED); view.disableToggleActivationButton(); break; } } @Inject  ContainerPresenter(final Logger logger,
                              final View view,
                              final ContainerRemoteStatusPresenter containerRemoteStatusPresenter,
                              final ContainerStatusEmptyPresenter containerStatusEmptyPresenter,
                              final ContainerProcessConfigPresenter containerProcessConfigPresenter,
                              final ContainerRulesConfigPresenter containerRulesConfigPresenter,
                              final Caller<RuntimeManagementService> runtimeManagementService,
                              final Caller<SpecManagementService> specManagementService,
                              final Event<ServerTemplateSelected> serverTemplateSelectedEvent,
                              final Event<NotificationEvent> notification); @PostConstruct void init(); View getView(); void onRefresh(@Observes final RefreshRemoteServers refresh); void load(@Observes final ContainerSpecSelected containerSpecSelected); void onInstanceUpdated(@Observes ServerInstanceUpdated instanceUpdated); void loadContainers(@Observes final ContainerSpecData content); void refreshOnContainerUpdateEvent(@Observes final ContainerUpdateEvent updateEvent); void refresh(); void load(final ContainerSpecKey containerSpecKey); void removeContainer(); void stopContainer(); void startContainer(); void toggleActivationContainer();  }