示例#1
0
        public void StopExecution(string virtualUser, TerminationReason terminationSource, string explanation = null)
        {
            _listenerEventsClient  = null;
            _testListenersComplete = true;

            finalizeTestExecution();

            // Kill off user execution threads, than main thread.
            if (_virtualUserThreads.Count > 0)
            {
                // Kill is virtual user thread.
                foreach (Thread virtualUserThread in _virtualUserThreads)
                {
                    if (virtualUserThread != null && virtualUserThread.IsAlive)
                    {
                        virtualUserThread.Abort();
                    }
                }

                // Now kill main thread
                _mainExecutionThread.Abort();
                _stopWatch.Stop();
                fireExecutionCompleteEvent(this,
                                           new TestExecutionCompleteArgs(null, _initialTestScriptObject, terminationSource, _stopWatch.Elapsed, explanation));
            }
        }
示例#2
0
        protected override void Setup()
        {
            if (_listenerEventsClient is null)
            {
                _listenerEventsClient = getListenerEventsClient();
            }

            base.Setup();
        }
示例#3
0
        private ListenerEventsClient getListenerEventsClient()
        {
            NetTcpBinding binding = new NetTcpBinding();

            //binding.Security.Mode = SecurityMode.None;
            binding.ReceiveTimeout = TimeSpan.FromDays(7);
            binding.SendTimeout    = TimeSpan.FromDays(7);

            InstanceContext context = new InstanceContext(this);


            EndpointAddress endPoint = new EndpointAddress("net.tcp://localhost:10101//Quintity.TestFramework.TestListenersService");

            ListenerEventsClient proxy = new ListenerEventsClient(binding, endPoint);

            return(proxy);
        }
示例#4
0
        public void ExecuteTestSuite(TestSuite testSuite, List <TestCase> discreteTestCases, TestProfile testProfile, TestListenerCollection testListeners,
                                     bool suppressExecution)
        {
            LogEvent.Debug("Beginning execution");

            try
            {
                _testProfile = testProfile ?? new TestProfile();

                if (testListeners != null)
                {
                    LogEvent.Debug("Fixing up listeners");

                    _testListeners = fixupTestListeners(testListeners);

                    if (_testListeners.Count > 0)
                    {
                        _listenerEventsClient = getListenerEventsClient();
                        _listenerEventsClient.InitializeService(convertToListenerServiceCollection(testListeners), _testProfile);
                    }
                }

                ExecutionParameters executionParameters = new ExecutionParameters()
                {
                    _testScriptObject  = testSuite,
                    _testCases         = discreteTestCases,
                    _testProfile       = testProfile,
                    _suppressExecution = suppressExecution
                };

                LogEvent.Debug("Beginning executeTestScriptObject");

                executeTestScriptObject(executionParameters);
            }
            catch (Exception e)
            {
                LogEvent.Error(e.Message, e);

                throw;
            }
        }