Search in sources :

Example 1 with PipelineKey

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

the class RuntimeServiceImplTest method testGetPipelines.

@Test
public void testGetPipelines() {
    ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION);
    when(pipelineService.getPipelineNames(any(org.guvnor.ala.runtime.providers.ProviderType.class), anyInt(), anyInt(), Mockito.<String>any(), anyBoolean())).thenReturn(pipelineNames);
    Collection<PipelineKey> result = service.getPipelines(providerTypeKey);
    assertEquals(pipelineKeys, result);
}
Also used : PipelineKey(org.guvnor.ala.ui.model.PipelineKey) ProviderTypeKey(org.guvnor.ala.ui.model.ProviderTypeKey) Test(org.junit.Test)

Example 2 with PipelineKey

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

the class RuntimePresenterTest method mockPipeline.

protected Pipeline mockPipeline(String pipelineId, int stages) {
    PipelineKey pipelineKey = new PipelineKey(pipelineId);
    Pipeline pipeline = new Pipeline(pipelineKey);
    for (int i = 0; i < stages; i++) {
        Stage stage = new Stage(pipelineKey, "Stage.name." + Integer.toString(i));
        pipeline.addStage(stage);
    }
    return pipeline;
}
Also used : PipelineKey(org.guvnor.ala.ui.model.PipelineKey) Stage(org.guvnor.ala.ui.model.Stage) Pipeline(org.guvnor.ala.ui.model.Pipeline)

Example 3 with PipelineKey

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

the class RuntimeListItemBuilder method build.

public RuntimeListItem build() {
    RuntimeListItem result;
    PipelineExecutionTrace pipelineTrace;
    String runtimeName;
    if (item.getRuntimeName() != null) {
        runtimeName = item.getRuntimeName();
    } else {
        runtimeName = item.getRuntimeId();
    }
    if (item.getPipelineExecutionId() != null) {
        final Pipeline pipeline = new Pipeline(new PipelineKey(item.getPipelineId()));
        pipelineTrace = new PipelineExecutionTrace(new PipelineExecutionTraceKey(item.getPipelineExecutionId()));
        pipelineTrace.setPipelineStatus(transformToPipelineStatus(item.getPipelineStatus()));
        pipelineTrace.setPipelineError(new PipelineError(item.getPipelineError(), item.getPipelineErrorDetail()));
        item.getPipelineStageItems().getItems().forEach(stage -> {
            pipeline.addStage(new Stage(pipeline.getKey(), stage.getName()));
            pipelineTrace.setStageStatus(stage.getName(), transformToPipelineStatus(stage.getStatus()));
            pipelineTrace.setStageError(stage.getName(), new PipelineError(stage.getStageError(), stage.getStageErrorDetail()));
        });
        pipelineTrace.setPipeline(pipeline);
    } else {
        pipelineTrace = null;
    }
    if (item.getRuntimeId() != null) {
        final Runtime runtime = new Runtime(new RuntimeKey(new ProviderKey(new ProviderTypeKey(item.getProviderTypeName(), item.getProviderVersion()), item.getProviderId()), item.getRuntimeId()), item.getRuntimeStatus(), item.getRuntimeEndpoint(), item.getStartedAt());
        runtime.setPipelineTrace(pipelineTrace);
        result = new RuntimeListItem(runtimeName, runtime);
    } else {
        result = new RuntimeListItem(runtimeName, pipelineTrace);
    }
    return result;
}
Also used : Runtime(org.guvnor.ala.ui.model.Runtime) RuntimeListItem(org.guvnor.ala.ui.model.RuntimeListItem) PipelineKey(org.guvnor.ala.ui.model.PipelineKey) ProviderKey(org.guvnor.ala.ui.model.ProviderKey) PipelineExecutionTrace(org.guvnor.ala.ui.model.PipelineExecutionTrace) Stage(org.guvnor.ala.ui.model.Stage) RuntimeKey(org.guvnor.ala.ui.model.RuntimeKey) PipelineExecutionTraceKey(org.guvnor.ala.ui.model.PipelineExecutionTraceKey) ProviderTypeKey(org.guvnor.ala.ui.model.ProviderTypeKey) Pipeline(org.guvnor.ala.ui.model.Pipeline) PipelineError(org.guvnor.ala.ui.model.PipelineError)

Example 4 with PipelineKey

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

the class NewDeployWizard method complete.

@Override
public void complete() {
    final PipelineKey pipeline = selectPipelinePage.getPipeline();
    Map<String, String> params = buildPipelineParams();
    final String runtime = params.get(RUNTIME_NAME);
    runtimeService.call((Void aVoid) -> onPipelineStartSuccess(), popupHelper.getPopupErrorCallback()).createRuntime(provider.getKey(), runtime, pipeline, buildPipelineParams());
}
Also used : PipelineKey(org.guvnor.ala.ui.model.PipelineKey)

Example 5 with PipelineKey

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

the class SelectPipelinePagePresenterTest method setUp.

@Before
public void setUp() {
    pipelines = new ArrayList<>();
    for (int i = 0; i < PIPELINES_COUNT; i++) {
        pipelines.add(new PipelineKey("Pipeline." + i));
    }
    presenter = new SelectPipelinePagePresenter(view, wizardPageStatusChangeEvent, itemPresenterInstance) {

        protected int currentPipeline = 0;

        @Override
        protected PipelineItemPresenter newItemPresenter() {
            PipelineItemPresenter itemPresenter = mock(PipelineItemPresenter.class);
            when(itemPresenter.getView()).thenReturn(mock(IsElement.class));
            when(itemPresenter.getPipeline()).thenReturn(pipelines.get(currentPipeline));
            when(itemPresenterInstance.get()).thenReturn(itemPresenter);
            currentPipeline++;
            return super.newItemPresenter();
        }
    };
    presenter.init();
    verify(view, times(1)).init(presenter);
}
Also used : PipelineKey(org.guvnor.ala.ui.model.PipelineKey) PipelineItemPresenter(org.guvnor.ala.ui.client.wizard.pipeline.select.item.PipelineItemPresenter) Before(org.junit.Before)

Aggregations

PipelineKey (org.guvnor.ala.ui.model.PipelineKey)6 Pipeline (org.guvnor.ala.ui.model.Pipeline)2 ProviderTypeKey (org.guvnor.ala.ui.model.ProviderTypeKey)2 Stage (org.guvnor.ala.ui.model.Stage)2 Test (org.junit.Test)2 AddNewRuntimeEvent (org.guvnor.ala.ui.client.events.AddNewRuntimeEvent)1 PipelineItemPresenter (org.guvnor.ala.ui.client.wizard.pipeline.select.item.PipelineItemPresenter)1 PipelineError (org.guvnor.ala.ui.model.PipelineError)1 PipelineExecutionTrace (org.guvnor.ala.ui.model.PipelineExecutionTrace)1 PipelineExecutionTraceKey (org.guvnor.ala.ui.model.PipelineExecutionTraceKey)1 Provider (org.guvnor.ala.ui.model.Provider)1 ProviderConfiguration (org.guvnor.ala.ui.model.ProviderConfiguration)1 ProviderKey (org.guvnor.ala.ui.model.ProviderKey)1 Runtime (org.guvnor.ala.ui.model.Runtime)1 RuntimeKey (org.guvnor.ala.ui.model.RuntimeKey)1 RuntimeListItem (org.guvnor.ala.ui.model.RuntimeListItem)1 Before (org.junit.Before)1