/// <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); }
public void Init() { agents = new AgentsCollection(new ConsoleLog()); tests = new TestUnitsCollection(); requests = new RequestsStorage(new ServerConfiguration {PingIntervalInMiliseconds = 10000}, new ConsoleLog()); scheduler = new TestsScheduler(agents, tests, requests); }