Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 7
0
        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);
        }