Package org.camunda.bpm.engine.management

Examples of org.camunda.bpm.engine.management.JobDefinitionQuery.list()


    List<JobDefinition> jobDefinitions = new ArrayList<JobDefinition>();
    JobDefinition mockJobDefinition = MockProvider.createMockJobDefinition();
    jobDefinitions.add(mockJobDefinition);

    JobDefinitionQuery mockJobDefinitionQuery = mock(JobDefinitionQuery.class);
    when(mockJobDefinitionQuery.list()).thenReturn(jobDefinitions);
    when(mockManagementService.createJobDefinitionQuery()).thenReturn(mockJobDefinitionQuery);
  }

  private void createIncidentMock() {
    IncidentQuery mockIncidentQuery = mock(IncidentQuery.class);
View Full Code Here


    assertEquals(jobDefinition.getId(), suspendedJobDefinition.getId());

    // there does not exist any active job definition
    jobDefinitionQuery = managementService.createJobDefinitionQuery().active();
    assertTrue(jobDefinitionQuery.list().isEmpty());

    // the corresponding job is still active
    JobQuery jobQuery = managementService.createJobQuery().active();

    assertEquals(1, jobQuery.count());
View Full Code Here

    assertEquals(jobDefinition.getId(), suspendedJobDefinition.getId());

    // there does not exist any active job definition
    jobDefinitionQuery = managementService.createJobDefinitionQuery().active();
    assertTrue(jobDefinitionQuery.list().isEmpty());

    // the corresponding job is still active
    JobQuery jobQuery = managementService.createJobQuery().active();

    assertEquals(1, jobQuery.count());
View Full Code Here

    assertEquals(jobDefinition.getId(), suspendedJobDefinition.getId());

    // there does not exist any active job definition
    jobDefinitionQuery = managementService.createJobDefinitionQuery().active();
    assertTrue(jobDefinitionQuery.list().isEmpty());

    // the corresponding job is still active
    JobQuery jobQuery = managementService.createJobQuery();

    assertEquals(0, jobQuery.suspended().count());
View Full Code Here

  @Deployment(resources = {"org/camunda/bpm/engine/test/jobexecutor/JobDefinitionDeploymentTest.testAsyncContinuation.bpmn20.xml",
      "org/camunda/bpm/engine/test/jobexecutor/JobDefinitionDeploymentTest.testMultipleProcessesWithinDeployment.bpmn20.xml"})
  public void testMultipleProcessDeployment() {
    JobDefinitionQuery query = managementService.createJobDefinitionQuery();
    List<JobDefinition> jobDefinitions = query.list();
    assertEquals(3, jobDefinitions.size());

    assertEquals(1, query.processDefinitionKey("testProcess").list().size());
    assertEquals(2, query.processDefinitionKey("anotherTestProcess").list().size());
  }
View Full Code Here

    List<JobDefinition> matchingJobDefinitions;
    if (firstResult != null || maxResults != null) {
      matchingJobDefinitions = executePaginatedQuery(query, firstResult, maxResults);
    } else {
      matchingJobDefinitions = query.list();
    }

    List<JobDefinitionDto> jobDefinitionResults = new ArrayList<JobDefinitionDto>();
    for (JobDefinition jobDefinition : matchingJobDefinitions) {
      JobDefinitionDto result = JobDefinitionDto.fromJobDefinition(jobDefinition);
View Full Code Here

  }

  private JobDefinitionQuery setUpMockDefinitionQuery(List<JobDefinition> mockedJobDefinitions) {
    JobDefinitionQuery query = mock(JobDefinitionQuery.class);

    when(query.list()).thenReturn(mockedJobDefinitions);
    when(query.count()).thenReturn((long) mockedJobDefinitions.size());
    when(processEngine.getManagementService().createJobDefinitionQuery()).thenReturn(query);

    return query;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.