Esempio n. 1
0
        public MasterTestRunner(IServiceLocator services, TestPackage package)
        {
            if (services == null)
            {
                throw new ArgumentNullException("services");
            }
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }

            _services   = services;
            TestPackage = package;

            // Get references to the services we use
            _projectService    = _services.GetService <IProjectService>();
            _testRunnerFactory = _services.GetService <ITestRunnerFactory>();

#if !NETSTANDARD1_6 && !NETSTANDARD2_0
            _runtimeService = _services.GetService <IRuntimeFrameworkService>();
#endif
#if !NETSTANDARD1_6
            _extensionService = _services.GetService <ExtensionService>();
#endif

            // Last chance to catch invalid settings in package,
            // in case the client runner missed them.
            ValidatePackageSettings();
        }
Esempio n. 2
0
        public MasterTestRunner(IServiceLocator services, TestPackage package)
        {
            if (services == null)
            {
                throw new ArgumentNullException("services");
            }
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }

            _services   = services;
            TestPackage = package;

            // Get references to the services we use
            _projectService    = _services.GetService <IProjectService>();
            _testRunnerFactory = _services.GetService <ITestRunnerFactory>();

            _packageAnalyzer = _services.GetService <TestPackageAnalyzer>();
            _runtimeService  = _services.GetService <IRuntimeFrameworkService>();

            _eventDispatcher = _services.GetService <TestEventDispatcher>();

            // Last chance to catch invalid settings in package,
            // in case the client runner missed them.
            _packageAnalyzer.ValidatePackageSettings(package);
        }
        public MasterTestRunner(IServiceLocator services, TestPackage package)
        {
            if (services == null)
            {
                throw new ArgumentNullException("services");
            }
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }

            _services   = services;
            TestPackage = package;

            // Get references to the services we use
            _projectService = _services.GetService <IProjectService>();
#if !NETSTANDARD1_6 && !NETSTANDARD2_0
            _runtimeService = _services.GetService <IRuntimeFrameworkService>();
#endif
#if !NETSTANDARD1_6
            _extensionService = _services.GetService <ExtensionService>();
#endif
            _engineRunner = _services.GetService <ITestRunnerFactory>().MakeTestRunner(package);

            InitializePackage();
        }
Esempio n. 4
0
        public void StartService()
        {
            try
            {
                // TestAgency requires on the RuntimeFrameworkService.
                _runtimeService = ServiceContext.GetService <IRuntimeFrameworkService>();

                // Any object returned from ServiceContext is an IService
                if (_runtimeService != null && ((IService)_runtimeService).Status == ServiceStatus.Started)
                {
                    try
                    {
                        Start();
                        Status = ServiceStatus.Started;
                    }
                    catch
                    {
                        Status = ServiceStatus.Error;
                        throw;
                    }
                }
                else
                {
                    Status = ServiceStatus.Error;
                }
            }
            catch
            {
                Status = ServiceStatus.Error;
                throw;
            }
        }
 public override void StartService()
 {
     _projectService       = ServiceContext.GetService <IProjectService>();
     _testFrameworkService = ServiceContext.GetService <ITestFrameworkService>();
     _runtimeService       = ServiceContext.GetService <IRuntimeFrameworkService>();
     if (_projectService == null || _testFrameworkService == null || _runtimeService == null)
     {
         Status = ServiceStatus.Error;
     }
 }
Esempio n. 6
0
        public MasterTestRunner(IServiceLocator services, TestPackage package)
        {
            _services   = services;
            TestPackage = package;

            _testRunnerFactory = _services.GetService <ITestRunnerFactory>();
            _projectService    = _services.GetService <IProjectService>();
            _runtimeService    = _services.GetService <IRuntimeFrameworkService>();
            _extensionService  = _services.GetService <ExtensionService>();
            _engineRunner      = _testRunnerFactory.MakeTestRunner(package);
        }
Esempio n. 7
0
        public MasterTestRunner(IServiceLocator services, TestPackage package)
        {
            _services = services;
            TestPackage = package;

            _testRunnerFactory = _services.GetService<ITestRunnerFactory>();
            _projectService = _services.GetService<IProjectService>();
            _runtimeService = _services.GetService<IRuntimeFrameworkService>();
            _extensionService = _services.GetService<ExtensionService>();
            _engineRunner = _testRunnerFactory.MakeTestRunner(package);
        }
        public void Initialize()
        {
            // Validation doesn't look at the files specified, only settings
            _package = new TestPackage("any.dll");

            _runtimeService = Substitute.For <IRuntimeFrameworkService>();
            _runtimeService.IsAvailable("net-2.0").Returns(true);
            _runtimeService.IsAvailable("net-4.0").Returns(true);
            _runtimeService.IsAvailable("net-4.5").Returns(true);
            _runtimeService.IsAvailable(CURRENT_RUNTIME).Returns(true);
            _runtimeService.IsAvailable("netcore-3.0").Returns(true); // Not actually available yet, but used to test

            _validator = new TestPackageValidator(_runtimeService);
        }
        public MasterTestRunner(IServiceLocator services, TestPackage package)
        {
            if (services == null)
            {
                throw new ArgumentNullException("services");
            }
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }

            _services   = services;
            TestPackage = package;

            _projectService   = _services.GetService <IProjectService>();
            _runtimeService   = _services.GetService <IRuntimeFrameworkService>();
            _extensionService = _services.GetService <ExtensionService>();
            _engineRunner     = _services.GetService <ITestRunnerFactory>().MakeTestRunner(package);
            LoadPackage();
        }
Esempio n. 10
0
 public void StartService()
 {
     _runtimeService = ServiceContext.GetService <IRuntimeFrameworkService>();
     if (_runtimeService == null)
     {
         Status = ServiceStatus.Error;
     }
     else
     {
         try
         {
             Start();
             Status = ServiceStatus.Started;
         }
         catch
         {
             Status = ServiceStatus.Error;
             throw;
         }
     }
 }
Esempio n. 11
0
        public void StartService()
        {
            _runtimeService   = ServiceContext.GetService <IRuntimeFrameworkService>();
            _extensionService = ServiceContext.GetService <ExtensionService>();
            if (_runtimeService == null)
            {
                Status = ServiceStatus.Error;
            }
            else
            {
                try
                {
                    // Add plugable agents first, so they can override the builtins
                    if (_extensionService != null)
                    {
                        foreach (IAgentLauncher launcher in _extensionService.GetExtensions <IAgentLauncher>())
                        {
                            _launchers.Add(launcher);
                        }
                    }

                    //_launchers.Add(new Net20AgentLauncher());
                    _launchers.Add(new Net40AgentLauncher());
                    _launchers.Add(new NetCore21AgentLauncher());
                    _launchers.Add(new NetCore31AgentLauncher());
                    _launchers.Add(new Net50AgentLauncher());

                    _remotingTransport.Start();
                    _tcpTransport.Start();
                    Status = ServiceStatus.Started;
                }
                catch
                {
                    Status = ServiceStatus.Error;
                    throw;
                }
            }
        }
Esempio n. 12
0
        public void StartService()
        {
            try
            {
                // TestAgency requires on the RuntimeFrameworkService.
                _runtimeService = ServiceContext.GetService<IRuntimeFrameworkService>();

                // Any object returned from ServiceContext is an IService
                if (_runtimeService != null && ((IService)_runtimeService).Status == ServiceStatus.Started)
                {
                    try
                    {
                        Start();
                        Status = ServiceStatus.Started;
                    }
                    catch
                    {
                        Status = ServiceStatus.Error;
                        throw;
                    }
                }
                else
                {
                    Status = ServiceStatus.Error;
                }
            }
            catch
            {
                Status = ServiceStatus.Error;
                throw;
            }
        }
Esempio n. 13
0
 public MasterTestRunner(IServiceLocator services, TestPackage package)
     : base(services, package)
 {
     _runtimeService   = Services.GetService <IRuntimeFrameworkService>();
     _extensionService = Services.GetService <ExtensionService>();
 }
Esempio n. 14
0
 public TestPackageValidator(IRuntimeFrameworkService runtimeService)
 {
     _runtimeService = runtimeService;
 }
Esempio n. 15
0
 public MasterTestRunner(IServiceLocator services, TestPackage package)
     : base(services, package)
 {
     _runtimeService = Services.GetService<IRuntimeFrameworkService>();
     _extensionService = Services.GetService<ExtensionService>();
 }