Example #1
0
        public TestVerdict ListenersService(string listenerConfig)
        {
            try
            {
                Setup();

                var bob = new TestListenerCollection();

                TestListeners.ReadFromFile(listenerConfig);
                var listeners = TestListeners.TestListenerCollection.ToArray();

                _listenerEventsClient.InitializeService(listeners, null);

                TestMessage += "Completed!";
                TestVerdict  = TestVerdict.Pass;
            }
            catch (Exception e)
            {
                TestMessage += e.ToString();
                TestVerdict  = TestVerdict.Error;
            }
            finally
            {
            }

            return(TestVerdict);
        }
Example #2
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;
            }
        }