Beispiel #1
0
        public virtual void testJobRejectedExecutionMetricReporting()
        {
            // replace job executor with one that rejects all jobs
            RejectingJobExecutor rejectingExecutor = new RejectingJobExecutor();

            processEngineConfiguration.JobExecutor = rejectingExecutor;
            rejectingExecutor.registerProcessEngine((ProcessEngineImpl)processEngine);

            // given three jobs
            for (int i = 0; i < 3; i++)
            {
                runtimeService.startProcessInstanceByKey("asyncServiceTaskProcess");
            }

            // when executing the jobs
            waitForJobExecutorToProcessAllJobs(5000L);

            // then all of them were rejected by the job executor which is reflected by the metric
            long numRejectedJobs = managementService.createMetricsQuery().name(Metrics.JOB_EXECUTION_REJECTED).sum();

            assertEquals(3, numRejectedJobs);
        }
        public virtual void testJobRejectedExecutionMetricReporting()
        {
            // replace job executor with one that rejects all jobs
            var rejectingExecutor = new RejectingJobExecutor();

            processEngineConfiguration.SetJobExecutor(rejectingExecutor);
            rejectingExecutor.RegisterProcessEngine((ProcessEngineImpl)ProcessEngine);

            // given three jobs
            for (var i = 0; i < 3; i++)
            {
                runtimeService.StartProcessInstanceByKey("asyncServiceTaskProcess");
            }

            // when executing the jobs
            WaitForJobExecutorToProcessAllJobs(5000L);

            // then all of them were rejected by the job executor which is reflected by the metric
            var numRejectedJobs = managementService.CreateMetricsQuery()
                                  .Name(ESS.FW.Bpm.Engine.Management.Metrics.JobExecutionRejected)
                                  .Sum();

            Assert.AreEqual(3, numRejectedJobs);
        }
Beispiel #3
0
 public ThreadPoolExecutorAnonymousInnerClass(RejectingJobExecutor outerInstance, int corePoolSize, int maxPoolSize, UnknownType MILLISECONDS, BlockingQueue <ThreadStart> threadPoolQueue) : base(corePoolSize, maxPoolSize, 0L, MILLISECONDS, threadPoolQueue)
 {
     this.outerInstance = outerInstance;
 }