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;
            }
        }
Ejemplo n.º 2
0
        public void Initialize(IDataCollectionSink dataCollectionSink)
        {
            AttachDebugger();

            _eqtTrace = new TestPlatformEqtTrace();
            _eqtTrace.Verbose("Initialize CoverletInProcDataCollector");
        }
        public InProcDataCollectionExtensionManager(string runSettings, ITestRunCache testRunCache)
        {
            this.testRunCache = testRunCache;

            this.inProcDataCollectors     = new Dictionary <string, IInProcDataCollector>();
            this.inProcDataCollectionSink = new InProcDataCollectionSink();
            this.testResultDictionary     = new Dictionary <Guid, List <TestResult> >();
            this.testCaseEndStatusMap     = new HashSet <Guid>();

            // Initialize InProcDataCollectors
            this.InitializeInProcDataCollectors(runSettings);
        }
Ejemplo n.º 4
0
        /// <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;
            }
        }
Ejemplo n.º 5
0
        internal void Initialize(
            XmlElement configurationElement,
            IDataCollectionEvents events,
            IDataCollectionSink dataSink,
            IDataCollectionLogger logger,
            IDataCollectionAgentContext agentContext)
        {
            EqtTrace.Info(
                "BaseDataCollector.InternalConstruct: Enabling datacollector with configuration: {0}",
                configurationElement?.OuterXml);
            this.Events       = events;
            this.DataSink     = dataSink;
            this.Logger       = logger;
            this.AgentContext = agentContext;

            this.OnInitialize(configurationElement);
        }
Ejemplo n.º 6
0
        private void InitializeDataCollector(object obj, IDataCollectionSink inProcDataCollectionSink)
        {
            var initializeMethodInfo = GetMethodInfoFromType(obj.GetType(), "Initialize", new Type[] { typeof(IDataCollectionSink) });

            initializeMethodInfo.Invoke(obj, new object[] { inProcDataCollectionSink });
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Loads the DataCollector type
 /// </summary>
 /// <param name="inProcDataCollectionSink">Sink object to send data</param>
 public void LoadDataCollector(IDataCollectionSink inProcDataCollectionSink)
 {
     this.dataCollectorObject = CreateObjectFromType(dataCollectorType);
     InitializeDataCollector(dataCollectorObject, inProcDataCollectionSink);
 }
Ejemplo n.º 8
0
 public void Initialize(IDataCollectionSink _dataCollectionSink)
 {
     Debug.WriteLine("Initialize");
     Supervise();
 }
Ejemplo n.º 9
0
 public void Initialize(IDataCollectionSink dataCollectionSink)
 {
     // Do Nothing
 }
Ejemplo n.º 10
0
 public void InitializeTest()
 {
     this.dataCollectionSink    = new InProcDataCollectionSink();
     this.testCase              = new TestCase("DummyNS.DummyC.DummyM", new Uri("executor://mstest/v1"), "Dummy.dll");
     this.dataCollectionContext = new DataCollectionContext(this.testCase);
 }
Ejemplo n.º 11
0
 public void Initialize(IDataCollectionSink dataCollectionSink)
 {
     this._dataSink = dataCollectionSink;
     Init(true);
 }
 public void Initialize(IDataCollectionSink dataCollectionSink)
 {
     AppDomain.CurrentDomain.FirstChanceException += FirstChanceHandler;
     File.AppendAllText(this.fileName, "Creating file");
 }
 public void LoadDataCollector(IDataCollectionSink inProcDataCollectionSink)
 {
     // Do Nothing
 }
 public void Initialize(IDataCollectionSink dataCollectionSink)
 {
     throw new System.NotImplementedException();
 }
 public void Initialize(IDataCollectionSink dataCollectionSink)
 {
 }