Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void suspendProcessDefinitionForNonTenant()
        public virtual void suspendProcessDefinitionForNonTenant()
        {
            // given activated process definitions
            ProcessDefinitionQuery query = engineRule.RepositoryService.createProcessDefinitionQuery();

            assertThat(query.active().count(), @is(3L));
            assertThat(query.suspended().count(), @is(0L));

            engineRule.RepositoryService.updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionWithoutTenantId().suspend();

            assertThat(query.active().count(), @is(2L));
            assertThat(query.suspended().count(), @is(1L));
            assertThat(query.suspended().withoutTenantId().count(), @is(1L));
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void suspendProcessDefinitionNoAuthenticatedTenants()
        public virtual void suspendProcessDefinitionNoAuthenticatedTenants()
        {
            // given activated process definitions
            ProcessDefinitionQuery query = engineRule.RepositoryService.createProcessDefinitionQuery();

            assertThat(query.active().count(), @is(3L));
            assertThat(query.suspended().count(), @is(0L));

            engineRule.IdentityService.setAuthentication("user", null, null);

            engineRule.RepositoryService.updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend();

            engineRule.IdentityService.clearAuthentication();

            assertThat(query.active().count(), @is(2L));
            assertThat(query.suspended().count(), @is(1L));
            assertThat(query.suspended().withoutTenantId().count(), @is(1L));
        }
Пример #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void suspendProcessDefinitionDisabledTenantCheck()
        public virtual void suspendProcessDefinitionDisabledTenantCheck()
        {
            // given activated process definitions
            ProcessDefinitionQuery query = engineRule.RepositoryService.createProcessDefinitionQuery();

            assertThat(query.active().count(), @is(3L));
            assertThat(query.suspended().count(), @is(0L));

            ProcessEngineConfigurationImpl processEngineConfiguration = engineRule.ProcessEngineConfiguration;

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

            engineRule.RepositoryService.updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend();

            assertThat(query.active().count(), @is(0L));
            assertThat(query.suspended().count(), @is(3L));
            assertThat(query.suspended().tenantIdIn(TENANT_ONE, TENANT_TWO).includeProcessDefinitionsWithoutTenantId().count(), @is(3L));
        }
Пример #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void suspendAndActivateProcessDefinitionsForAllTenants()
        public virtual void suspendAndActivateProcessDefinitionsForAllTenants()
        {
            // given activated process definitions
            ProcessDefinitionQuery query = engineRule.RepositoryService.createProcessDefinitionQuery();

            assertThat(query.active().count(), @is(3L));
            assertThat(query.suspended().count(), @is(0L));

            // first suspend
            engineRule.RepositoryService.updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend();

            assertThat(query.active().count(), @is(0L));
            assertThat(query.suspended().count(), @is(3L));

            // then activate
            engineRule.RepositoryService.updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).activate();

            assertThat(query.active().count(), @is(3L));
            assertThat(query.suspended().count(), @is(0L));
        }
Пример #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void delayedSuspendProcessDefinitionsForAllTenants()
        public virtual void delayedSuspendProcessDefinitionsForAllTenants()
        {
            // given activated process definitions

            engineRule.RepositoryService.updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).executionDate(tomorrow()).suspend();

            ProcessDefinitionQuery query = engineRule.RepositoryService.createProcessDefinitionQuery();

            assertThat(query.active().count(), @is(3L));
            assertThat(query.suspended().count(), @is(0L));

            // when execute the job to suspend the process definitions
            Job job = engineRule.ManagementService.createJobQuery().timers().singleResult();

            assertThat(job, @is(notNullValue()));

            engineRule.ManagementService.executeJob(job.Id);

            assertThat(query.active().count(), @is(0L));
            assertThat(query.suspended().count(), @is(3L));
        }