protected InProcDataCollectionExtensionManager(string runSettings, ITestEventsPublisher testEventsPublisher, string defaultCodeBase, TestPluginCache testPluginCache, IFileHelper fileHelper)
        {
            this.InProcDataCollectors     = new Dictionary <string, IInProcDataCollector>();
            this.inProcDataCollectionSink = new InProcDataCollectionSink();
            this.defaultCodeBase          = defaultCodeBase;
            this.fileHelper    = fileHelper;
            this.codeBasePaths = new List <string> {
                this.defaultCodeBase
            };

            // Get Datacollector codebase paths from test plugin cache
            var extensionPaths = testPluginCache.GetExtensionPaths(DataCollectorEndsWithPattern);

            foreach (var extensionPath in extensionPaths)
            {
                this.codeBasePaths.Add(Path.GetDirectoryName(extensionPath));
            }

            // Initialize InProcDataCollectors
            this.InitializeInProcDataCollectors(runSettings);

            if (this.IsInProcDataCollectionEnabled)
            {
                testEventsPublisher.TestCaseEnd   += this.TriggerTestCaseEnd;
                testEventsPublisher.TestCaseStart += this.TriggerTestCaseStart;
                testEventsPublisher.TestResult    += this.TriggerUpdateTestResult;
                testEventsPublisher.SessionStart  += this.TriggerTestSessionStart;
                testEventsPublisher.SessionEnd    += this.TriggerTestSessionEnd;
            }
        }
Exemplo n.º 2
0
 public TestableBaseRunTests(
     IRequestData requestData,
     string package,
     string runSettings,
     TestExecutionContext testExecutionContext,
     ITestCaseEventsHandler testCaseEventsHandler,
     ITestRunEventsHandler testRunEventsHandler,
     ITestPlatformEventSource testPlatformEventSource,
     ITestEventsPublisher testEventsPublisher,
     IThread platformThread,
     IDataSerializer dataSerializer)
     : base(
         requestData,
         package,
         runSettings,
         testExecutionContext,
         testCaseEventsHandler,
         testRunEventsHandler,
         testPlatformEventSource,
         testEventsPublisher,
         platformThread,
         dataSerializer)
 {
     this.testCaseEventsHandler = testCaseEventsHandler;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseRunTests"/> class.
        /// </summary>
        /// <param name="requestData">Provides services and data for execution</param>
        /// <param name="package">The user input test source(package) list if it differs 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">The test case events handler.</param>
        /// <param name="testRunEventsHandler">The test run events handler.</param>
        /// <param name="testPlatformEventSource">Test platform event source.</param>
        /// <param name="testEventsPublisher">Publisher for test events.</param>
        /// <param name="platformThread">Platform Thread.</param>
        /// <param name="dataSerializer">Data Serializer for cloning TestCase and test results object.</param>
        protected BaseRunTests(
            IRequestData requestData,
            string package,
            string runSettings,
            TestExecutionContext testExecutionContext,
            ITestCaseEventsHandler testCaseEventsHandler,
            ITestRunEventsHandler testRunEventsHandler,
            ITestPlatformEventSource testPlatformEventSource,
            ITestEventsPublisher testEventsPublisher,
            IThread platformThread,
            IDataSerializer dataSerializer)
        {
            this.package               = package;
            this.runSettings           = runSettings;
            this.testExecutionContext  = testExecutionContext;
            this.testCaseEventsHandler = testCaseEventsHandler;
            this.testRunEventsHandler  = testRunEventsHandler;
            this.requestData           = requestData;

            this.isCancellationRequested = false;
            this.testPlatformEventSource = testPlatformEventSource;
            this.testEventsPublisher     = testEventsPublisher;
            this.platformThread          = platformThread;
            this.dataSerializer          = dataSerializer;
            this.SetContext();
        }
Exemplo n.º 4
0
 public TestableBaseRunTests(
     string runSettings,
     TestExecutionContext testExecutionContext,
     ITestCaseEventsHandler testCaseEventsHandler,
     ITestRunEventsHandler testRunEventsHandler,
     ITestPlatformEventSource testPlatformEventSource,
     ITestEventsPublisher testEventsPublisher,
     IThread platformThread)
     : base(runSettings, testExecutionContext, testCaseEventsHandler, testRunEventsHandler, testPlatformEventSource, testEventsPublisher, platformThread)
 {
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProxyOutOfProcDataCollectionManager"/> class.
        /// </summary>
        /// <param name="dataCollectionTestCaseEventSender">
        /// The data collection test case event sender.
        /// </param>
        /// <param name="dataCollectionTestCaseEventManager">
        /// The data collection test case event manager.
        /// </param>
        public ProxyOutOfProcDataCollectionManager(IDataCollectionTestCaseEventSender dataCollectionTestCaseEventSender, ITestEventsPublisher testEventsPublisher)
        {
            this.attachmentsCache    = new Dictionary <Guid, Collection <AttachmentSet> >();
            this.testEventsPublisher = testEventsPublisher;
            this.dataCollectionTestCaseEventSender = dataCollectionTestCaseEventSender;

            this.testEventsPublisher.TestCaseStart += this.TriggerTestCaseStart;
            this.testEventsPublisher.TestCaseEnd   += this.TriggerTestCaseEnd;
            this.testEventsPublisher.TestResult    += TriggerSendTestResult;
            this.testEventsPublisher.SessionEnd    += this.TriggerTestSessionEnd;
            this.attachmentsCache = new Dictionary <Guid, Collection <AttachmentSet> >();
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseRunTests"/> class.
        /// </summary>
        /// <param name="runSettings"> The run settings.</param>
        /// <param name="testExecutionContext">The test execution context.</param>
        /// <param name="testCaseEventsHandler">The test case events handler.</param>
        /// <param name="testRunEventsHandler">The test run events handler.</param>
        /// <param name="testPlatformEventSource">Test platform event source.</param>
        /// <param name="testEventsPublisher">Publisher for test events.</param>
        protected BaseRunTests(string runSettings, TestExecutionContext testExecutionContext, ITestCaseEventsHandler testCaseEventsHandler, ITestRunEventsHandler testRunEventsHandler, ITestPlatformEventSource testPlatformEventSource, ITestEventsPublisher testEventsPublisher)
        {
            this.runSettings           = runSettings;
            this.testExecutionContext  = testExecutionContext;
            this.testCaseEventsHandler = testCaseEventsHandler;
            this.testRunEventsHandler  = testRunEventsHandler;

            this.isCancellationRequested = false;
            this.testPlatformEventSource = testPlatformEventSource;
            this.testEventsPublisher     = testEventsPublisher;
            this.SetContext();
        }
Exemplo n.º 7
0
        /// <summary>
        /// Initializes out-proc and in-proc data collectors.
        /// </summary>
        private void InitializeDataCollectors(string runSettings, ITestEventsPublisher testEventsPublisher, string defaultCodeBase)
        {
            // Initialize out-proc data collectors if declared in run settings.
            if (DataCollectionTestCaseEventSender.Instance != null && XmlRunSettingsUtilities.IsDataCollectionEnabled(runSettings))
            {
                var outOfProcDataCollectionManager = new ProxyOutOfProcDataCollectionManager(DataCollectionTestCaseEventSender.Instance, testEventsPublisher);
            }

            // Initialize in-proc data collectors if declared in run settings.
            if (XmlRunSettingsUtilities.IsInProcDataCollectionEnabled(runSettings))
            {
                var inProcDataCollectionExtensionManager = new InProcDataCollectionExtensionManager(runSettings, testEventsPublisher, defaultCodeBase, TestPluginCache.Instance);
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="InProcDataCollectionExtensionManager"/> class.
        /// </summary>
        /// <param name="runSettings">
        /// The run settings.
        /// </param>
        /// <param name="testEventsPublisher">
        /// The data collection test case event manager.
        /// </param>
        public InProcDataCollectionExtensionManager(string runSettings, ITestEventsPublisher testEventsPublisher)
        {
            this.InProcDataCollectors     = new Dictionary <string, IInProcDataCollector>();
            this.inProcDataCollectionSink = new InProcDataCollectionSink();

            // Initialize InProcDataCollectors
            this.InitializeInProcDataCollectors(runSettings);

            if (this.IsInProcDataCollectionEnabled)
            {
                testEventsPublisher.TestCaseEnd   += this.TriggerTestCaseEnd;
                testEventsPublisher.TestCaseStart += this.TriggerTestCaseStart;
                testEventsPublisher.TestResult    += this.TriggerUpdateTestResult;
                testEventsPublisher.SessionStart  += this.TriggerTestSessionStart;
                testEventsPublisher.SessionEnd    += this.TriggerTestSessionEnd;
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="InProcDataCollectionExtensionManager"/> class.
 /// </summary>
 /// <param name="runSettings">
 /// The run settings.
 /// </param>
 /// <param name="testEventsPublisher">
 /// The data collection test case event manager.
 /// </param>
 /// <param name="defaultCodeBase">
 /// The default codebase to be used by inproc data collector
 /// </param>
 public InProcDataCollectionExtensionManager(string runSettings, ITestEventsPublisher testEventsPublisher, string defaultCodeBase, TestPluginCache testPluginCache)
     : this(runSettings, testEventsPublisher, defaultCodeBase, testPluginCache, new FileHelper())
 {
 }
 public TestableInProcDataCollectionExtensionManager(string runSettings, ITestEventsPublisher mockTestEventsPublisher, string defaultCodebase, TestPluginCache testPluginCache, IFileHelper fileHelper)
     : base(runSettings, mockTestEventsPublisher, defaultCodebase, testPluginCache, fileHelper)
 {
 }
Exemplo n.º 11
0
 public TestableInProcDataCollectionExtensionManager(string runSettings, ITestEventsPublisher mockTestEventsPublisher) : base(runSettings, mockTestEventsPublisher)
 {
 }