示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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));
        }
示例#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();
        }
示例#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));
     }
 }
示例#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));
     }
 }
示例#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));
 }
示例#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));
 }
示例#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));
 }
示例#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));
 }
示例#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);
 }