use of org.camunda.bpm.engine.history.DurationReportResult in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceDurationReportTest method testReportByStartedAfterAndStartedBeforeByMonth.
public void testReportByStartedAfterAndStartedBeforeByMonth() {
// given
deployment(createProcessWithUserTask("process"));
DurationReportResultAssertion assertion = createReportScenario().periodUnit(MONTH).startAndCompleteProcessInstance("process", 2016, 1, 15, 10, // 15.02.2016 10:00
0).startAndCompleteProcessInstance("process", 2016, 2, 1, 10, // 01.03.2016 10:00
0).done();
createReportScenario().startAndCompleteProcessInstance("process", 2016, 3, 15, 10, // 15.04.2016 10:00
0).done();
Calendar calendar = Calendar.getInstance();
calendar.set(2016, 0, 1, 0, 0, 0);
Date after = calendar.getTime();
calendar.set(2016, 2, 31, 23, 59, 59);
Date before = calendar.getTime();
// when
List<DurationReportResult> result = historyService.createHistoricProcessInstanceReport().startedAfter(after).startedBefore(before).duration(MONTH);
// then
assertThat(result).matches(assertion);
}
use of org.camunda.bpm.engine.history.DurationReportResult in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceDurationReportTest method testReportByStartedAfterByMonth.
public void testReportByStartedAfterByMonth() {
// given
deployment(createProcessWithUserTask("process"));
createReportScenario().startAndCompleteProcessInstance("process", 2015, 11, 15, 10, // 15.12.2015 10:00
0).done();
DurationReportResultAssertion assertion = createReportScenario().periodUnit(MONTH).startAndCompleteProcessInstance("process", 2016, 3, 1, 10, // 01.04.2016 10:00
0).done();
Calendar calendar = Calendar.getInstance();
calendar.set(2016, 0, 1, 0, 0, 0);
// when
List<DurationReportResult> result = historyService.createHistoricProcessInstanceReport().startedAfter(calendar.getTime()).duration(MONTH);
// then
assertThat(result).matches(assertion);
}
use of org.camunda.bpm.engine.history.DurationReportResult in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceDurationReportTest method testReportByStartedAfterByQuarter.
public void testReportByStartedAfterByQuarter() {
// given
deployment(createProcessWithUserTask("process"));
createReportScenario().startAndCompleteProcessInstance("process", 2015, 11, 15, 10, // 15.12.2015 10:00
0).done();
DurationReportResultAssertion assertion = createReportScenario().periodUnit(QUARTER).startAndCompleteProcessInstance("process", 2016, 3, 1, 10, // 01.04.2016 10:00
0).done();
Calendar calendar = Calendar.getInstance();
calendar.set(2016, 0, 1, 0, 0, 0);
// when
List<DurationReportResult> result = historyService.createHistoricProcessInstanceReport().startedAfter(calendar.getTime()).duration(QUARTER);
// then
assertThat(result).matches(assertion);
}
use of org.camunda.bpm.engine.history.DurationReportResult in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceDurationReportTest method testReportByStartedBeforeByQuarter.
public void testReportByStartedBeforeByQuarter() {
// given
deployment(createProcessWithUserTask("process"));
DurationReportResultAssertion assertion = createReportScenario().periodUnit(QUARTER).startAndCompleteProcessInstance("process", 2016, 0, 15, 10, // 15.01.2016 10:00
0).startAndCompleteProcessInstance("process", 2016, 0, 15, 10, // 15.01.2016 10:00
0).startAndCompleteProcessInstance("process", 2016, 0, 15, 10, // 15.01.2016 10:00
0).done();
// start a second process instance
createReportScenario().startAndCompleteProcessInstance("process", 2016, 3, 1, 10, // 01.04.2016 10:00
0).startAndCompleteProcessInstance("process", 2016, 3, 1, 10, // 01.04.2016 10:00
0).startAndCompleteProcessInstance("process", 2016, 3, 1, 10, // 01.04.2016 10:00
0).done();
Calendar calendar = Calendar.getInstance();
calendar.set(2016, 0, 16, 0, 0, 0);
// when
List<DurationReportResult> result = historyService.createHistoricProcessInstanceReport().startedBefore(calendar.getTime()).duration(QUARTER);
// then
assertThat(result).matches(assertion);
}
use of org.camunda.bpm.engine.history.DurationReportResult in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceDurationReportTest method testReportByStartedAfterAndStartedBeforeByQuarter.
public void testReportByStartedAfterAndStartedBeforeByQuarter() {
// given
deployment(createProcessWithUserTask("process"));
DurationReportResultAssertion assertion = createReportScenario().periodUnit(QUARTER).startAndCompleteProcessInstance("process", 2016, 1, 15, 10, // 15.02.2016 10:00
0).startAndCompleteProcessInstance("process", 2016, 2, 1, 10, // 01.03.2016 10:00
0).done();
createReportScenario().startAndCompleteProcessInstance("process", 2016, 3, 15, 10, // 15.04.2016 10:00
0).done();
Calendar calendar = Calendar.getInstance();
calendar.set(2016, 0, 1, 0, 0, 0);
Date after = calendar.getTime();
calendar.set(2016, 2, 31, 23, 59, 59);
Date before = calendar.getTime();
// when
List<DurationReportResult> result = historyService.createHistoricProcessInstanceReport().startedAfter(after).startedBefore(before).duration(QUARTER);
// then
assertThat(result).matches(assertion);
}
Aggregations