Esempio n. 1
0
        /// <summary>
        /// Load a TestPackage for possible execution
        /// </summary>
        /// <returns>A TestEngineResult.</returns>
        protected override TestEngineResult LoadPackage()
        {
            log.Info("Loading " + TestPackage.Name);
            Unload();

            try
            {
                if (_agent == null)
                {
                    _agent = _agency.GetAgent(TestPackage, 30000);

                    if (_agent == null)
                    {
                        throw new Exception("Unable to acquire remote process agent");
                    }
                }

                if (_remoteRunner == null)
                {
                    _remoteRunner = _agent.CreateRunner(TestPackage);
                }

                return(_remoteRunner.Load());
            }
            catch (Exception)
            {
                // TODO: Check if this is really needed
                // Clean up if the load failed
                Unload();
                throw;
            }
        }
Esempio n. 2
0
        private void CreateAgentAndRunnerIfNeeded()
        {
            if (_agent == null)
            {
                _agent = _agency.GetAgent(TestPackage);

                if (_agent == null)
                {
                    throw new NUnitEngineException("Unable to acquire remote process agent");
                }
            }

            if (_remoteRunner == null)
            {
                _remoteRunner = _agent.CreateRunner(TestPackage);
            }
        }
Esempio n. 3
0
        private void CreateAgentAndRunner()
        {
            if (_agent == null)
            {
                // Increase the timeout to give time to attach a debugger
                bool debug = TestPackage.GetSetting(EnginePackageSettings.DebugAgent, false) ||
                             TestPackage.GetSetting(EnginePackageSettings.PauseBeforeRun, false);

                _agent = _agency.GetAgent(TestPackage, debug ? DEBUG_TIMEOUT : NORMAL_TIMEOUT);

                if (_agent == null)
                {
                    throw new NUnitEngineException("Unable to acquire remote process agent");
                }
            }

            if (_remoteRunner == null)
            {
                _remoteRunner = _agent.CreateRunner(TestPackage);
            }
        }
Esempio n. 4
0
        private void CreateAgentAndRunner(bool enableDebug, string agentArgs)
        {
            if (_agent == null)
            {
                _agent = Services.TestAgency.GetAgent(
                    RuntimeFramework,
                    30000,
                    enableDebug,
                    agentArgs);

                if (_agent == null)
                {
                    throw new Exception("Unable to acquire remote process agent");
                }
            }

            if (_remoteRunner == null)
            {
                _remoteRunner = _agent.CreateRunner(TestPackage);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Load a TestPackage for possible execution
        /// </summary>
        /// <returns>A TestEngineResult.</returns>
        protected override TestEngineResult LoadPackage()
        {
            log.Info("Loading " + TestPackage.Name);
            Unload();

            try
            {
                if (_agent == null)
                {
                    // Increase the timeout to give time to attach a debugger
                    bool debug = TestPackage.GetSetting(EnginePackageSettings.DebugAgent, false) ||
                                 TestPackage.GetSetting(EnginePackageSettings.PauseBeforeRun, false);

                    _agent = _agency.GetAgent(TestPackage, debug ? DEBUG_TIMEOUT : NORMAL_TIMEOUT);

                    if (_agent == null)
                    {
                        throw new Exception("Unable to acquire remote process agent");
                    }
                }

                if (_remoteRunner == null)
                {
                    _remoteRunner = _agent.CreateRunner(TestPackage);
                }

                return(_remoteRunner.Load());
            }
            catch (Exception)
            {
                // TODO: Check if this is really needed
                // Clean up if the load failed
                Unload();
                throw;
            }
        }
Esempio n. 6
0
 public ITestEngineRunner CreateRunner(TestPackage package)
 {
     return(_remoteAgent.CreateRunner(package));
 }