예제 #1
0
        public virtual void testQueryByTenantId()
        {
            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().tenantIdIn(TENANT_ONE);

            assertThat(query.count(), @is(1L));

            query = historyService.createHistoricCaseInstanceQuery().tenantIdIn(TENANT_TWO);

            assertThat(query.count(), @is(1L));
        }
예제 #2
0
        public virtual void testQueryByInvalidSubCaseInstanceId()
        {
            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery();

            query.subCaseInstanceId("invalid");

            assertEquals(0, query.count());
            assertEquals(0, query.list().size());

            query.caseInstanceId(null);

            assertEquals(0, query.count());
            assertEquals(0, query.list().size());
        }
예제 #3
0
        public virtual CountResultDto queryHistoricCaseInstancesCount(HistoricCaseInstanceQueryDto queryDto)
        {
            HistoricCaseInstanceQuery query = queryDto.toQuery(processEngine);

            long count = query.count();

            return(new CountResultDto(count));
        }
예제 #4
0
        public virtual void testQueryNoAuthenticatedTenants()
        {
            identityService.setAuthentication("user", null, null);

            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery();

            assertThat(query.count(), @is(1L));
        }
예제 #5
0
        public virtual void testQueryDisabledTenantCheck()
        {
            processEngineConfiguration.TenantCheckEnabled = false;
            identityService.setAuthentication("user", null, null);

            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery();

            assertThat(query.count(), @is(3L));
        }
예제 #6
0
        public virtual void testQueryAuthenticatedTenants()
        {
            identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));

            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery();

            assertThat(query.count(), @is(3L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(1L));
            assertThat(query.withoutTenantId().count(), @is(1L));
        }
예제 #7
0
        public virtual void testDistinctQueryByCaseActivityIds()
        {
            // given
            createCaseInstanceByKey("twoTaskCase");

            // when
            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().caseActivityIdIn("PI_HumanTask_1", "PI_HumanTask_2");

            // then
            assertEquals(1, query.list().size());
            assertEquals(1, query.count());
        }
예제 #8
0
        public virtual void testQueryBySuperCaseInstanceId()
        {
            string superCaseInstanceId = caseService.createCaseInstanceByKey("oneCaseTaskCase").Id;

            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().superCaseInstanceId(superCaseInstanceId);

            assertEquals(1, query.list().size());
            assertEquals(1, query.count());

            HistoricCaseInstance caseInstance = query.singleResult();

            assertEquals(superCaseInstanceId, caseInstance.SuperCaseInstanceId);
            assertNull(caseInstance.SuperProcessInstanceId);
        }
예제 #9
0
        public virtual void testQueryBySuperProcessInstanceId()
        {
            string superProcessInstanceId = runtimeService.startProcessInstanceByKey("subProcessQueryTest").Id;

            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().superProcessInstanceId(superProcessInstanceId);

            assertEquals(1, query.list().size());
            assertEquals(1, query.count());

            HistoricCaseInstance subCaseInstance = query.singleResult();

            assertNotNull(subCaseInstance);
            assertEquals(superProcessInstanceId, subCaseInstance.SuperProcessInstanceId);
            assertNull(subCaseInstance.SuperCaseInstanceId);
        }
예제 #10
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void deleteHistoricCaseInstanceWithAuthenticatedTenant()
        public virtual void deleteHistoricCaseInstanceWithAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, CMMN_PROCESS_WITH_MANUAL_ACTIVATION);
            string caseInstanceId = createAndCloseCaseInstance(null);

            identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));

            historyService.deleteHistoricCaseInstance(caseInstanceId);

            identityService.clearAuthentication();

            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery();

            assertThat(query.count(), @is(0L));
        }
예제 #11
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void deleteHistoricCaseInstanceWithDisabledTenantCheck()
        public virtual void deleteHistoricCaseInstanceWithDisabledTenantCheck()
        {
            testRule.deployForTenant(TENANT_ONE, CMMN_PROCESS_WITH_MANUAL_ACTIVATION);
            testRule.deployForTenant(TENANT_TWO, CMMN_PROCESS_WITH_MANUAL_ACTIVATION);

            string caseInstanceIdOne = createAndCloseCaseInstance(TENANT_ONE);
            string caseInstanceIdTwo = createAndCloseCaseInstance(TENANT_TWO);

            identityService.setAuthentication("user", null, null);
            processEngineConfiguration.TenantCheckEnabled = false;

            historyService.deleteHistoricCaseInstance(caseInstanceIdOne);
            historyService.deleteHistoricCaseInstance(caseInstanceIdTwo);

            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery();

            assertThat(query.count(), @is(0L));
        }
예제 #12
0
        public virtual void testQueryByNonExistingTenantId()
        {
            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().tenantIdIn("nonExisting");

            assertThat(query.count(), @is(0L));
        }
예제 #13
0
        public virtual void testQueryByInstancesWithoutTenantId()
        {
            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().withoutTenantId();

            assertThat(query.count(), @is(1L));
        }
예제 #14
0
        public virtual void testQueryNoTenantIdSet()
        {
            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery();

            assertThat(query.count(), @is(3L));
        }
예제 #15
0
 protected internal virtual void assertCount(long count, HistoricCaseInstanceQuery historicQuery)
 {
     assertEquals(count, historicQuery.count());
 }
예제 #16
0
        public virtual void testQueryByNonExistingCaseActivityId()
        {
            HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().caseActivityIdIn("nonExisting");

            assertEquals(0, query.count());
        }