Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @Deployment public void testMultipleTasks()
        public virtual void testMultipleTasks()
        {
            // given
            string caseDefinitionId = CaseDefinition.Id;

            createCaseByKey(5, "case");

            disableByActivity("DISABLED");
            completeByActivity("COMPLETED");
            terminateByActivity("TERMINATED");

            // when
            HistoricCaseActivityStatisticsQuery query = historyService.createHistoricCaseActivityStatisticsQuery(caseDefinitionId);

            // then
            IList <HistoricCaseActivityStatistics> statistics = query.list();

            assertThat(statistics.Count, @is(6));
            assertEquals(query.count(), 6);

            assertStatisitcs(statistics[0], "ACTIVE", 5, 0, 0, 0, 0, 0);
            assertStatisitcs(statistics[1], "AVAILABLE", 0, 5, 0, 0, 0, 0);
            assertStatisitcs(statistics[2], "COMPLETED", 0, 0, 5, 0, 0, 0);
            assertStatisitcs(statistics[3], "DISABLED", 0, 0, 0, 5, 0, 0);
            assertStatisitcs(statistics[4], "ENABLED", 0, 0, 0, 0, 5, 0);
            assertStatisitcs(statistics[5], "TERMINATED", 0, 0, 0, 0, 0, 5);
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @BeforeClass public static void setUpRuntimeData()
        public static void setUpRuntimeData()
        {
            IList <HistoricCaseActivityStatistics> mocks = MockProvider.createMockHistoricCaseActivityStatistics();

            historicCaseActivityStatisticsQuery = mock(typeof(HistoricCaseActivityStatisticsQuery));
            when(processEngine.HistoryService.createHistoricCaseActivityStatisticsQuery(eq(MockProvider.EXAMPLE_CASE_DEFINITION_ID))).thenReturn(historicCaseActivityStatisticsQuery);
            when(historicCaseActivityStatisticsQuery.list()).thenReturn(mocks);
        }
Example #3
0
        public virtual void testNoCaseActivityInstances()
        {
            // given
            string caseDefinitionId = CaseDefinition.Id;

            // when
            HistoricCaseActivityStatisticsQuery query = historyService.createHistoricCaseActivityStatisticsQuery(caseDefinitionId);

            // then
            assertEquals(0, query.count());
            assertThat(query.list().size(), @is(0));
        }
Example #4
0
        public virtual void testSingleTask()
        {
            // given
            string caseDefinitionId = CaseDefinition.Id;

            createCaseByKey(5, "oneTaskCase");

            // when
            HistoricCaseActivityStatisticsQuery query = historyService.createHistoricCaseActivityStatisticsQuery(caseDefinitionId);

            // then
            IList <HistoricCaseActivityStatistics> statistics = query.list();

            assertEquals(1, query.count());
            assertThat(statistics.Count, @is(1));
            assertStatisitcs(statistics[0], "PI_HumanTask_1", 5, 0, 0, 0, 0, 0);
        }
Example #5
0
        public virtual void testMultipleCaseDefinitions()
        {
            // given
            string caseDefinitionId1 = getCaseDefinition("oneTaskCase").Id;
            string caseDefinitionId2 = getCaseDefinition("case").Id;

            createCaseByKey(5, "oneTaskCase");
            createCaseByKey(10, "case");

            // when
            HistoricCaseActivityStatisticsQuery query1 = historyService.createHistoricCaseActivityStatisticsQuery(caseDefinitionId1);
            HistoricCaseActivityStatisticsQuery query2 = historyService.createHistoricCaseActivityStatisticsQuery(caseDefinitionId2);

            // then
            assertThat(query1.list().size(), @is(1));
            assertThat(query2.list().size(), @is(6));
        }