示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AgentUpdater"/> class.
 /// </summary>
 /// <param name="connectionProvider">The connection provider.</param>
 /// <param name="versionProvider">The version provider.</param>
 /// <param name="updateSource">The update source.</param>
 /// <param name="agents">The agents.</param>
 /// <param name="log">The log.</param>
 public AgentUpdater(IConnectionProvider connectionProvider, IVersionProvider versionProvider, IUpdateSource updateSource, AgentsCollection agents, ILog log)
 {
     this.connectionProvider = connectionProvider;
     this.versionProvider = versionProvider;
     this.updateSource = updateSource;
     this.agents = agents;
     this.log = log;
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AgentsTracker"/> class.
 /// </summary>
 /// <param name="agents">The agents.</param>
 /// <param name="options">The options.</param>
 /// <param name="log">The log.</param>
 /// <param name="providers">The providers.</param>
 /// <param name="connectionProvider">The connection provider.</param>
 /// <param name="agentUpdater">The agent updater.</param>
 public AgentsTracker(AgentsCollection agents, IConnectionsHostOptions options, ILog log,
                      IEnumerable<IAgentsProvider> providers, IConnectionProvider connectionProvider, IAgentUpdater agentUpdater)
 {
     this.agents = agents;
     this.options = options;
     this.log = log;
     this.providers = providers;
     this.connectionProvider = connectionProvider;
     this.agentUpdater = agentUpdater;
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServerWrapper"/> class.
 /// </summary>
 /// <param name="testRunner">The test runner.</param>
 /// <param name="agentsTracker">The server connections tracker.</param>
 /// <param name="agents">The agents.</param>
 /// <param name="serverHost">The server host.</param>
 public ServerWrapper(
     Common.Server.Services.Server testRunner,
     AgentsTracker agentsTracker,
     AgentsCollection agents,
     ServerHost serverHost = null)
 {
     TestRunner = testRunner;
     this.agentsTracker = agentsTracker;
     this.agents = agents;
     ServerHost = serverHost;
 }
示例#4
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);
        }
示例#5
0
 /// <summary>
 /// Initializes a new instance of dashboard service
 /// </summary>
 /// <param name="agents">The <see cref="AgentsCollection">connections tracker</see> for the server</param>
 /// <param name="log">The log to display for requests</param>
 /// <param name="serverConfiguration">The server configuration.</param>
 /// <param name="connectionProvider">The connection provider.</param>
 public DashboardService(AgentsCollection agents, 
     RollingLog log,
     ServerConfiguration serverConfiguration,
     IConnectionProvider connectionProvider)
 {
     this.agents = agents;
     this.log = log;
     this.serverConfiguration = serverConfiguration;
     this.connectionProvider = connectionProvider;
 }
示例#6
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;
 }
        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);
        }