示例#1
0
        /// <summary>
        /// Starts the test run
        /// </summary>
        /// <param name="adapterSourceMap"> The adapter Source Map.  </param>
        /// <param name="package">The user input test source(package) if it differ from actual test source otherwise null.</param>
        /// <param name="runSettings"> The run Settings.  </param>
        /// <param name="testExecutionContext"> The test Execution Context. </param>
        /// <param name="testCaseEventsHandler"> EventHandler for handling test cases level events from Engine. </param>
        /// <param name="runEventsHandler"> EventHandler for handling execution events from Engine.  </param>
        public void StartTestRun(
            Dictionary <string, IEnumerable <string> > adapterSourceMap,
            string package,
            string runSettings,
            TestExecutionContext testExecutionContext,
            ITestCaseEventsHandler testCaseEventsHandler,
            ITestRunEventsHandler runEventsHandler)
        {
            this.testRunEventsHandler = runEventsHandler;
            try
            {
                this.activeTestRun = new RunTestsWithSources(this.requestData, adapterSourceMap, package, runSettings, testExecutionContext, testCaseEventsHandler, runEventsHandler);

                this.activeTestRun.RunTests();
            }
            catch (Exception e)
            {
                this.testRunEventsHandler.HandleLogMessage(ObjectModel.Logging.TestMessageLevel.Error, e.ToString());
                this.Abort();
            }
            finally
            {
                this.activeTestRun = null;
            }
        }
示例#2
0
        /// <summary>
        /// Starts the test run
        /// </summary>
        /// <param name="adapterSourceMap"> The adapter Source Map.  </param>
        /// <param name="package">The user input test source(package) if it differ from actual test source otherwise null.</param>
        /// <param name="runSettings"> The run Settings.  </param>
        /// <param name="testExecutionContext"> The test Execution Context. </param>
        /// <param name="testCaseEventsHandler"> EventHandler for handling test cases level events from Engine. </param>
        /// <param name="runEventsHandler"> EventHandler for handling execution events from Engine.  </param>
        public void StartTestRun(
            Dictionary <string, IEnumerable <string> > adapterSourceMap,
            string package,
            string runSettings,
            TestExecutionContext testExecutionContext,
            ITestCaseEventsHandler testCaseEventsHandler,
            ITestRunEventsHandler runEventsHandler)
        {
            try
            {
                this.InitializeDataCollectors(runSettings, testCaseEventsHandler as ITestEventsPublisher, TestSourcesUtility.GetDefaultCodebasePath(adapterSourceMap));

                this.activeTestRun = new RunTestsWithSources(this.requestData, adapterSourceMap, package, runSettings, testExecutionContext, testCaseEventsHandler, runEventsHandler);

                this.activeTestRun.RunTests();
            }
            catch (Exception e)
            {
                runEventsHandler.HandleLogMessage(TestMessageLevel.Error, e.ToString());
                this.Abort(runEventsHandler);
            }
            finally
            {
                this.activeTestRun = null;
            }
        }
示例#3
0
        /// <summary>
        /// Starts the test run with tests.
        /// </summary>
        /// <param name="tests"> The test list. </param>
        /// <param name="runSettings"> The run Settings.  </param>
        /// <param name="testExecutionContext"> The test Execution Context. </param>
        /// <param name="testCaseEventsHandler"> EventHandler for handling test cases level events from Engine. </param>
        /// <param name="runEventsHandler"> EventHandler for handling execution events from Engine. </param>
        public void StartTestRun(
            IEnumerable <TestCase> tests,
            string runSettings,
            TestExecutionContext testExecutionContext,
            ITestCaseEventsHandler testCaseEventsHandler,
            ITestRunEventsHandler runEventsHandler)
        {
            this.testRunEventsHandler = runEventsHandler;

            try
            {
                this.activeTestRun = new RunTestsWithTests(
                    tests,
                    runSettings,
                    testExecutionContext,
                    testCaseEventsHandler,
                    runEventsHandler);

                this.activeTestRun.RunTests();
            }
            catch (Exception e)
            {
                this.testRunEventsHandler.HandleLogMessage(ObjectModel.Logging.TestMessageLevel.Error, e.ToString());
                this.Abort();
            }
            finally
            {
                this.activeTestRun = null;
            }
        }
示例#4
0
        /// <summary>
        /// Starts the test run with tests.
        /// </summary>
        /// <param name="tests"> The test list. </param>
        /// <param name="runSettings"> The run Settings.  </param>
        /// <param name="testExecutionContext"> The test Execution Context. </param>
        /// <param name="testCaseEventsHandler"> EventHandler for handling test cases level events from Engine. </param>
        /// <param name="runEventsHandler"> EventHandler for handling execution events from Engine. </param>
        public void StartTestRun(
            IEnumerable <TestCase> tests,
            string runSettings,
            TestExecutionContext testExecutionContext,
            ITestCaseEventsHandler testCaseEventsHandler,
            ITestRunEventsHandler runEventsHandler)
        {
            this.testRunEventsHandler = runEventsHandler;

            try
            {
                this.activeTestRun = new RunTestsWithTests(
                    tests,
                    runSettings,
                    testExecutionContext,
                    testCaseEventsHandler,
                    runEventsHandler);

                this.activeTestRun.RunTests();
            }
            finally
            {
                this.activeTestRun = null;
            }
        }
示例#5
0
        /// <summary>
        /// Starts the test run
        /// </summary>
        /// <param name="adapterSourceMap"> The adapter Source Map.  </param>
        /// <param name="runSettings"> The run Settings.  </param>
        /// <param name="testExecutionContext"> The test Execution Context. </param>
        /// <param name="testCaseEventsHandler"> EventHandler for handling test cases level events from Engine. </param>
        /// <param name="runEventsHandler"> EventHandler for handling execution events from Engine.  </param>
        public void StartTestRun(
            Dictionary <string, IEnumerable <string> > adapterSourceMap,
            string runSettings,
            TestExecutionContext testExecutionContext,
            ITestCaseEventsHandler testCaseEventsHandler,
            ITestRunEventsHandler runEventsHandler)
        {
            this.testRunEventsHandler = runEventsHandler;
            try
            {
                this.activeTestRun = new RunTestsWithSources(
                    adapterSourceMap,
                    runSettings,
                    testExecutionContext,
                    testCaseEventsHandler,
                    runEventsHandler);

                this.activeTestRun.RunTests();
            }
            finally
            {
                this.activeTestRun = null;
            }
        }