Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Server"/> class.
 /// </summary>
 /// <param name="updateSource">The update source.</param>
 /// <param name="versionProvider">The version provider.</param>
 /// <param name="runner">The manager.</param>
 /// <param name="requests">The storage.</param>
 /// <param name="resultsStorage">The results.</param>
 /// <param name="log">The log.</param>
 /// <param name="projects">The projects.</param>
 public Server(
     IUpdateSource updateSource, 
     IVersionProvider versionProvider,
     ServerTestRunner runner,
     IRequestsStorage requests,
     IResultsStorage resultsStorage,
     ILog log, 
     IProjectsStorage projects)
 {
     this.updateSource = updateSource;
     this.versionProvider = versionProvider;
     this.runner = runner;
     this.requests = requests;
     this.resultsStorage = resultsStorage;
     this.log = log;
     this.projects = projects;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ServerTestRunner"/> class.
        /// </summary>
        /// <param name="agents">The agents.</param>
        /// <param name="tests">The tests.</param>
        /// <param name="requests">The requests.</param>
        /// <param name="projects">The projects.</param>
        /// <param name="results">The results.</param>
        /// <param name="log">The log.</param>
        /// <param name="testsRetriever">The tests parser.</param>
        /// <param name="configurationOperator">The configuration reader.</param>
        /// <param name="scheduler">The scheduler.</param>
        /// <param name="reprocessor">The reprocessor.</param>
        /// <param name="exceptionCatcher">The exception catcher.</param>
        /// <param name="connectionProvider">The connection provider.</param>
        public ServerTestRunner(AgentsCollection agents,
                                TestUnitsCollection tests,
                                IRequestsStorage requests,
                                IProjectsStorage projects,
                                IResultsStorage results,
                                ILog log,
                                ITestsRetriever testsRetriever,
                                IDistributedConfigurationOperator configurationOperator,
                                ITestsScheduler scheduler,
                                ITestReprocessor reprocessor,
                                ExceptionCatcher exceptionCatcher,
                                IConnectionProvider connectionProvider)
        {
            // Initializing fields
            this.projects = projects;
            this.results = results;
            this.log = log;
            this.testsRetriever = testsRetriever;
            this.configurationOperator = configurationOperator;
            this.scheduler = scheduler;
            this.reprocessor = reprocessor;
            this.exceptionCatcher = exceptionCatcher;
            this.connectionProvider = connectionProvider;
            this.requests = requests;
            this.agents = agents;
            this.tests = tests;

            // Binding to request collection events
            requests.Added += (sender, args) => RunAsynchronously(() => ProcessRequest(args.Data));

            // Binding to agent collection events
            agents.ReadyAgentAppeared += (sender, args) => RunAsynchronously(TryToRunIfAvailable);
            agents.ClientDisconnectedOrFailed += (sender, args) => RunAsynchronously(TryToRunIfAvailable);

            // Binding to test collection events
            tests.AvailableAdded += (sender, args) => RunAsynchronously(TryToRunIfAvailable);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestsScheduler"/> class.
 /// </summary>
 /// <param name="agents">The agents.</param>
 /// <param name="tests">The tests.</param>
 /// <param name="requests">The requests.</param>
 public TestsScheduler(AgentsCollection agents, TestUnitsCollection tests, IRequestsStorage requests)
 {
     this.agents = agents;
     this.tests = tests;
     this.requests = requests;
 }