Search in sources :

Example 6 with RuntimeListItem

use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.

the class RuntimePresenterSetupsTest method testOnStageStatusChangeLastVisibleStageChanged.

/**
 * an item with a pipeline execution trace was initially set and the last stage status has changed.
 */
@Test
public void testOnStageStatusChangeLastVisibleStageChanged() {
    preparePipelineExecutionTraceSetup();
    RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace);
    // setup the presenter.
    presenter.setup(item);
    int initialStagePresentersSize = stagePresenters.size();
    // emulate the last stage finishing.
    Stage stage = displayableStages.get(displayableStages.size() - 1);
    presenter.onStageStatusChange(new StageStatusChangeEvent(trace.getKey(), stage.getName(), PipelineStatus.FINISHED));
    // the last stage status was changed form EXECUTING to to DONE
    StagePresenter stagePresenter = stagePresenters.get(stagePresenters.size() - 1);
    verify(stagePresenter, times(1)).setState(State.EXECUTING);
    verify(stagePresenter, times(1)).setState(State.DONE);
    // no additional stages were added.
    verify(stagePresenterInstance, times(initialStagePresentersSize)).get();
}
Also used : RuntimeListItem(org.guvnor.ala.ui.model.RuntimeListItem) StagePresenter(org.guvnor.ala.ui.client.widget.pipeline.stage.StagePresenter) Stage(org.guvnor.ala.ui.model.Stage) StageStatusChangeEvent(org.guvnor.ala.ui.events.StageStatusChangeEvent) Test(org.junit.Test)

Example 7 with RuntimeListItem

use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.

the class RuntimePresenterSetupsTest method testSetupRuntimeWithNoTrace.

/**
 * Tests the case when the item is a Runtime with no pipeline execution trace.
 */
@Test
public void testSetupRuntimeWithNoTrace() {
    runtime = mockRuntime();
    item = new RuntimeListItem(RUNTIME_NAME, runtime);
    presenter.setup(item);
    verify(pipelinePresenter, times(1)).clearStages();
    verify(view, times(1)).setup(RUNTIME_NAME, CREATED_DATE, DEFAULT_PIPELINE_NAME);
    verify(view, times(1)).setEndpoint(ENDPOINT);
    verify(pipelinePresenter, never()).addStage(any(IsElement.class));
}
Also used : RuntimeListItem(org.guvnor.ala.ui.model.RuntimeListItem) IsElement(org.jboss.errai.common.client.api.IsElement) Test(org.junit.Test)

Example 8 with RuntimeListItem

use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.

the class RuntimePresenterSetupsTest method testSetupPipelineExecutionTrace.

/**
 * Tests the case when the item is a PipelineExecutionTrace execution trace.
 */
@Test
public void testSetupPipelineExecutionTrace() {
    preparePipelineExecutionTraceSetup();
    RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace);
    presenter.setup(item);
    verify(pipelinePresenter, times(2)).clearStages();
    verify(view, times(1)).setup(RUNTIME_NAME, "", PIPELINE_NAME);
    verifyPipelineWasSet(trace, displayableStages);
}
Also used : RuntimeListItem(org.guvnor.ala.ui.model.RuntimeListItem) Test(org.junit.Test)

Example 9 with RuntimeListItem

use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.

the class ProvisioningScreensServiceImpl method getRuntimesInfo.

@Override
public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) {
    checkNotNull("providerKey", providerKey);
    final Provider provider = providerService.getProvider(providerKey);
    if (provider == null) {
        return null;
    }
    final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey);
    return new RuntimesInfo(provider, items);
}
Also used : RuntimeListItem(org.guvnor.ala.ui.model.RuntimeListItem) RuntimesInfo(org.guvnor.ala.ui.model.RuntimesInfo) Provider(org.guvnor.ala.ui.model.Provider)

Example 10 with RuntimeListItem

use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.

the class RuntimeListItemBuilderTest method testBuildItemLabelForRuntimeName.

@Test
public void testBuildItemLabelForRuntimeName() {
    queryResultItem.setRuntimeName(RUNTIME_ID);
    RuntimeListItem result = RuntimeListItemBuilder.newInstance().withItem(queryResultItem).build();
    assertEquals(RUNTIME_ID, result.getItemLabel());
}
Also used : RuntimeListItem(org.guvnor.ala.ui.model.RuntimeListItem) Test(org.junit.Test)

Aggregations

RuntimeListItem (org.guvnor.ala.ui.model.RuntimeListItem)29 Test (org.junit.Test)23 PipelineExecutionTraceKey (org.guvnor.ala.ui.model.PipelineExecutionTraceKey)7 RuntimeQuery (org.guvnor.ala.services.api.RuntimeQuery)5 RuntimeKey (org.guvnor.ala.ui.model.RuntimeKey)5 RuntimeQueryResultItem (org.guvnor.ala.services.api.RuntimeQueryResultItem)4 ProviderKey (org.guvnor.ala.ui.model.ProviderKey)4 Stage (org.guvnor.ala.ui.model.Stage)3 ArrayList (java.util.ArrayList)2 StagePresenter (org.guvnor.ala.ui.client.widget.pipeline.stage.StagePresenter)2 PipelineExecutionChangeEvent (org.guvnor.ala.ui.events.PipelineExecutionChangeEvent)2 StageStatusChangeEvent (org.guvnor.ala.ui.events.StageStatusChangeEvent)2 PipelineError (org.guvnor.ala.ui.model.PipelineError)2 PipelineExecutionTrace (org.guvnor.ala.ui.model.PipelineExecutionTrace)2 ProviderTypeKey (org.guvnor.ala.ui.model.ProviderTypeKey)2 Runtime (org.guvnor.ala.ui.model.Runtime)2 PipelineStatusChangeEvent (org.guvnor.ala.ui.events.PipelineStatusChangeEvent)1 Pipeline (org.guvnor.ala.ui.model.Pipeline)1 PipelineKey (org.guvnor.ala.ui.model.PipelineKey)1 Provider (org.guvnor.ala.ui.model.Provider)1