/// <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, IDataCollectionTestCaseEventManager dataCollectionTestCaseEventManager) { this.attachmentsCache = new Dictionary <Guid, Collection <AttachmentSet> >(); this.dataCollectionTestCaseEventManager = dataCollectionTestCaseEventManager; this.dataCollectionTestCaseEventSender = dataCollectionTestCaseEventSender; this.dataCollectionTestCaseEventManager.TestCaseStart += this.TriggerTestCaseStart; this.dataCollectionTestCaseEventManager.TestCaseEnd += this.TriggerTestCaseEnd; this.dataCollectionTestCaseEventManager.TestResult += TriggerSendTestResult; this.dataCollectionTestCaseEventManager.SessionEnd += this.TriggerTestSessionEnd; attachmentsCache = new Dictionary <Guid, Collection <AttachmentSet> >(); }
private void SetContext() { this.testRunCache = new TestRunCache(this.testExecutionContext.FrequencyOfRunStatsChangeEvent, testExecutionContext.RunStatsChangeEventTimeout, this.OnCacheHit); this.dataCollectionTestCaseEventManager = new DataCollectionTestCaseEventManager(testRunCache); this.inProcDataCollectionExtensionManager = new InProcDataCollectionExtensionManager(runSettings, testRunCache, this.dataCollectionTestCaseEventManager); if (DataCollectionTestCaseEventSender.Instance != null) { this.outOfProcDataCollectionManager = new ProxyOutOfProcDataCollectionManager(DataCollectionTestCaseEventSender.Instance, this.dataCollectionTestCaseEventManager); } if (!inProcDataCollectionExtensionManager.IsInProcDataCollectionEnabled) { // No need to call any methods on this, if inproc-datacollection is not enabled inProcDataCollectionExtensionManager = null; } if (inProcDataCollectionExtensionManager != null || DataCollectionTestCaseEventSender.Instance != null) { this.testCaseEventsHandler = new TestCaseEventsHandler(this.dataCollectionTestCaseEventManager, this.testCaseEventsHandler); } this.runContext = new RunContext(); this.runContext.RunSettings = RunSettingsUtilities.CreateAndInitializeRunSettings(this.runSettings); this.runContext.KeepAlive = this.testExecutionContext.KeepAlive; this.runContext.InIsolation = this.testExecutionContext.InIsolation; this.runContext.IsDataCollectionEnabled = this.testExecutionContext.IsDataCollectionEnabled; this.runContext.IsBeingDebugged = this.testExecutionContext.IsDebug; var runConfig = XmlRunSettingsUtilities.GetRunConfigurationNode(this.runSettings); this.runContext.TestRunDirectory = RunSettingsUtilities.GetTestResultsDirectory(runConfig); this.runContext.SolutionDirectory = RunSettingsUtilities.GetSolutionDirectory(runConfig); this.frameworkHandle = new FrameworkHandle( this.testCaseEventsHandler, this.testRunCache, this.testExecutionContext, this.testRunEventsHandler); this.frameworkHandle.TestRunMessage += this.OnTestRunMessage; this.executorUrisThatRanTests = new List <string>(); }
/// <summary> /// Initializes a new instance of the <see cref="InProcDataCollectionExtensionManager"/> class. /// </summary> /// <param name="runSettings"> /// The run settings. /// </param> /// <param name="testRunCache"> /// The test run cache. /// </param> /// <param name="dataCollectionTestCaseEventManager"> /// The data collection test case event manager. /// </param> public InProcDataCollectionExtensionManager(string runSettings, ITestRunCache testRunCache, IDataCollectionTestCaseEventManager dataCollectionTestCaseEventManager) { this.InProcDataCollectors = new Dictionary <string, IInProcDataCollector>(); this.inProcDataCollectionSink = new InProcDataCollectionSink(); // Initialize InProcDataCollectors this.InitializeInProcDataCollectors(runSettings); if (this.IsInProcDataCollectionEnabled) { dataCollectionTestCaseEventManager.TestCaseEnd += this.TriggerTestCaseEnd; dataCollectionTestCaseEventManager.TestCaseStart += this.TriggerTestCaseStart; dataCollectionTestCaseEventManager.TestResult += this.TriggerUpdateTestResult; dataCollectionTestCaseEventManager.SessionStart += this.TriggerTestSessionStart; dataCollectionTestCaseEventManager.SessionEnd += this.TriggerTestSessionEnd; } }
/// <summary> /// Initializes a new instance of the <see cref="TestCaseEventsHandler"/> class. /// </summary> /// <param name="dataCollectionTestCaseEventManager"> /// The data Collection Test Case Event Manager. /// </param> /// <param name="testCaseEvents"> /// The test Case Events. /// </param> public TestCaseEventsHandler(IDataCollectionTestCaseEventManager dataCollectionTestCaseEventManager, ITestCaseEventsHandler testCaseEvents) { this.dataCollectionTestCaseEventManager = dataCollectionTestCaseEventManager; this.testCaseEvents = testCaseEvents; }
public TestableInProcDataCollectionExtensionManager(string runSettings, ITestRunCache testRunCache, IDataCollectionTestCaseEventManager dataCollectionTestCaseEventManager) : base(runSettings, testRunCache, dataCollectionTestCaseEventManager) { }