示例#1
0
        private string prepareHistoricBatches(int batchesCount)
        {
            DateTime startDate = ClockUtil.CurrentTime;

            ClockUtil.CurrentTime = DateUtils.addDays(startDate, daysInThePast);

            IList <Batch> list = new List <Batch>();

            for (int i = 0; i < batchesCount; i++)
            {
                list.Add(helper.migrateProcessInstancesAsync(1));
            }

            Batch  batch1    = list[0];
            string batchType = batch1.Type;

            helper.executeSeedJob(batch1);
            helper.executeJobs(batch1);
            ClockUtil.CurrentTime = DateUtils.addDays(startDate, batch1EndTime);
            helper.executeMonitorJob(batch1);

            Batch batch2 = list[1];

            helper.executeSeedJob(batch2);
            helper.executeJobs(batch2);
            ClockUtil.CurrentTime = DateUtils.addDays(startDate, batch2EndTime);
            helper.executeMonitorJob(batch2);

            ClockUtil.CurrentTime = DateTime.Now;

            return(batchType);
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testBatchQueryResult()
        public virtual void testBatchQueryResult()
        {
            DateTime startDate = new DateTime(10000L);
            DateTime endDate   = new DateTime(40000L);

            // given
            ClockUtil.CurrentTime = startDate;
            Batch batch = helper.migrateProcessInstancesAsync(1);

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

            ClockUtil.CurrentTime = endDate;
            helper.executeMonitorJob(batch);

            // when
            HistoricBatch resultBatch = historyService.createHistoricBatchQuery().singleResult();

            // then
            Assert.assertNotNull(resultBatch);

            assertEquals(batch.Id, resultBatch.Id);
            assertEquals(batch.BatchJobDefinitionId, resultBatch.BatchJobDefinitionId);
            assertEquals(batch.MonitorJobDefinitionId, resultBatch.MonitorJobDefinitionId);
            assertEquals(batch.SeedJobDefinitionId, resultBatch.SeedJobDefinitionId);
            assertEquals(batch.TenantId, resultBatch.TenantId);
            assertEquals(batch.Type, resultBatch.Type);
            assertEquals(batch.BatchJobsPerSeed, resultBatch.BatchJobsPerSeed);
            assertEquals(batch.InvocationsPerBatchJob, resultBatch.InvocationsPerBatchJob);
            assertEquals(batch.TotalJobs, resultBatch.TotalJobs);
            assertEquals(startDate, resultBatch.StartTime);
            assertEquals(endDate, resultBatch.EndTime);
        }
示例#3
0
        private void prepareHistoricBatches(int batchesCount, int daysInThePast)
        {
            DateTime startDate = ClockUtil.CurrentTime;

            ClockUtil.CurrentTime = DateUtils.addDays(startDate, daysInThePast);

            IList <Batch> list = new List <Batch>();

            for (int i = 0; i < batchesCount; i++)
            {
                list.Add(migrationHelper.migrateProcessInstancesAsync(1));
            }

            foreach (Batch batch in list)
            {
                migrationHelper.executeSeedJob(batch);
                migrationHelper.executeJobs(batch);

                ClockUtil.CurrentTime = DateUtils.setMinutes(DateUtils.addDays(startDate, ++daysInThePast), random.Next(60));
                migrationHelper.executeMonitorJob(batch);
            }

            ClockUtil.CurrentTime = DateTime.Now;
        }