Exemplo n.º 1
0
        public virtual void seedJobShouldHaveDefaultPriority()
        {
            // when
            var batch = helper.MigrateProcessInstancesAsync(1);

            // then
            var seedJob = helper.GetSeedJob(batch);

            Assert.AreEqual(DefaultJobPriorityProvider.DEFAULT_PRIORITY, seedJob.Priority);
        }
Exemplo n.º 2
0
        public virtual void shouldSuspendSeedJobAndDefinition()
        {
            // given
            var batch = helper.MigrateProcessInstancesAsync(1);

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

            // then
            var seedJobDefinition = helper.GetSeedJobDefinition(batch);

            Assert.True(seedJobDefinition.Suspended);

            var seedJob = helper.GetSeedJob(batch);

            Assert.True(seedJob.Suspended);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        public virtual void testStatisticsMostExecutionJobsGenerated()
        {
            // given
            var batch = helper.CreateMigrationBatchWithSize(13);

            // when
            helper.ExecuteJob(helper.GetSeedJob(batch));

            // then
            var batchStatistics = managementService.CreateBatchStatisticsQuery()
                                  .First();

            Assert.AreEqual(13, batchStatistics.TotalJobs);
            Assert.AreEqual(10, batchStatistics.JobsCreated);
            Assert.AreEqual(13, batchStatistics.RemainingJobs);
            Assert.AreEqual(0, batchStatistics.CompletedJobs);
            Assert.AreEqual(0, batchStatistics.FailedJobs);
        }