public virtual void shouldCreateSuspendedSeedJob() { // given var batch = helper.MigrateProcessInstancesAsync(2); managementService.SuspendBatchById(batch.Id); // when helper.ExecuteSeedJob(batch); // then var seedJob = helper.GetSeedJob(batch); Assert.True(seedJob.Suspended); }
public virtual void testBatchQueryResult() { var startDate = new DateTime(10000L); var endDate = new DateTime(40000L); // given ClockUtil.CurrentTime = startDate; var batch = helper.MigrateProcessInstancesAsync(1); helper.ExecuteSeedJob(batch); helper.ExecuteJobs(batch); ClockUtil.CurrentTime = endDate; helper.ExecuteMonitorJob(batch); // when var resultBatch = historyService.CreateHistoricBatchQuery() .First(); // then Assert.NotNull(resultBatch); Assert.AreEqual(batch.Id, resultBatch.Id); Assert.AreEqual(batch.BatchJobDefinitionId, resultBatch.BatchJobDefinitionId); Assert.AreEqual(batch.MonitorJobDefinitionId, resultBatch.MonitorJobDefinitionId); Assert.AreEqual(batch.SeedJobDefinitionId, resultBatch.SeedJobDefinitionId); Assert.AreEqual(batch.TenantId, resultBatch.TenantId); Assert.AreEqual(batch.Type, resultBatch.Type); Assert.AreEqual(batch.BatchJobsPerSeed, resultBatch.BatchJobsPerSeed); Assert.AreEqual(batch.InvocationsPerBatchJob, resultBatch.InvocationsPerBatchJob); Assert.AreEqual(batch.TotalJobs, resultBatch.TotalJobs); Assert.AreEqual(startDate, resultBatch.StartTime); Assert.AreEqual(endDate, resultBatch.EndTime); }
public virtual void monitorJobShouldHaveDefaultPriority() { // given var batch = helper.MigrateProcessInstancesAsync(1); // when helper.ExecuteSeedJob(batch); // then var monitorJob = helper.GetMonitorJob(batch); Assert.AreEqual(DefaultJobPriorityProvider.DEFAULT_PRIORITY, monitorJob.Priority); }
public virtual void canMigrateInstanceBetweenSameTenantCase1() { // given IProcessDefinition sourceDefinition = defaultTestRule.DeployForTenantAndGetDefinition(TENANT_ONE, 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 AssertMigratedTo(processInstance, targetDefinition); }
[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); }