예제 #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()
        {
            Batch batch = helper.migrateProcessInstancesAsync(1);

            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);
        }
예제 #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 sourceProcessDefinition = migrationRule.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
            ProcessDefinition targetProcessDefinition = migrationRule.deployAndGetDefinition(modify(ProcessModels.ONE_TASK_PROCESS).changeElementId(ProcessModels.PROCESS_KEY, "new" + ProcessModels.PROCESS_KEY));

            MigrationPlan migrationPlan = engineRule.RuntimeService.createMigrationPlan(sourceProcessDefinition.Id, targetProcessDefinition.Id).mapEqualActivities().build();

            ProcessInstance processInstance = engineRule.RuntimeService.startProcessInstanceById(sourceProcessDefinition.Id);
            Batch           batch           = engineRule.RuntimeService.newMigration(migrationPlan).processInstanceIds(Arrays.asList(processInstance.Id)).executeAsync();

            batchHelper.executeSeedJob(batch);

            // when
            engineRule.IdentityService.AuthenticatedUserId = USER_ID;
            batchHelper.executeJobs(batch);
            engineRule.IdentityService.clearAuthentication();

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