Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testHistoricBatchCompletion()
        public virtual void testHistoricBatchCompletion()
        {
            ProcessDefinition processDefinition = testRule.deployAndGetDefinition(instance);
            Batch             batch             = helper.startAfterAsync("process1", 1, "user1", processDefinition.Id);

            helper.executeSeedJob(batch);
            helper.executeJobs(batch);

            DateTime endDate = helper.addSecondsToClock(12);

            // when
            helper.executeMonitorJob(batch);

            // then the historic batch has an end time set
            HistoricBatch historicBatch = helper.getHistoricBatch(batch);

            assertNotNull(historicBatch);
            assertEquals(endDate, historicBatch.EndTime);
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testNoCreationOnSyncBatchJobExecution()
        public virtual void testNoCreationOnSyncBatchJobExecution()
        {
            // given
            ProcessDefinition processDefinition = testRule.deployAndGetDefinition(instance);

            ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinition.Id);

            Batch batch = runtimeService.createModification(processDefinition.Id).startAfterActivity("user2").processInstanceIds(Arrays.asList(processInstance.Id)).executeAsync();

            helper.executeSeedJob(batch);

            // when
            rule.IdentityService.AuthenticatedUserId = "userId";
            helper.executeJobs(batch);
            rule.IdentityService.clearAuthentication();

            // then
            Assert.assertEquals(0, rule.HistoryService.createUserOperationLogQuery().entityType(EntityTypes.PROCESS_INSTANCE).count());
        }