public ChutzpahTestContainerDiscoverer(IServiceProvider serviceProvider,
            IChutzpahSettingsMapper settingsMapper,
            ILogger logger,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener,
            ITestRunner testRunner,
            IFileProbe fileProbe)
        {
            initialContainerSearch = true;
            cachedContainers = new List<ITestContainer>();
            this.serviceProvider = serviceProvider;
            this.settingsMapper = settingsMapper;
            this.logger = logger;
            this.testRunner = testRunner;
            this.fileProbe = fileProbe;
            this.solutionListener = solutionListener;
            this.testFilesUpdateWatcher = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;

            this.testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded += SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
Ejemplo n.º 2
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_testFilesUpdateWatcher != null)
                {
                    _testFilesUpdateWatcher.FileChangedEvent -= OnProjectItemChanged;
                    ((IDisposable)_testFilesUpdateWatcher).Dispose();
                    _testFilesUpdateWatcher = null;
                }

                if (_testFilesAddRemoveListener != null)
                {
                    _testFilesAddRemoveListener.TestFileChanged -= OnProjectItemChanged;
                    _testFilesAddRemoveListener.StopListeningForTestFileChanges();
                    _testFilesAddRemoveListener = null;
                }

                if (_solutionListener != null)
                {
                    _solutionListener.SolutionProjectChanged -= OnSolutionProjectChanged;
                    _solutionListener.StopListeningForChanges();
                    _solutionListener = null;
                }
            }
        }
Ejemplo n.º 3
0
        public PowerShellTestContainerDiscoverer(
            ISolutionProvider solutionProvider,
            ILogger logger,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            _initialContainerSearch = true;
            _cachedContainers       = new List <ITestContainer>();
            _solutionProvider       = solutionProvider;
            _logger                     = logger;
            _solutionListener           = solutionListener;
            _testFilesUpdateWatcher     = testFilesUpdateWatcher;
            _testFilesAddRemoveListener = testFilesAddRemoveListener;

            logger.Log(MessageLevel.Diagnostic, "PowerShellTestContainerDiscoverer Constructor Entering");

            _testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            _testFilesAddRemoveListener.StartListeningForTestFileChanges();

            _solutionListener.SolutionUnloaded       += SolutionListenerOnSolutionUnloaded;
            _solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            _solutionListener.StartListeningForChanges();

            _testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
        public PowerShellTestContainerDiscoverer(
            [Import(typeof (SVsServiceProvider))] IServiceProvider serviceProvider,
            ILogger logger,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            _initialContainerSearch = true;
            _cachedContainers = new List<ITestContainer>();
            _serviceProvider = serviceProvider;
            _logger = logger;
            _solutionListener = solutionListener;
            _testFilesUpdateWatcher = testFilesUpdateWatcher;
            _testFilesAddRemoveListener = testFilesAddRemoveListener;

            logger.Log(MessageLevel.Diagnostic, "PowerShellTestContainerDiscoverer Constructor Entering");

            _testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            _testFilesAddRemoveListener.StartListeningForTestFileChanges();

            _solutionListener.SolutionUnloaded += SolutionListenerOnSolutionUnloaded;
            _solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            _solutionListener.StartListeningForChanges();

            _testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
        public PsateTestContainerDiscoverer(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            ILogger logger,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            Trace.WriteLine("Hello");

            initialContainerSearch          = true;
            cachedContainers                = new List <ITestContainer>();
            this.serviceProvider            = serviceProvider;
            this.logger                     = logger;
            this.solutionListener           = solutionListener;
            this.testFilesUpdateWatcher     = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;


            this.testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded       += SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
Ejemplo n.º 6
0
        public ChutzpahTestContainerDiscoverer(IServiceProvider serviceProvider,
                                               IChutzpahSettingsMapper settingsMapper,
                                               ILogger logger,
                                               ISolutionEventsListener solutionListener,
                                               ITestFilesUpdateWatcher testFilesUpdateWatcher,
                                               ITestFileAddRemoveListener testFilesAddRemoveListener,
                                               ITestRunner testRunner,
                                               IFileProbe fileProbe,
                                               IChutzpahTestSettingsService chutzpahTestSettingsService)
        {
            initialContainerSearch           = true;
            cachedContainers                 = new ConcurrentDictionary <string, ITestContainer>(StringComparer.OrdinalIgnoreCase);
            this.serviceProvider             = serviceProvider;
            this.settingsMapper              = settingsMapper;
            this.logger                      = logger;
            this.testRunner                  = testRunner;
            this.fileProbe                   = fileProbe;
            this.chutzpahTestSettingsService = chutzpahTestSettingsService;
            this.solutionListener            = solutionListener;
            this.testFilesUpdateWatcher      = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener  = testFilesAddRemoveListener;

            this.testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded       += SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
        public PsateTestContainerDiscoverer(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            ILogger logger,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            Trace.WriteLine("Hello");
            
            initialContainerSearch = true;
            cachedContainers = new List<ITestContainer>();
            this.serviceProvider = serviceProvider;
            this.logger = logger;
            this.solutionListener = solutionListener;
            this.testFilesUpdateWatcher = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;


            this.testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded += SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
Ejemplo n.º 8
0
        public KarmaTestContainerDiscoverer(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            ILogger logger,
            ISolutionListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            Logger = KarmaLogger.Create(logger: logger);

            _serviceProvider  = serviceProvider;
            _solutionListener = solutionListener;

            _testFilesUpdateWatcher          = testFilesUpdateWatcher;
            _testFilesUpdateWatcher.Changed += OnProjectItemChanged;

            _testFilesAddRemoveListener          = testFilesAddRemoveListener;
            _testFilesAddRemoveListener.Changed += OnProjectItemChanged;
            _testFilesAddRemoveListener.StartListening();

            _solutionListener.SolutionUnloaded += SolutionListenerOnSolutionUnloaded;
            _solutionListener.ProjectChanged   += OnSolutionProjectChanged;
            _solutionListener.StartListening();

            Logger.Info("KarmaTestContainerDiscoverer created");
        }
Ejemplo n.º 9
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_testFilesUpdateWatcher != null)
                {
                    _testFilesUpdateWatcher.Changed -= OnProjectItemChanged;
                    _testFilesUpdateWatcher.Dispose();
                    _testFilesUpdateWatcher = null;
                }

                if (_testFilesAddRemoveListener != null)
                {
                    _testFilesAddRemoveListener.Changed -= OnProjectItemChanged;
                    _testFilesAddRemoveListener.StopListening();
                    _testFilesAddRemoveListener.Dispose();
                    _testFilesAddRemoveListener = null;
                }

                if (_solutionListener != null)
                {
                    _solutionListener.ProjectChanged -= OnSolutionProjectChanged;
                    _solutionListener.StopListening();
                    _solutionListener.Dispose();
                    _solutionListener = null;
                }
            }
        }
Ejemplo n.º 10
0
        public QmlTestContainerDiscoverer(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            cachedContainers = new QmlTestContainerCache(
                this, serviceProvider, solutionListener, testFilesUpdateWatcher, testFilesAddRemoveListener);

            cachedContainers.CacheUpdated += (source, e) => {
                if (TestContainersUpdated != null)
                {
                    TestContainersUpdated(this, EventArgs.Empty);
                }
            };
        }
 public ChutzpahTestContainerDiscoverer(
     [Import(typeof (SVsServiceProvider))] IServiceProvider serviceProvider,
     IChutzpahSettingsMapper settingsMapper,
     ISolutionEventsListener solutionListener,
     ITestFilesUpdateWatcher testFilesUpdateWatcher,
     ITestFileAddRemoveListener testFilesAddRemoveListener)
     : this(serviceProvider,
         settingsMapper,
         new Logger(serviceProvider),
         solutionListener,
         testFilesUpdateWatcher,
         testFilesAddRemoveListener,
         TestRunner.Create(),
         ChutzpahContainer.Get<IFileProbe>())
 {
 }
Ejemplo n.º 12
0
 public ChutzpahTestContainerDiscoverer(
     [Import(typeof(IServiceProvider))] IServiceProvider serviceProvider,
     IChutzpahSettingsMapper settingsMapper,
     ISolutionEventsListener solutionListener,
     ITestFilesUpdateWatcher testFilesUpdateWatcher,
     ITestFileAddRemoveListener testFilesAddRemoveListener)
     : this(
         serviceProvider,
         settingsMapper,
         new Logger(serviceProvider),
         solutionListener,
         testFilesUpdateWatcher,
         testFilesAddRemoveListener,
         TestRunner.Create(),
         ChutzpahContainer.Get <IFileProbe>(),
         ChutzpahContainer.Get <IChutzpahTestSettingsService>())
 {
 }
        public QmlTestContainerCache(
            ITestContainerDiscoverer testContainerDiscoverer,
            IServiceProvider serviceProvider,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            this.solutionListener           = solutionListener;
            this.serviceProvider            = serviceProvider;
            this.testFilesUpdateWatcher     = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;
            this.testContainerDiscoverer    = testContainerDiscoverer;

            this.solutionListener.SolutionUnloaded          += OnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged    += OnSolutionProjectChanged;
            this.testFilesUpdateWatcher.FileChangedEvent    += OnProjectItemChanged;
            this.testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;

            this.solutionListener.StartListeningForChanges();
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();
        }
Ejemplo n.º 14
0
        public CucumberJsTestContainerDiscoverer(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            this.initialContainerSearch     = true;
            this.cachedContainers           = new ConcurrentDictionary <string, ITestContainer>(StringComparer.OrdinalIgnoreCase);
            this.serviceProvider            = serviceProvider;
            this.solutionListener           = solutionListener;
            this.testFilesUpdateWatcher     = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;

            this.testFilesAddRemoveListener.TestFileChanged += this.OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded       += this.SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += this.OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += this.OnProjectItemChanged;
        }
        public CucumberJsTestContainerDiscoverer(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            this.initialContainerSearch = true;
            this.cachedContainers = new ConcurrentDictionary<string, ITestContainer>(StringComparer.OrdinalIgnoreCase);
            this.serviceProvider = serviceProvider;
            this.solutionListener = solutionListener;
            this.testFilesUpdateWatcher = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;

            this.testFilesAddRemoveListener.TestFileChanged += this.OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded += this.SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += this.OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += this.OnProjectItemChanged;
        }
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (testFilesUpdateWatcher != null)
                {
                    testFilesUpdateWatcher.FileChangedEvent -= OnProjectItemChanged;
                    ((IDisposable)testFilesUpdateWatcher).Dispose();
                    testFilesUpdateWatcher = null;
                }

                if (testFilesAddRemoveListener != null)
                {
                    testFilesAddRemoveListener.TestFileChanged -= OnProjectItemChanged;
                    testFilesAddRemoveListener.StopListeningForTestFileChanges();
                    testFilesAddRemoveListener = null;
                }

                if (solutionListener != null)
                {
                    solutionListener.SolutionProjectChanged -= OnSolutionProjectChanged;
                    solutionListener.StopListeningForChanges();
                    solutionListener = null;
                }
            }
        }
        public ChutzpahTestContainerDiscoverer(IServiceProvider serviceProvider,
            IChutzpahSettingsMapper settingsMapper,
            ILogger logger,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener,
            ITestRunner testRunner,
            IFileProbe fileProbe,
            IChutzpahTestSettingsService chutzpahTestSettingsService)
        {
            initialContainerSearch = true;
            cachedContainers = new ConcurrentDictionary<string, ITestContainer>(StringComparer.OrdinalIgnoreCase);
            this.serviceProvider = serviceProvider;
            this.settingsMapper = settingsMapper;
            this.logger = logger;
            this.testRunner = testRunner;
            this.fileProbe = fileProbe;
            this.chutzpahTestSettingsService = chutzpahTestSettingsService;
            this.solutionListener = solutionListener;
            this.testFilesUpdateWatcher = testFilesUpdateWatcher;
            this.testFilesAddRemoveListener = testFilesAddRemoveListener;

            this.testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            this.testFilesAddRemoveListener.StartListeningForTestFileChanges();

            this.solutionListener.SolutionUnloaded += SolutionListenerOnSolutionUnloaded;
            this.solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            this.solutionListener.StartListeningForChanges();

            this.testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }