Exemple #1
0
        public virtual void batchExecutionJobShouldHaveDefaultPriority()
        {
            // given
            var batch = helper.MigrateProcessInstancesAsync(1);

            // when
            helper.ExecuteSeedJob(batch);

            // then
            var executionJob = helper.GetExecutionJobs(batch)[0];

            Assert.AreEqual(DefaultJobPriorityProvider.DEFAULT_PRIORITY, executionJob.Priority);
        }
 protected internal virtual void deleteMigrationJobs(IBatch batch)
 {
     foreach (var migrationJob in helper.GetExecutionJobs(batch))
     {
         managementService.DeleteJob(migrationJob.Id);
     }
 }
Exemple #3
0
        public virtual void shouldSuspendExecutionJobsAndDefinition()
        {
            // given
            var batch = helper.MigrateProcessInstancesAsync(1);

            helper.ExecuteSeedJob(batch);

            // when
            managementService.SuspendBatchById(batch.Id);

            // then
            var migrationJobDefinition = helper.GetExecutionJobDefinition(batch);

            Assert.True(migrationJobDefinition.Suspended);

            var migrationJob = helper.GetExecutionJobs(batch)[0];

            Assert.True(migrationJob.Suspended);
        }
Exemple #4
0
        [Test]   public virtual void testBatchJobsTenantId()
        {
            // given
            IBatch batch = batchHelper.MigrateProcessInstanceAsync(tenant1Definition, tenant1Definition);

            // then
            IJob seedJob = batchHelper.GetSeedJob(batch);

            Assert.AreEqual(TENANT_ONE, seedJob.TenantId);

            batchHelper.ExecuteSeedJob(batch);

            IList <IJob> migrationJob = batchHelper.GetExecutionJobs(batch);

            Assert.AreEqual(TENANT_ONE, migrationJob[0].TenantId);

            IJob monitorJob = batchHelper.GetMonitorJob(batch);

            Assert.AreEqual(TENANT_ONE, monitorJob.TenantId);
        }
        public virtual void cannotMigrateInstanceWithoutTenantIdToDifferentTenant()
        {
            // given
            IProcessDefinition sourceDefinition = defaultTestRule.DeployAndGetDefinition(ProcessModels.OneTaskProcess);
            IProcessDefinition targetDefinition = defaultTestRule.DeployForTenantAndGetDefinition(TENANT_ONE, ProcessModels.OneTaskProcess);

            IProcessInstance processInstance = defaultEngineRule.RuntimeService.StartProcessInstanceById(sourceDefinition.Id);
            IMigrationPlan   migrationPlan   = defaultEngineRule.RuntimeService.CreateMigrationPlan(sourceDefinition.Id, targetDefinition.Id).MapEqualActivities().Build();

            IBatch batch = defaultEngineRule.RuntimeService.NewMigration(migrationPlan).ProcessInstanceIds((processInstance.Id)).ExecuteAsync();

            batchHelper.ExecuteSeedJob(batch);

            // when
            batchHelper.ExecuteJobs(batch);

            // then
            IJob migrationJob = batchHelper.GetExecutionJobs(batch)[0];
            //Assert.That(migrationJob.ExceptionMessage, CoreMatchers.Does.Contain("Cannot migrate process instance '" + processInstance.Id + "' without tenant to a process definition with a tenant ('tenant1')"));
        }