use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class RuntimeListItemBuilderTest method testBuildItemLabelForRuntime.
@Test
public void testBuildItemLabelForRuntime() {
queryResultItem.setRuntimeName(RUNTIME_NAME);
RuntimeListItem result = RuntimeListItemBuilder.newInstance().withItem(queryResultItem).build();
assertEquals(RUNTIME_NAME, result.getItemLabel());
}
use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method testGetRuntimeItems.
@Test
public void testGetRuntimeItems() {
ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION);
ProviderKey providerKey = new ProviderKey(providerTypeKey, PROVIDER_ID);
when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(queryItems);
Collection<RuntimeListItem> result = service.getRuntimeItems(providerKey);
Collection<RuntimeListItem> expectedResult = buildExpectedResult(queryItems);
assertEquals(expectedResult, result);
}
use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class RuntimeServiceImplTest method getRuntimeItemByPipelineExecutionKeyExisting.
@Test
public void getRuntimeItemByPipelineExecutionKeyExisting() {
PipelineExecutionTraceKey traceKey = new PipelineExecutionTraceKey(PIPELINE_EXECUTION_ID);
List<RuntimeQueryResultItem> singleResult = mockRuntimeQueryResultItemList(1);
when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult);
RuntimeListItem expectedItem = buildExpectedResult(singleResult).iterator().next();
RuntimeListItem result = service.getRuntimeItem(traceKey);
assertEquals(expectedItem, result);
}
use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class ProviderStatusPresenterTest method testRemoveExistingPipelineExecution.
@Test
public void testRemoveExistingPipelineExecution() {
PipelineExecutionTraceKey keyToRemove = mock(PipelineExecutionTraceKey.class);
List<RuntimeListItem> items = mockItems(ITEMS_COUNT);
// pick an arbitrary element as the existing pipeline execution.
int index = 2;
RuntimeListItem item = items.get(index);
PipelineExecutionTrace pipelineExecutionTrace = mock(PipelineExecutionTrace.class);
when(pipelineExecutionTrace.getKey()).thenReturn(keyToRemove);
when(item.isRuntime()).thenReturn(false);
when(item.getPipelineTrace()).thenReturn(pipelineExecutionTrace);
presenter.setupItems(items);
for (int i = 0; i < ITEMS_COUNT; i++) {
when(runtimePresenters.get(i).getItem()).thenReturn(items.get(i));
}
assertTrue(presenter.removeItem(keyToRemove));
verify(runtimePresenterInstance, times(1)).destroy(runtimePresenters.get(index));
verify(view, times(1)).removeListItem(runtimePresenters.get(index).getView());
}
use of org.guvnor.ala.ui.model.RuntimeListItem in project kie-wb-common by kiegroup.
the class RuntimePresenterActionsSetupTest method preparePipelineActionsSetupTest.
private void preparePipelineActionsSetupTest(final PipelineStatus status) {
preparePipelineExecutionTraceSetup();
trace.setPipelineStatus(status);
RuntimeListItem item = new RuntimeListItem(RUNTIME_NAME, trace);
presenter.setup(item);
}
Aggregations