Example #1
0
        void Restart()
        {
            startTask = null;

            restartTokenSource.Cancel();
            restartTokenSource = new CancellationTokenSource();

            try {
                if (communicationManager != null)
                {
                    communicationManager.StopServer();
                    communicationManager = null;
                }
            } catch (Exception ex) {
                LoggingService.LogError("TestPlatformCommunicationManager stop error.", ex);
            }

            try {
                if (vsTestConsoleExeProcess != null)
                {
                    if (!vsTestConsoleExeProcess.IsCompleted)
                    {
                        vsTestConsoleExeProcess.Cancel();
                    }
                    vsTestConsoleExeProcess = null;
                }
            } catch (Exception ex) {
                LoggingService.LogError("VSTest process dispose error.", ex);
            }
        }
Example #2
0
 public void Stop()
 {
     if (currentOperation != null)
     {
         outputProgressMonitor.Log.WriteLine(GettextCatalog.GetString("Stopping task..."));
         currentOperation.Cancel();
     }
 }
Example #3
0
        public override void Dispose()
        {
            if (console != null && !console.IsCompleted)
            {
                console.Cancel();
                console = null;
            }

            if (thread != null)
            {
                thread.Abort();
            }
        }
Example #4
0
        public void Stop()
        {
            lock (_processLock)
            {
                if (_stopped)
                {
                    return;
                }

                _stopped = true;

                if (_designTimeHostOperation != null)
                {
                    _logger.LogInformation("Shutting down DesignTimeHost");

                    _designTimeHostOperation.Cancel();
                    _designTimeHostOperation = null;
                }
            }
        }
        public void Dispose()
        {
            IsRunning = false;

            try {
                if (shutdownTimer != null)
                {
                    shutdownTimer.Stop();
                    shutdownTimer.Elapsed -= ShutdownTimerElapsed;
                    shutdownTimer.Dispose();
                    shutdownTimer = null;
                }
            } catch (Exception ex) {
                LoggingService.LogError("Test loader dispose error.", ex);
            }

            try {
                if (testServer != null)
                {
                    testServer.Dispose();
                    testServer = null;
                }
            } catch (Exception ex) {
                LoggingService.LogError("Test loader dispose error.", ex);
            }

            try {
                if (dotNetTestOperation != null)
                {
                    if (!dotNetTestOperation.IsCompleted)
                    {
                        dotNetTestOperation.Cancel();
                    }
                    dotNetTestOperation = null;
                }
            } catch (Exception ex) {
                LoggingService.LogError("Test loader dispose error.", ex);
            }
        }
Example #6
0
        public void CancelTestRun()
        {
            if (IsRunningTests)
            {
                try {
                    communicationManager.SendMessage(MessageType.CancelTestRun);
                } catch (Exception ex) {
                    LoggingService.LogError("CancelTestRun error.", ex);
                }

                try {
                    if (debugOperation != null)
                    {
                        if (!debugOperation.IsCompleted)
                        {
                            debugOperation.Cancel();
                        }
                        debugOperation = null;
                    }
                } catch (Exception ex) {
                    LoggingService.LogError("CancelTestRun error.", ex);
                }
            }
        }
Example #7
0
 public void Kill()
 {
     oper.Cancel();
 }