Exemplo n.º 1
0
        public void CanLaunchAndConnectToAgent()
        {
            TestAgent agent = null;

            try
            {
                agent = agency.GetAgent(AgentType.ProcessAgent, 2000);
                Assert.IsNotNull(agent);
            }
            finally
            {
                agency.ReleaseAgent(agent);
            }
        }
Exemplo n.º 2
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;
            }
        }
Exemplo n.º 3
0
        public void CanLaunchAndConnectToAgent()
        {
            TestAgent agent = null;

            try
            {
                agent = agency.GetAgent(10000);
                Assert.IsNotNull(agent);
            }
            finally
            {
                if (agent != null)
                {
                    agency.ReleaseAgent(agent);
                }
            }
        }
Exemplo n.º 4
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);
            }
        }
Exemplo n.º 5
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);
            }
        }
Exemplo n.º 6
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;
            }
        }