use of org.guvnor.ala.ui.events.RuntimeChangeEvent in project kie-wb-common by kiegroup.
the class ProviderPresenterTest method testOnRuntimeDeletedRefreshRequired.
@Test
public void testOnRuntimeDeletedRefreshRequired() {
// load the presenter.
prepareRuntimesInfo();
when(runtimeItems.isEmpty()).thenReturn(true);
presenter.onProviderSelected(new ProviderSelectedEvent(providerKey));
RuntimeKey runtimeKey = mock(RuntimeKey.class);
when(runtimeKey.getProviderKey()).thenReturn(providerKey);
when(providerStatusPresenter.removeItem(runtimeKey)).thenReturn(true);
// the provider status presenter is empty after the removal.
when(providerStatusPresenter.isEmpty()).thenReturn(true);
presenter.onRuntimeChange(new RuntimeChangeEvent(RuntimeChange.DELETED, runtimeKey));
verify(providerStatusPresenter, times(1)).removeItem(runtimeKey);
verify(presenter, times(1)).refresh();
}
use of org.guvnor.ala.ui.events.RuntimeChangeEvent in project kie-wb-common by kiegroup.
the class ProviderPresenterTest method testOnRuntimeDeleted.
@Test
public void testOnRuntimeDeleted() {
// load the presenter.
prepareRuntimesInfo();
when(runtimeItems.isEmpty()).thenReturn(true);
presenter.onProviderSelected(new ProviderSelectedEvent(providerKey));
RuntimeKey runtimeKey = mock(RuntimeKey.class);
when(runtimeKey.getProviderKey()).thenReturn(providerKey);
when(providerStatusPresenter.removeItem(runtimeKey)).thenReturn(true);
// the provider status presenter is not empty after the removal.
when(providerStatusPresenter.isEmpty()).thenReturn(false);
presenter.onRuntimeChange(new RuntimeChangeEvent(RuntimeChange.DELETED, runtimeKey));
verify(providerStatusPresenter, times(1)).removeItem(runtimeKey);
}
use of org.guvnor.ala.ui.events.RuntimeChangeEvent in project kie-wb-common by kiegroup.
the class RuntimePresenterActionsTest method testOnCurrentRuntimeStopped.
@Test
public void testOnCurrentRuntimeStopped() {
prepareRuntime();
RuntimeKey currentKey = runtime.getKey();
presenter.onRuntimeChangeEvent(new RuntimeChangeEvent(RuntimeChange.STOPPED, currentKey));
verify(presenter, times(1)).refresh(currentKey);
}
use of org.guvnor.ala.ui.events.RuntimeChangeEvent in project kie-wb-common by kiegroup.
the class RuntimePresenterActionsTest method testOnCurrentRuntimeStarted.
@Test
public void testOnCurrentRuntimeStarted() {
prepareRuntime();
RuntimeKey currentKey = runtime.getKey();
presenter.onRuntimeChangeEvent(new RuntimeChangeEvent(RuntimeChange.STARTED, currentKey));
verify(presenter, times(1)).refresh(currentKey);
}
use of org.guvnor.ala.ui.events.RuntimeChangeEvent in project kie-wb-common by kiegroup.
the class RuntimeServiceImpl method stopRuntime.
@Override
public void stopRuntime(final RuntimeKey runtimeKey) {
checkNotNull("runtimeKey", runtimeKey);
runtimeProvisioningService.stopRuntime(runtimeKey.getId());
runtimeChangeEvent.fire(new RuntimeChangeEvent(RuntimeChange.STOPPED, runtimeKey));
}
Aggregations