Search in sources :

Example 1 with RuntimeChangeEvent

use of org.guvnor.ala.ui.events.RuntimeChangeEvent in project kie-wb-common by kiegroup.

the class RuntimePresenterActionsTest method testOnOtherRuntimeStarted.

@Test
public void testOnOtherRuntimeStarted() {
    prepareRuntime();
    RuntimeKey otherKey = mock(RuntimeKey.class);
    presenter.onRuntimeChangeEvent(new RuntimeChangeEvent(RuntimeChange.STARTED, otherKey));
    verify(presenter, never()).refresh(any(RuntimeKey.class));
}
Also used : RuntimeKey(org.guvnor.ala.ui.model.RuntimeKey) RuntimeChangeEvent(org.guvnor.ala.ui.events.RuntimeChangeEvent) Test(org.junit.Test)

Example 2 with RuntimeChangeEvent

use of org.guvnor.ala.ui.events.RuntimeChangeEvent in project kie-wb-common by kiegroup.

the class RuntimePresenterActionsTest method testOnOtherRuntimeStopped.

@Test
public void testOnOtherRuntimeStopped() {
    prepareRuntime();
    RuntimeKey otherKey = mock(RuntimeKey.class);
    presenter.onRuntimeChangeEvent(new RuntimeChangeEvent(RuntimeChange.STOPPED, otherKey));
    verify(presenter, never()).refresh(any(RuntimeKey.class));
}
Also used : RuntimeKey(org.guvnor.ala.ui.model.RuntimeKey) RuntimeChangeEvent(org.guvnor.ala.ui.events.RuntimeChangeEvent) Test(org.junit.Test)

Example 3 with RuntimeChangeEvent

use of org.guvnor.ala.ui.events.RuntimeChangeEvent in project kie-wb-common by kiegroup.

the class RuntimeServiceImpl method startRuntime.

@Override
public void startRuntime(final RuntimeKey runtimeKey) {
    checkNotNull("runtimeKey", runtimeKey);
    runtimeProvisioningService.startRuntime(runtimeKey.getId());
    runtimeChangeEvent.fire(new RuntimeChangeEvent(RuntimeChange.STARTED, runtimeKey));
}
Also used : RuntimeChangeEvent(org.guvnor.ala.ui.events.RuntimeChangeEvent)

Example 4 with RuntimeChangeEvent

use of org.guvnor.ala.ui.events.RuntimeChangeEvent in project kie-wb-common by kiegroup.

the class RuntimeServiceImplTest method testStopRuntime.

@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));
}
Also used : ProviderKey(org.guvnor.ala.ui.model.ProviderKey) RuntimeKey(org.guvnor.ala.ui.model.RuntimeKey) RuntimeChangeEvent(org.guvnor.ala.ui.events.RuntimeChangeEvent) Test(org.junit.Test)

Example 5 with RuntimeChangeEvent

use of org.guvnor.ala.ui.events.RuntimeChangeEvent in project kie-wb-common by kiegroup.

the class RuntimeServiceImplTest method testStartRuntime.

@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));
}
Also used : ProviderKey(org.guvnor.ala.ui.model.ProviderKey) RuntimeKey(org.guvnor.ala.ui.model.RuntimeKey) RuntimeChangeEvent(org.guvnor.ala.ui.events.RuntimeChangeEvent) Test(org.junit.Test)

Aggregations

RuntimeChangeEvent (org.guvnor.ala.ui.events.RuntimeChangeEvent)12 RuntimeKey (org.guvnor.ala.ui.model.RuntimeKey)9 Test (org.junit.Test)8 ProviderKey (org.guvnor.ala.ui.model.ProviderKey)3 ProviderSelectedEvent (org.guvnor.ala.ui.client.events.ProviderSelectedEvent)2