internal TestContainerDiscoverer ( [Import(typeof(IOperationState))] IOperationState operationState, [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider ) { TestContainersUpdated?.ToString(); Logger.Clear(); Logger.Initialize(serviceProvider, Vsix.Name); CoverageUtil.InstallOrUpdateCoverlet(exception => { if (exception != null) { Logger.Log(exception); return; } operationState.StateChanged += OperationState_StateChanged; Logger.Log("Initialized!"); }); }
public TestContainerDiscoverer ( [Import(typeof(IOperationState))] IOperationState operationState, IFCCEngine fccEngine, IInitializer initializer, ITestOperationFactory testOperationFactory, ILogger logger, IAppOptionsProvider appOptionsProvider ) { appOptionsProvider.OptionsChanged += AppOptionsEvents_OptionsChanged; this.appOptionsProvider = appOptionsProvider; this.fccEngine = fccEngine; this.testOperationFactory = testOperationFactory; this.logger = logger; initializeThread = new Thread(() => { operationState.StateChanged += OperationState_StateChanged; initializer.Initialize(); }); initializeThread.Start(); }
internal TestContainerDiscoverer ( [Import(typeof(IOperationState))] IOperationState operationState, [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider ) { _serviceProvider = serviceProvider; new Thread(() => { try { Logger.Initialize(_serviceProvider); FCCEngine.Initialize(); Initialize(_serviceProvider); TestContainersUpdated.ToString(); operationState.StateChanged += OperationState_StateChanged; Logger.Log($"Initialized"); } catch (Exception exception) { Logger.Log($"Failed Initialization", exception); } }).Start(); }
private TestContainerDiscovererProject( [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider, [Import(typeof(IOperationState))] IOperationState operationState, [Import] IPythonWorkspaceContextProvider workspaceContextProvider, [Import] IInterpreterOptionsService interpreterOptionsService ) { _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); _workspaceContextProvider = workspaceContextProvider ?? throw new ArgumentNullException(nameof(workspaceContextProvider)); _projectMap = new ConcurrentDictionary <string, ProjectInfo>(); _packageManagerEventSink = new PackageManagerEventSink(interpreterOptionsService); _packageManagerEventSink.InstalledPackagesChanged += OnInstalledPackagesChanged; _firstLoad = true; _isRefresh = false; _setupComplete = false; _deferredTestChangeNotification = new Timer(OnDeferredTestChanged); _solutionListener = new SolutionEventsListener(_serviceProvider); _solutionListener.ProjectLoaded += OnProjectLoaded; _solutionListener.ProjectUnloading += OnProjectUnloaded; _solutionListener.ProjectClosing += OnProjectUnloaded; _solutionListener.SolutionOpened += OnSolutionLoaded; _solutionListener.SolutionClosed += OnSolutionClosed; _solutionListener.StartListeningForChanges(); _testFilesAddRemoveListener = new TestFileAddRemoveListener(_serviceProvider, new Guid()); _testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged; _testFilesAddRemoveListener.StartListeningForTestFileChanges(); }
public TestContainerDiscoverer(IServiceProvider serviceProvider, SolutionEventsListener solutionListener, TestFilesUpdateWatcher testFilesUpdateWatcher, TestFileAddRemoveListener testFilesAddRemoveListener, IOperationState operationState) { ValidateArg.NotNull(serviceProvider, "serviceProvider"); ValidateArg.NotNull(solutionListener, "solutionListener"); ValidateArg.NotNull(testFilesUpdateWatcher, "testFilesUpdateWatcher"); ValidateArg.NotNull(testFilesAddRemoveListener, "testFilesAddRemoveListener"); ValidateArg.NotNull(operationState, "operationState"); this.fileRootMap = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase); this.knownProjects = new Dictionary <string, ProjectInfo>(StringComparer.OrdinalIgnoreCase); this.serviceProvider = serviceProvider; this.testFilesAddRemoveListener = testFilesAddRemoveListener; this.testFilesAddRemoveListener.TestFileChanged += this.OnProjectItemChanged; this.solutionListener = solutionListener; this.solutionListener.ProjectLoaded += this.OnProjectLoaded; this.solutionListener.ProjectUnloading += this.OnProjectUnloaded; this.solutionListener.ProjectClosing += this.OnProjectUnloaded; this.solutionListener.ProjectRenamed += this.OnProjectRenamed; this.solutionListener.BuildCompleted += this.OnBuildCompleted; this.solutionListener.BuildStarted += this.OnBuildStarted; this.testFilesUpdateWatcher = testFilesUpdateWatcher; this.testFilesUpdateWatcher.FileChangedEvent += this.OnProjectItemChanged; operationState.StateChanged += this.OperationStateChanged; this.firstLoad = true; }
private void OnStartupComplete() { CreateOutputWindow(); CreateStatusBarIcon(); solutionEvents = events.SolutionEvents; buildEvents = events.BuildEvents; windowEvents = events.WindowEvents; solutionEvents.Opened += OnSolutionOpened; solutionEvents.AfterClosing += OnSolutionClosed; buildEvents.OnBuildBegin += OnBuildBegin; buildEvents.OnBuildDone += OnBuildDone; debugService = (IVsDebugger)GetGlobalService(typeof(SVsShellDebugger)); debugService.AdviseDebuggerEvents(this, out debugCookie); var componentModel = (IComponentModel)GetGlobalService(typeof(SComponentModel)); operationState = componentModel.GetService <IOperationState>(); operationState.StateChanged += OperationStateOnStateChanged; application = Application.Current; application.Activated += OnApplicationActivated; application.Deactivated += OnApplicationDeactivated; windowEvents.WindowActivated += OnWindowActivated; SystemEvents.SessionSwitch += OnSessionSwitch; SystemEvents.PowerModeChanged += OnPowerModeChanged; VSColorTheme.ThemeChanged += OnThemeChanged; chart.Loaded += (s, a) => { Window window = Window.GetWindow(chart); new Lid(window).StatusChanged += OnLidStatusChanged; }; ListenToScreenSaver(); sm = new VSStateMachine(); if (application.Windows.OfType <Window>() .All(w => !w.IsActive)) { sm.On(VSStateMachine.Events.LostFocus); } if (dte.Solution.Count > 0) { sm.On(VSStateMachine.Events.SolutionOpened); } sm.StateChanged += s => Output("Current state: {0}", s.ToString()); Output("Startup complete"); Output("Current state: {0}", sm.CurrentState.ToString()); }
public TestContainerDiscoverer(IServiceProvider serviceProvider, SolutionEventsListener solutionListener, TestFilesUpdateWatcher testFilesUpdateWatcher, TestFileAddRemoveListener testFilesAddRemoveListener, IOperationState operationState) { ValidateArg.NotNull(serviceProvider, "serviceProvider"); ValidateArg.NotNull(solutionListener, "solutionListener"); ValidateArg.NotNull(testFilesUpdateWatcher, "testFilesUpdateWatcher"); ValidateArg.NotNull(testFilesAddRemoveListener, "testFilesAddRemoveListener"); ValidateArg.NotNull(operationState, "operationState"); _fileRootMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); _knownProjects = new Dictionary<string, ProjectInfo>(StringComparer.OrdinalIgnoreCase); _serviceProvider = serviceProvider; _testFilesAddRemoveListener = testFilesAddRemoveListener; _testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged; _solutionListener = solutionListener; _solutionListener.ProjectLoaded += OnProjectLoaded; _solutionListener.ProjectUnloading += OnProjectUnloaded; _solutionListener.ProjectClosing += OnProjectUnloaded; _solutionListener.ProjectRenamed += OnProjectRenamed; _solutionListener.BuildCompleted += OnBuildCompleted; _solutionListener.BuildStarted += OnBuildStarted; _testFilesUpdateWatcher = testFilesUpdateWatcher; _testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged; operationState.StateChanged += OperationStateChanged; _firstLoad = true; }
public void AddTask(Task task, IOperationState state, PendingTaskDescription description, long id, CancellationTokenSource tokenSource = null, bool skipStatusCheck = false) { if (skipStatusCheck == false && task.Status == TaskStatus.Created) { throw new ArgumentException("Task must be started before it gets added to the database.", "task"); } if (id > Interlocked.Read(ref pendingTaskCounter)) { throw new ArgumentException("Invalid task id: " + id, "id"); } var addResult = pendingTasks.TryAdd(id, new PendingTask { Task = task, State = state, Description = description, TokenSource = tokenSource }); if (addResult == false) { throw new InvalidOperationException($"Task with id: {id} already exists"); } }
public void AddTask(Task task, IOperationState state, PendingTaskDescription description, out long id, CancellationTokenSource tokenSource = null) { if (task.Status == TaskStatus.Created) throw new ArgumentException("Task must be started before it gets added to the database.", "task"); var localId = id = Interlocked.Increment(ref pendingTaskCounter); pendingTasks.TryAdd(localId, new PendingTaskWithStateAndDescription { Task = task, State = state, Description = description, TokenSource = tokenSource }); }
public void AddTask(Task task, IOperationState state, PendingTaskDescription description, out long id, CancellationTokenSource tokenSource = null) { if (task.Status == TaskStatus.Created) { throw new ArgumentException("Task must be started before it gets added to the database.", "task"); } var localId = id = Interlocked.Increment(ref pendingTaskCounter); pendingTasks.TryAdd(localId, new PendingTaskWithStateAndDescription { Task = task, State = state, Description = description, TokenSource = tokenSource }); }
private HttpResponseMessage GetOperationStatusMessage(IOperationState status) { if (status == null) { return(GetEmptyMessage(HttpStatusCode.NotFound)); } if (status.State != null) { lock (status.State) { return(GetMessageWithObject(status)); } } return(GetMessageWithObject(status)); }
public TestContainerDiscoverer(IServiceProvider serviceProvider, SolutionEventsListener solutionListener, IOperationState operationState) { ValidateArg.NotNull(serviceProvider, "serviceProvider"); ValidateArg.NotNull(solutionListener, "solutionListener"); ValidateArg.NotNull(operationState, "operationState"); _projectInfo = new Dictionary<PythonProject, ProjectInfo>(); _serviceProvider = serviceProvider; _solutionListener = solutionListener; _solutionListener.ProjectLoaded += OnProjectLoaded; _solutionListener.ProjectUnloading += OnProjectUnloaded; _solutionListener.ProjectClosing += OnProjectUnloaded; _firstLoad = true; }
public TestContainerDiscoverer(IServiceProvider serviceProvider, SolutionEventsListener solutionListener, IOperationState operationState) { ValidateArg.NotNull(serviceProvider, "serviceProvider"); ValidateArg.NotNull(solutionListener, "solutionListener"); ValidateArg.NotNull(operationState, "operationState"); _projectInfo = new Dictionary <PythonProject, ProjectInfo>(); _serviceProvider = serviceProvider; _solutionListener = solutionListener; _solutionListener.ProjectLoaded += OnProjectLoaded; _solutionListener.ProjectUnloading += OnProjectUnloaded; _solutionListener.ProjectClosing += OnProjectUnloaded; _firstLoad = true; }
private TestContainerDiscovererWorkspace( [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider, [Import(typeof(IOperationState))] IOperationState operationState, [Import] IPythonWorkspaceContextProvider workspaceContextProvider, [Import] IInterpreterOptionsService interpreterOptionsService, [Import] IInterpreterRegistryService interpreterRegistryService ) { _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); _projectMap = new ConcurrentDictionary <string, ProjectInfo>(); _packageManagerEventSink = new PackageManagerEventSink(interpreterOptionsService); _packageManagerEventSink.InstalledPackagesChanged += OnInstalledPackagesChanged; _interpreterRegistryService = interpreterRegistryService; _deferredTestChangeNotification = new Timer(OnDeferredTestChanged); _firstLoad = true; _isRefresh = false; _workspaceContextProvider = workspaceContextProvider ?? throw new ArgumentNullException(nameof(workspaceContextProvider)); _workspaceContextProvider.WorkspaceClosed += OnWorkspaceClosed; _workspaceContextProvider.WorkspaceInitialized += OnWorkspaceLoaded; }
public TestContainerDiscoverer ( [Import(typeof(IOperationState))] IOperationState operationState, IFCCEngine fccEngine, IInitializer initializer, ITestOperationFactory testOperationFactory, ILogger logger, IAppOptionsProvider appOptionsProvider, IReportGeneratorUtil reportGeneratorUtil, IDisposeAwareTaskRunner disposeAwareTaskRunner, IMsCodeCoverageRunSettingsService msCodeCoverageRunSettingsService ) { this.appOptionsProvider = appOptionsProvider; this.reportGeneratorUtil = reportGeneratorUtil; this.msCodeCoverageRunSettingsService = msCodeCoverageRunSettingsService; this.fccEngine = fccEngine; this.testOperationFactory = testOperationFactory; this.logger = logger; testOperationStateChangeHandlers = new Dictionary <TestOperationStates, Func <IOperation, Task> > { { TestOperationStates.TestExecutionCanceling, TestExecutionCancellingAsync }, { TestOperationStates.TestExecutionStarting, TestExecutionStartingAsync }, { TestOperationStates.TestExecutionFinished, TestExecutionFinishedAsync }, { TestOperationStates.TestExecutionCancelAndFinished, TestExecutionCancelAndFinishedAsync }, }; disposeAwareTaskRunner.RunAsync(() => { initializeTask = Task.Run(async() => { operationState.StateChanged += OperationState_StateChanged; await initializer.InitializeAsync(disposeAwareTaskRunner.DisposalToken); }); return(initializeTask); }); }
private TestContainerDiscoverer([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider, [Import(typeof(IOperationState))] IOperationState operationState) : this(serviceProvider, new SolutionEventsListener(serviceProvider), new TestFilesUpdateWatcher(serviceProvider), new TestFileAddRemoveListener(serviceProvider, Guids.NodejsBaseProjectFactory), operationState) { }
private TestContainerDiscoverer([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider, [Import(typeof(IOperationState))] IOperationState operationState) { _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); _projectInfo = new Dictionary <PythonProject, ProjectInfo>(); _solutionListener = new SolutionEventsListener(serviceProvider); _solutionListener.ProjectLoaded += OnProjectLoaded; _solutionListener.ProjectUnloading += OnProjectUnloaded; _solutionListener.ProjectClosing += OnProjectUnloaded; _firstLoad = true; }
private TestContainerDiscoverer([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider, [Import(typeof(IOperationState))] IOperationState operationState) : this(serviceProvider, new SolutionEventsListener(serviceProvider), operationState) { }
private TestContainerDiscoverer([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider, [Import(typeof(IOperationState))] IOperationState operationState) { ValidateArg.NotNull(serviceProvider, "serviceProvider"); ValidateArg.NotNull(operationState, "operationState"); _projectInfo = new Dictionary <PythonProject, ProjectInfo>(); _serviceProvider = serviceProvider; _solutionListener = new SolutionEventsListener(serviceProvider); _solutionListener.ProjectLoaded += OnProjectLoaded; _solutionListener.ProjectUnloading += OnProjectUnloaded; _solutionListener.ProjectClosing += OnProjectUnloaded; _firstLoad = true; }
internal TestRunnerListener( [Import(typeof(IOperationState))] IOperationState operationState ) { operationState.StateChanged += OperationState_StateChanged; }
internal PrestoCoverageContainerDiscoverer([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider, [Import(typeof(IOperationState))] IOperationState operationState) { _serviceProvider = serviceProvider; operationState.StateChanged += OperationState_StateChanged; }
private TestContainerDiscoverer([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider, [Import(typeof(IOperationState))] IOperationState operationState) { ValidateArg.NotNull(serviceProvider, "serviceProvider"); ValidateArg.NotNull(operationState, "operationState"); this.fileRootMap = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase); this.knownProjects = new Dictionary <string, ProjectInfo>(StringComparer.OrdinalIgnoreCase); this.serviceProvider = serviceProvider; this.testFilesAddRemoveListener = new TestFileAddRemoveListener(serviceProvider, Guids.NodejsBaseProjectFactory); this.testFilesAddRemoveListener.TestFileChanged += this.OnProjectItemChanged; this.solutionListener = new SolutionEventsListener(serviceProvider); this.solutionListener.ProjectLoaded += this.OnProjectLoaded; this.solutionListener.ProjectUnloading += this.OnProjectUnloaded; this.solutionListener.ProjectClosing += this.OnProjectUnloaded; this.solutionListener.ProjectRenamed += this.OnProjectRenamed; this.solutionListener.BuildCompleted += this.OnBuildCompleted; this.solutionListener.BuildStarted += this.OnBuildStarted; this.testFilesUpdateWatcher = new TestFilesUpdateWatcher(serviceProvider); this.testFilesUpdateWatcher.FileChangedEvent += this.OnProjectItemChanged; operationState.StateChanged += this.OperationStateChanged; this.firstLoad = true; }
internal Testything([Import(typeof(IOperationState))] IOperationState operationState) { operationState.StateChanged += OperationState_StateChanged; }