Handle calling into the test framework as needed to perform the test run, process the internal test dispatcher queue, and keep execution moving forward.
        /// <summary>
        /// Publish final results. If not yet ready, will keep waiting around
        /// as a work item until it is done.
        /// </summary>
        private void PublishFinalResults()
        {
            if (TestService != null && TestService.BusyServiceReferenceCounter > 0)
            {
                if (_harnessTasks == null)
                {
                    _harnessTasks = new CompositeWorkItem();
                }
                _harnessTasks.Enqueue(new CallbackWorkItem(() => { }));
                _harnessTasks.Enqueue(new CallbackWorkItem(PublishFinalResults));
                if (RunDispatcher == null)
                {
                    RunDispatcher = RunDispatcher.Create(RunNextStep, Dispatcher);
                    RunDispatcher.Run();
                }
            }
            else
            {
                _harnessTasks = null;
                RunDispatcher = null;
                PublishFinalResult();

                if (IsReportingTestServiceConnected())
                {
                    SetOverallStatus("Reporting complete...");
                }
            }
        }
        /// <summary>
        /// Restarts the run dispatcher.
        /// </summary>
        public virtual void RestartRunDispatcher()
        {
            if (_harnessTasks == null)
            {
                CreateHarnessTasks();
            }

            RunDispatcher           = RunDispatcher.Create(RunNextStep, Dispatcher);
            RunDispatcher.Complete += new EventHandler(RunDispatcherComplete);
            RunDispatcher.Run();
        }
示例#3
0
        /// <summary>
        /// Publish final results. If not yet ready, will keep waiting around
        /// as a work item until it is done.
        /// </summary>
        private void PublishFinalResults()
        {
            if (TestService != null && TestService.BusyServiceReferenceCounter > 0)
            {
                if (_harnessTasks == null)
                {
                    _harnessTasks = new CompositeWorkItem();
                }
                _harnessTasks.Enqueue(new CallbackWorkItem(() => { }));
                _harnessTasks.Enqueue(new CallbackWorkItem(PublishFinalResults));
                if (RunDispatcher == null)
                {
                    RunDispatcher = RunDispatcher.Create(RunNextStep, Dispatcher);
                    RunDispatcher.Run();
                }
            }
            else
            {
                _harnessTasks = null;
                RunDispatcher = null;
                PublishFinalResult();

                if (IsReportingTestServiceConnected())
                {
                    SetOverallStatus("Reporting complete...");
                }
            }
        }
示例#4
0
        protected void RunDispatcherComplete(object sender, EventArgs e)
        {
            RunDispatcher = null;

            OnTestHarnessCompleted();
            PublishResults();
        }
示例#5
0
        /// <summary>
        /// Restarts the run dispatcher.
        /// </summary>
        public virtual void RestartRunDispatcher()
        {
            if (_harnessTasks == null)
            {
                CreateHarnessTasks();
            }

            RunDispatcher = RunDispatcher.Create(RunNextStep, Dispatcher);
            RunDispatcher.Complete += new EventHandler(RunDispatcherComplete);
            RunDispatcher.Run();
        }
示例#6
0
文件: TestHarness.cs 项目: ynkbt/moon
 /// <summary>
 /// Restart the run method manager for the harness.
 /// </summary>
 public virtual void RestartRunDispatcher()
 {
     this.RunDispatcher           = RunDispatcher.Create(RunNextStep);
     this.RunDispatcher.Complete += new EventHandler(RunDispatcherComplete);
     this.RunDispatcher.Run();
 }