Tabnine Logo
PipelineExecutorTaskDef
Code IndexAdd Tabnine to your IDE (free)

How to use
PipelineExecutorTaskDef
in
org.guvnor.ala.pipeline.execution

Best Java code snippets using org.guvnor.ala.pipeline.execution.PipelineExecutorTaskDef (Showing top 20 results out of 315)

origin: org.guvnor/guvnor-ala-spi

private void prepareExecution() {
  //mock the execution inputs
  pipeline = mock(Pipeline.class);
  stages = mockStages(PIPELINE_STAGES_SIZE);
  when(pipeline.getStages()).thenReturn(stages);
  when(pipeline.getName()).thenReturn(PIPELINE_ID);
  when(pipelineRegistry.getPipelineByName(PIPELINE_ID)).thenReturn(pipeline);
  taskDef = mock(PipelineExecutorTaskDef.class);
  input = mock(Input.class);
  when(taskDef.getInput()).thenReturn(input);
  when(taskDef.getPipeline()).thenReturn(PIPELINE_ID);
}
origin: org.guvnor/guvnor-ala-spi

public PipelineExecutorTaskImpl(final PipelineExecutorTaskDef taskDef,
                final String executionId) {
  this.taskDef = taskDef;
  setId(executionId);
  taskDef.getStages().forEach(stage -> setStageStatus(stage,
                            Status.SCHEDULED));
}
origin: org.guvnor/guvnor-ala-spi

  protected void assertHasSameInfo(PipelineExecutorTaskDef expectedTaskDef,
                   PipelineExecutorTaskDef taskDef) {
    assertEquals(expectedTaskDef.getInput(),
           taskDef.getInput());
    assertEquals(expectedTaskDef.getPipeline(),
           taskDef.getPipeline());
    assertEquals(expectedTaskDef.getProviderId(),
           taskDef.getProviderId());
    assertEquals(expectedTaskDef.getProviderType(),
           taskDef.getProviderType());
  }
}
origin: org.guvnor/guvnor-ala-services-rest

if (pipelineExecutorTrace.getTask().getTaskDef().getProviderId() != null) {
  item.setProviderId(pipelineExecutorTrace.getTask().getTaskDef().getProviderId().getId());
  item.setProviderTypeName(pipelineExecutorTrace.getTask().getTaskDef().getProviderId().getProviderType().getProviderTypeName());
  item.setProviderVersion(pipelineExecutorTrace.getTask().getTaskDef().getProviderId().getProviderType().getVersion());
List<PipelineStageItem> stageItems = pipelineExecutorTrace.getTask().getTaskDef().getStages().stream()
    .map(stage -> {
      String stageError = null;
  item.setRuntimeName(pipelineExecutorTrace.getTask().getTaskDef().getInput().get(RuntimeConfig.RUNTIME_NAME));
origin: org.kie.workbench/kie-wb-common-ala-spi

when(taskDef.getInput()).thenReturn(input);
when(taskDef.getStages()).thenReturn(stages);
origin: org.guvnor/guvnor-ala-spi

private void setId(final String executionId) {
  this.executionId = executionId;
  getTaskDef().getInput().put(PIPELINE_EXECUTION_ID,
                executionId);
}
origin: org.kie.workbench/kie-wb-common-ala-spi

@JsonIgnore
@Override
public String getPipelineId() {
  return getTask().getTaskDef().getPipeline();
}
origin: org.guvnor/guvnor-ala-services-rest

  @Override
  public boolean test(PipelineExecutorTrace pipelineExecutorTrace) {
    if (pipelineExecutionId != null) {
      return pipelineExecutionId.equals(pipelineExecutorTrace.getTaskId());
    }
    if (runtimeId != null) {
      return (pipelineExecutorTrace.getTask().getOutput() instanceof RuntimeId) &&
          runtimeId.equals(((RuntimeId) pipelineExecutorTrace.getTask().getOutput()).getId());
    }
    if (runtimeName != null) {
      return (pipelineExecutorTrace.getTask().getOutput() instanceof RuntimeId) &&
          runtimeName.equals(((RuntimeId) pipelineExecutorTrace.getTask().getOutput()).getName());
    }
    if (providerId != null) {
      if (pipelineExecutorTrace.getTask().getTaskDef().getProviderId() == null) {
        return false;
      } else if (!providerId.equals(pipelineExecutorTrace.getTask().getTaskDef().getProviderId().getId())) {
        return false;
      }
    }
    if (pipelineId != null) {
      if (!pipelineId.equals(pipelineExecutorTrace.getPipelineId())) {
        return false;
      }
    }
    return true;
  }
}
origin: org.guvnor/guvnor-ala-spi

when(taskDef.getInput()).thenReturn(input);
when(taskDef.getStages()).thenReturn(stages);
origin: org.kie.workbench/kie-wb-common-ala-spi

private void setId(final String executionId) {
  this.executionId = executionId;
  getTaskDef().getInput().put(PIPELINE_EXECUTION_ID,
                executionId);
}
origin: org.guvnor/guvnor-ala-spi

@JsonIgnore
@Override
public String getPipelineId() {
  return getTask().getTaskDef().getPipeline();
}
origin: org.kie.workbench/kie-wb-common-ala-spi

private void prepareExecution() {
  //mock the execution inputs
  pipeline = mock(Pipeline.class);
  stages = mockStages(PIPELINE_STAGES_SIZE);
  when(pipeline.getStages()).thenReturn(stages);
  when(pipeline.getName()).thenReturn(PIPELINE_ID);
  when(pipelineRegistry.getPipelineByName(PIPELINE_ID)).thenReturn(pipeline);
  taskDef = mock(PipelineExecutorTaskDef.class);
  input = mock(Input.class);
  when(taskDef.getInput()).thenReturn(input);
  when(taskDef.getPipeline()).thenReturn(PIPELINE_ID);
}
origin: org.kie.workbench/kie-wb-common-ala-spi

  protected void assertHasSameInfo(PipelineExecutorTaskDef expectedTaskDef,
                   PipelineExecutorTaskDef taskDef) {
    assertEquals(expectedTaskDef.getInput(),
           taskDef.getInput());
    assertEquals(expectedTaskDef.getPipeline(),
           taskDef.getPipeline());
    assertEquals(expectedTaskDef.getProviderId(),
           taskDef.getProviderId());
    assertEquals(expectedTaskDef.getProviderType(),
           taskDef.getProviderType());
  }
}
origin: org.kie.workbench/kie-wb-common-ala-spi

public PipelineExecutorTaskImpl(final PipelineExecutorTaskDef taskDef,
                final String executionId) {
  this.taskDef = taskDef;
  setId(executionId);
  taskDef.getStages().forEach(stage -> setStageStatus(stage,
                            Status.SCHEDULED));
}
origin: org.guvnor/guvnor-ala-spi

@Test
public void testExecuteSync() {
  when(taskManagerHelper.generateTaskId()).thenReturn(TASK_ID);
  taskManager.init();
  //prepare the input parameters.
  prepareExecution();
  String result = taskManager.execute(taskDef,
                    PipelineExecutorTaskManager.ExecutionMode.SYNCHRONOUS);
  assertEquals(TASK_ID,
         result);
  //verify the task to execute was properly initialized.
  verify(taskManagerHelper,
      times(1)).createTask(taskDef);
  //verify the pipeline was properly executed.
  verify(pipelineExecutor,
      times(1)).execute(eq(taskDef.getInput()),
               eq(pipeline),
               any(Consumer.class),
               eq(taskManager.localListener));
  //verify the pipeline executor registry was properly updated.
  verify(pipelineExecutorRegistry,
      times(1)).register(pipelineExecutorTraceCaptor.capture());
  assertEquals(PIPELINE_ID,
         pipelineExecutorTraceCaptor.getValue().getPipelineId());
  assertEquals(TASK_ID,
         pipelineExecutorTraceCaptor.getValue().getTaskId());
}
origin: org.guvnor/guvnor-ala-spi

Pipeline pipeline = mock(Pipeline.class);
when(pipeline.getStages()).thenReturn(mock(List.class));
when(taskDef.getPipeline()).thenReturn(PIPELINE_ID);
origin: org.guvnor/guvnor-ala-spi

@Before
public void setUp() {
  super.setUp();
  error = mock(Throwable.class);
  when(error.getMessage()).thenReturn(ERROR_MESSAGE);
  pipelineExecutorExceptionCaptor = ArgumentCaptor.forClass(PipelineExecutorException.class);
  pipeline = mock(Pipeline.class);
  stages = mockStages(PIPELINE_STAGES_SIZE);
  when(pipeline.getStages()).thenReturn(stages);
  when(pipeline.getName()).thenReturn(PIPELINE_ID);
  when(pipelineRegistry.getPipelineByName(PIPELINE_ID)).thenReturn(pipeline);
  //pick an arbitrary stage for events testing.
  stage = stages.get(0);
  taskDef = mock(PipelineExecutorTaskDef.class);
  input = mock(Input.class);
  when(taskDef.getInput()).thenReturn(input);
  when(taskDef.getPipeline()).thenReturn(PIPELINE_ID);
  task = spy(taskManagerHelper.createTask(taskDef,
                      TASK_ID));
  taskEntry = mock(PipelineExecutorTaskManagerImpl.TaskEntry.class);
  when(taskEntry.getTask()).thenReturn(task);
  //emulate there's a running task.
  taskManager.currentTasks.put(TASK_ID,
                 taskEntry);
  taskManager.init();
}
origin: org.kie.workbench/kie-wb-common-ala-spi

  public void setTaskInStoppedStatus(final PipelineExecutorTaskImpl task) {
    task.setPipelineStatus(PipelineExecutorTask.Status.STOPPED);
    task.getTaskDef().getStages()
        .stream()
        .filter(stage -> PipelineExecutorTask.Status.RUNNING.equals(task.getStageStatus(stage)) ||
            PipelineExecutorTask.Status.SCHEDULED.equals(task.getStageStatus(stage)))
        .forEach(stage -> task.setStageStatus(stage,
                           PipelineExecutorTask.Status.STOPPED));
    task.clearErrors();
    task.setOutput(null);
  }
}
origin: org.kie.workbench/kie-wb-common-ala-spi

@Test
public void testExecuteSync() {
  when(taskManagerHelper.generateTaskId()).thenReturn(TASK_ID);
  taskManager.init();
  //prepare the input parameters.
  prepareExecution();
  String result = taskManager.execute(taskDef,
                    PipelineExecutorTaskManager.ExecutionMode.SYNCHRONOUS);
  assertEquals(TASK_ID,
         result);
  //verify the task to execute was properly initialized.
  verify(taskManagerHelper,
      times(1)).createTask(taskDef);
  //verify the pipeline was properly executed.
  verify(pipelineExecutor,
      times(1)).execute(eq(taskDef.getInput()),
               eq(pipeline),
               any(Consumer.class),
               eq(taskManager.localListener));
  //verify the pipeline executor registry was properly updated.
  verify(pipelineExecutorRegistry,
      times(1)).register(pipelineExecutorTraceCaptor.capture());
  assertEquals(PIPELINE_ID,
         pipelineExecutorTraceCaptor.getValue().getPipelineId());
  assertEquals(TASK_ID,
         pipelineExecutorTraceCaptor.getValue().getTaskId());
}
origin: org.kie.workbench/kie-wb-common-ala-spi

Pipeline pipeline = mock(Pipeline.class);
when(pipeline.getStages()).thenReturn(mock(List.class));
when(taskDef.getPipeline()).thenReturn(PIPELINE_ID);
org.guvnor.ala.pipeline.executionPipelineExecutorTaskDef

Javadoc

This class defines the information for performing the execution of a Pipeline by using the PipelineExecutorTaskManager.

Most used methods

  • getInput
  • getStages
  • getPipeline
  • getProviderId
  • getProviderType

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Path (java.nio.file)
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now