Search in sources :

Example 16 with DeploymentStatisticsQuery

use of org.camunda.bpm.engine.management.DeploymentStatisticsQuery in project camunda-bpm-platform by camunda.

the class DeploymentStatisticsAuthorizationTest method testQueryIncludingFailedJobsWithReadInstancePermissionOnAnyProcessDefinition.

public void testQueryIncludingFailedJobsWithReadInstancePermissionOnAnyProcessDefinition() {
    // given
    createGrantAuthorization(DEPLOYMENT, ANY, userId, READ);
    startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
    startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
    startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_START_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_START_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_START_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY);
    createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_INSTANCE);
    // when
    DeploymentStatisticsQuery query = managementService.createDeploymentStatisticsQuery().includeFailedJobs();
    // then
    List<DeploymentStatistics> statistics = query.list();
    for (DeploymentStatistics deploymentStatistics : statistics) {
        String id = deploymentStatistics.getId();
        if (id.equals(firstDeploymentId)) {
            verifyStatisticsResult(deploymentStatistics, 3, 3, 0);
        } else if (id.equals(secondDeploymentId)) {
            verifyStatisticsResult(deploymentStatistics, 3, 0, 0);
        } else if (id.equals(thirdDeploymentId)) {
            verifyStatisticsResult(deploymentStatistics, 3, 0, 0);
        } else {
            fail("Unexpected deployment");
        }
    }
}
Also used : DeploymentStatisticsQuery(org.camunda.bpm.engine.management.DeploymentStatisticsQuery) DeploymentStatistics(org.camunda.bpm.engine.management.DeploymentStatistics)

Example 17 with DeploymentStatisticsQuery

use of org.camunda.bpm.engine.management.DeploymentStatisticsQuery in project camunda-bpm-platform by camunda.

the class DeploymentStatisticsAuthorizationTest method testQueryIncludingIncidentsWithReadPermissionOnAnyProcessInstance.

public void testQueryIncludingIncidentsWithReadPermissionOnAnyProcessInstance() {
    // given
    createGrantAuthorization(DEPLOYMENT, ANY, userId, READ);
    startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
    startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
    startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_START_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_START_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_START_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY);
    createGrantAuthorization(PROCESS_INSTANCE, ANY, userId, READ);
    // when
    DeploymentStatisticsQuery query = managementService.createDeploymentStatisticsQuery().includeIncidents();
    // then
    List<DeploymentStatistics> statistics = query.list();
    for (DeploymentStatistics deploymentStatistics : statistics) {
        String id = deploymentStatistics.getId();
        if (id.equals(firstDeploymentId)) {
            verifyStatisticsResult(deploymentStatistics, 3, 0, 3);
        } else if (id.equals(secondDeploymentId)) {
            verifyStatisticsResult(deploymentStatistics, 3, 0, 0);
        } else if (id.equals(thirdDeploymentId)) {
            verifyStatisticsResult(deploymentStatistics, 3, 0, 0);
        } else {
            fail("Unexpected deployment");
        }
    }
}
Also used : DeploymentStatisticsQuery(org.camunda.bpm.engine.management.DeploymentStatisticsQuery) DeploymentStatistics(org.camunda.bpm.engine.management.DeploymentStatistics)

Example 18 with DeploymentStatisticsQuery

use of org.camunda.bpm.engine.management.DeploymentStatisticsQuery in project camunda-bpm-platform by camunda.

the class DeploymentStatisticsAuthorizationTest method testQueryIncludingFailedJobsAndIncidentsWithReadInstancePermissionOnProcessDefinition.

public void testQueryIncludingFailedJobsAndIncidentsWithReadInstancePermissionOnProcessDefinition() {
    // given
    createGrantAuthorization(DEPLOYMENT, ANY, userId, READ);
    startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
    startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
    startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_START_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_START_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_START_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY);
    createGrantAuthorization(PROCESS_DEFINITION, ONE_INCIDENT_PROCESS_KEY, userId, READ_INSTANCE);
    // when
    DeploymentStatisticsQuery query = managementService.createDeploymentStatisticsQuery().includeFailedJobs().includeIncidents();
    // then
    List<DeploymentStatistics> statistics = query.list();
    for (DeploymentStatistics deploymentStatistics : statistics) {
        String id = deploymentStatistics.getId();
        if (id.equals(firstDeploymentId)) {
            verifyStatisticsResult(deploymentStatistics, 3, 3, 3);
        } else if (id.equals(secondDeploymentId)) {
            verifyStatisticsResult(deploymentStatistics, 0, 0, 0);
        } else if (id.equals(thirdDeploymentId)) {
            verifyStatisticsResult(deploymentStatistics, 0, 0, 0);
        } else {
            fail("Unexpected deployment");
        }
    }
}
Also used : DeploymentStatisticsQuery(org.camunda.bpm.engine.management.DeploymentStatisticsQuery) DeploymentStatistics(org.camunda.bpm.engine.management.DeploymentStatistics)

Example 19 with DeploymentStatisticsQuery

use of org.camunda.bpm.engine.management.DeploymentStatisticsQuery in project camunda-bpm-platform by camunda.

the class DeploymentStatisticsAuthorizationTest method testQueryWithoutAuthorization.

// deployment statistics query without process instance authorizations /////////////////////////////////////////////
public void testQueryWithoutAuthorization() {
    // given
    // when
    DeploymentStatisticsQuery query = managementService.createDeploymentStatisticsQuery();
    // then
    verifyQueryResults(query, 0);
}
Also used : DeploymentStatisticsQuery(org.camunda.bpm.engine.management.DeploymentStatisticsQuery)

Example 20 with DeploymentStatisticsQuery

use of org.camunda.bpm.engine.management.DeploymentStatisticsQuery in project camunda-bpm-platform by camunda.

the class DeploymentStatisticsAuthorizationTest method testQueryWithReadPermissionOnAnyProcessInstance.

public void testQueryWithReadPermissionOnAnyProcessInstance() {
    // given
    createGrantAuthorization(DEPLOYMENT, ANY, userId, READ);
    startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
    startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
    startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_START_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_START_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_START_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY);
    startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY);
    createGrantAuthorization(PROCESS_INSTANCE, ANY, userId, READ);
    // when
    DeploymentStatisticsQuery query = managementService.createDeploymentStatisticsQuery();
    // then
    List<DeploymentStatistics> statistics = query.list();
    for (DeploymentStatistics deploymentStatistics : statistics) {
        String id = deploymentStatistics.getId();
        if (id.equals(firstDeploymentId)) {
            verifyStatisticsResult(deploymentStatistics, 3, 0, 0);
        } else if (id.equals(secondDeploymentId)) {
            verifyStatisticsResult(deploymentStatistics, 3, 0, 0);
        } else if (id.equals(thirdDeploymentId)) {
            verifyStatisticsResult(deploymentStatistics, 3, 0, 0);
        } else {
            fail("Unexpected deployment");
        }
    }
}
Also used : DeploymentStatisticsQuery(org.camunda.bpm.engine.management.DeploymentStatisticsQuery) DeploymentStatistics(org.camunda.bpm.engine.management.DeploymentStatistics)

Aggregations

DeploymentStatisticsQuery (org.camunda.bpm.engine.management.DeploymentStatisticsQuery)24 DeploymentStatistics (org.camunda.bpm.engine.management.DeploymentStatistics)18