Esempio n. 1
0
        /// <summary>
        /// Explore a loaded TestPackage and return information about
        /// the tests found.
        /// </summary>
        /// <param name="filter">A TestFilter used to select tests</param>
        /// <returns>An XmlNode representing the tests found.</returns>
        public XmlNode Explore(TestFilter filter)
        {
            LoadResult = PrepareResult(_engineRunner.Explore(filter))
                         .Aggregate(TEST_RUN_ELEMENT, TestPackage.Name, TestPackage.FullName);

            return(LoadResult.Xml);
        }
Esempio n. 2
0
        /// <summary>
        /// Explore a loaded TestPackage and return information about
        /// the tests found.
        /// </summary>
        /// <param name="filter">A TestFilter used to select tests</param>
        /// <returns>An XmlNode representing the tests found.</returns>
        public XmlNode Explore(TestFilter filter)
        {
            LoadResult = PrepareResult(_engineRunner.Explore(filter))
                         .MakeTestRunResult(TestPackage);

            return(LoadResult.Xml);
        }
Esempio n. 3
0
        /// <summary>
        /// Explore a loaded TestPackage and return information about
        /// the tests found.
        /// </summary>
        /// <param name="filter">A TestFilter used to select tests</param>
        /// <returns>An XmlNode representing the tests found.</returns>
        public XmlNode Explore(TestFilter filter)
        {
            EnsurePackageIsLoaded(); // Needed?

            return(_engineRunner.Explore(filter)
                   .Aggregate(TEST_RUN_ELEMENT, TestPackage.Name, TestPackage.FullName).Xml);
        }
Esempio n. 4
0
        /// <summary>
        /// Explore a loaded TestPackage and return information about
        /// the tests found.
        /// </summary>
        /// <param name="filter">Criteria used to filter the search results</param>
        /// <returns>A TestEngineResult.</returns>
        public TestEngineResult Explore(TestFilter filter)
        {
            if (_runner == null)
            {
                throw new InvalidOperationException("RemoteTestAgent: Explore called before Load");
            }

            return(_runner.Explore(filter));
        }
Esempio n. 5
0
        private void CommandLoop()
        {
            bool keepRunning  = true;
            var  socketReader = new SocketReader(_clientSocket, new BinarySerializationProtocol());

            while (keepRunning)
            {
                var command = socketReader.GetNextMessage <CommandMessage>();

                switch (command.CommandName)
                {
                case "CreateRunner":
                    var package = (TestPackage)command.Arguments[0];
                    _runner = CreateRunner(package);
                    break;

                case "Load":
                    SendResult(_runner.Load());
                    break;

                case "Reload":
                    SendResult(_runner.Reload());
                    break;

                case "Unload":
                    _runner.Unload();
                    break;

                case "Explore":
                    var filter = (TestFilter)command.Arguments[0];
                    SendResult(_runner.Explore(filter));
                    break;

                case "CountTestCases":
                    filter = (TestFilter)command.Arguments[0];
                    SendResult(_runner.CountTestCases(filter));
                    break;

                case "Run":
                    filter = (TestFilter)command.Arguments[0];
                    SendResult(_runner.Run(this, filter));
                    break;

                case "RunAsync":
                    filter = (TestFilter)command.Arguments[0];
                    _runner.RunAsync(this, filter);
                    break;

                case "Stop":
                    keepRunning = false;
                    break;
                }
            }

            Stop();
        }
Esempio n. 6
0
 /// <summary>
 /// Explore a TestPackage and return information about
 /// the tests found.
 /// </summary>
 /// <param name="filter">A TestFilter used to select tests</param>
 /// <returns>A TestEngineResult.</returns>
 protected override TestEngineResult ExploreTests(TestFilter filter)
 {
     try
     {
         return(_remoteRunner.Explore(filter));
     }
     catch (Exception e)
     {
         log.Error("Failed to run remote tests {0}", e.Message);
         return(CreateFailedResult(e));
     }
 }
Esempio n. 7
0
 /// <summary>
 /// Explore a TestPackage and return information about
 /// the tests found.
 /// </summary>
 /// <param name="filter">A TestFilter used to select tests</param>
 /// <returns>A TestEngineResult.</returns>
 public override TestEngineResult Explore(TestFilter filter)
 {
     try
     {
         CreateAgentAndRunner();
         return(_remoteRunner.Explore(filter));
     }
     catch (Exception e)
     {
         log.Error("Failed to run remote tests {0}", ExceptionHelper.BuildMessageAndStackTrace(e));
         return(CreateFailedResult(e));
     }
 }
Esempio n. 8
0
 /// <summary>
 /// Explore a TestPackage and return information about
 /// the tests found.
 /// </summary>
 /// <param name="filter">A TestFilter used to select tests</param>
 /// <returns>A TestEngineResult.</returns>
 protected override TestEngineResult ExploreTests(TestFilter filter)
 {
     return(_remoteRunner.Explore(filter));
 }
Esempio n. 9
0
 /// <summary>
 /// Explore a loaded TestPackage and return information about
 /// the tests found.
 /// </summary>
 /// <param name="filter">A TestFilter used to select tests</param>
 /// <returns>A TestEngineResult.</returns>
 protected override TestEngineResult ExploreTests(TestFilter filter)
 {
     return(_realRunner.Explore(filter).Aggregate(TEST_RUN_ELEMENT, TestPackage.Name, TestPackage.FullName));
 }
Esempio n. 10
0
 /// <summary>
 /// Explore a loaded TestPackage and return information about
 /// the tests found.
 /// </summary>
 /// <param name="filter">Criteria used to filter the search results</param>
 /// <returns>A TestEngineResult.</returns>
 public TestEngineResult Explore(TestFilter filter)
 {
     return(_runner.Explore(filter));
 }
Esempio n. 11
0
 /// <summary>
 /// Explore a loaded TestPackage and return information about
 /// the tests found.
 /// </summary>
 /// <param name="package">The TestPackage to be explored</param>
 /// <returns>A TestEngineResult.</returns>
 public TestEngineResult Explore(TestFilter filter)
 {
     return(runner == null ? null : runner.Explore(filter));
 }
Esempio n. 12
0
 /// <summary>
 /// Explore a loaded TestPackage and return information about
 /// the tests found.
 /// </summary>
 /// <param name="filter">A TestFilter used to select tests</param>
 /// <returns>An XmlNode representing the tests found.</returns>
 public XmlNode Explore(TestFilter filter)
 {
     return(_engineRunner.Explore(filter)
            .Aggregate(TEST_RUN_ELEMENT, TestPackage.Name, TestPackage.FullName).Xml);
 }