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

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

            // then
            batch = managementService.CreateBatchQuery()
                    // .SetBatchId(batch.Id)
                    .First();
            Assert.True(batch.Suspended);
        }
Beispiel #2
0
        [Test]   public virtual void testDeleteBatch()
        {
            // given
            IBatch batch = batchHelper.MigrateProcessInstanceAsync(tenant1Definition, tenant1Definition);

            // when
            //identityService.SetAuthentication("user", null, singletonList(TENANT_ONE));
            managementService.DeleteBatch(batch.Id, true);
            identityService.ClearAuthentication();

            // then
            Assert.AreEqual(0, managementService.CreateBatchQuery().Count());
        }
        //JAVA TO C# CONVERTER TODO Resources.Task: Most Java annotations will not have direct .NET equivalent attributes:
        //ORIGINAL LINE: @After public void cleanBatch()
        public virtual void cleanBatch()
        {
            IBatch batch = managementService.CreateBatchQuery().First();

            if (batch != null)
            {
                managementService.DeleteBatch(batch.Id, true);
            }

            IHistoricBatch historicBatch = engineRule.HistoryService.CreateHistoricBatchQuery().First();

            if (historicBatch != null)
            {
                engineRule.HistoryService.DeleteHistoricBatch(historicBatch.Id);
            }
        }
Beispiel #4
0
        public virtual void removeBatch()
        {
            IBatch batch = managementService.CreateBatchQuery().First();

            if (batch != null)
            {
                managementService.DeleteBatch(batch.Id, true);
            }

            IHistoricBatch historicBatch = historyService.CreateHistoricBatchQuery().First();

            if (historicBatch != null)
            {
                historyService.DeleteHistoricBatch(historicBatch.Id);
            }
        }
        [Test]   public virtual void testBatchQueryNoAuthenticatedTenant()
        {
            // given
            identityService.SetAuthentication("user", null, null);

            // then
            IList <IBatch> batches = managementService.CreateBatchQuery()
                                     .ToList();

            Assert.AreEqual(1, batches.Count);
            Assert.AreEqual(sharedBatch.Id, batches[0].Id);

            Assert.AreEqual(1, managementService.CreateBatchQuery().Count());

            identityService.ClearAuthentication();
        }
Beispiel #6
0
        public virtual void testBatchQuery()
        {
            // given
            var batch1 = helper.MigrateProcessInstancesAsync(1);
            var batch2 = helper.MigrateProcessInstancesAsync(1);

            // when
            var list = managementService.CreateBatchQuery()

                       .ToList();

            // then
            Assert.AreEqual(2, list.Count);

            IList <string> batchIds = new List <string>();

            foreach (var resultBatch in list)
            {
                batchIds.Add(resultBatch.Id);
            }

            Assert.True(batchIds.Contains(batch1.Id));
            Assert.True(batchIds.Contains(batch2.Id));
        }