Search in sources :

Example 26 with RuntimeListItem

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

the class RuntimeListItemBuilderTest method testBuildRuntimeWithPipelineExecution.

@Test
public void testBuildRuntimeWithPipelineExecution() {
    prepareRuntime();
    preparePipelineTrace();
    RuntimeListItem result = RuntimeListItemBuilder.newInstance().withItem(queryResultItem).build();
    assertTrue(result.isRuntime());
    assertNotNull(result.getRuntime());
    assertNotNull(result.getRuntime().getPipelineTrace());
    assertNull(result.getPipelineTrace());
    assertRuntime(result.getRuntime());
    assertPipelineTrace(result.getRuntime().getPipelineTrace());
}
Also used : RuntimeListItem(org.guvnor.ala.ui.model.RuntimeListItem) Test(org.junit.Test)

Example 27 with RuntimeListItem

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

the class RuntimeServiceImplTest method getRuntimeItemByRuntimeKeyNotExisting.

@Test
public void getRuntimeItemByRuntimeKeyNotExisting() {
    ProviderKey providerKey = mock(ProviderKey.class);
    RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID);
    List<RuntimeQueryResultItem> singleResult = new ArrayList<>();
    when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult);
    RuntimeListItem result = service.getRuntimeItem(runtimeKey);
    assertNull(result);
}
Also used : ProviderKey(org.guvnor.ala.ui.model.ProviderKey) RuntimeListItem(org.guvnor.ala.ui.model.RuntimeListItem) RuntimeQuery(org.guvnor.ala.services.api.RuntimeQuery) RuntimeQueryResultItem(org.guvnor.ala.services.api.RuntimeQueryResultItem) ArrayList(java.util.ArrayList) RuntimeKey(org.guvnor.ala.ui.model.RuntimeKey) Test(org.junit.Test)

Example 28 with RuntimeListItem

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

the class RuntimeServiceImplTest method getRuntimeItemByRuntimeKeyExisting.

@Test
public void getRuntimeItemByRuntimeKeyExisting() {
    ProviderKey providerKey = mock(ProviderKey.class);
    RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID);
    List<RuntimeQueryResultItem> singleResult = mockRuntimeQueryResultItemList(1);
    when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult);
    RuntimeListItem expectedItem = buildExpectedResult(singleResult).iterator().next();
    RuntimeListItem result = service.getRuntimeItem(runtimeKey);
    assertEquals(expectedItem, result);
}
Also used : ProviderKey(org.guvnor.ala.ui.model.ProviderKey) RuntimeListItem(org.guvnor.ala.ui.model.RuntimeListItem) RuntimeQuery(org.guvnor.ala.services.api.RuntimeQuery) RuntimeQueryResultItem(org.guvnor.ala.services.api.RuntimeQueryResultItem) RuntimeKey(org.guvnor.ala.ui.model.RuntimeKey) Test(org.junit.Test)

Example 29 with RuntimeListItem

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

the class RuntimeServiceImplTest method getRuntimeItemByPipelineExecutionKeyNotExisting.

@Test
public void getRuntimeItemByPipelineExecutionKeyNotExisting() {
    PipelineExecutionTraceKey traceKey = new PipelineExecutionTraceKey(PIPELINE_EXECUTION_ID);
    List<RuntimeQueryResultItem> singleResult = new ArrayList<>();
    when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult);
    RuntimeListItem result = service.getRuntimeItem(traceKey);
    assertNull(result);
}
Also used : RuntimeListItem(org.guvnor.ala.ui.model.RuntimeListItem) RuntimeQuery(org.guvnor.ala.services.api.RuntimeQuery) RuntimeQueryResultItem(org.guvnor.ala.services.api.RuntimeQueryResultItem) ArrayList(java.util.ArrayList) PipelineExecutionTraceKey(org.guvnor.ala.ui.model.PipelineExecutionTraceKey) 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