public IProjectMonitor[] GetProjectStatusMonitors(ISingleServerMonitor[] serverMonitors) { int indexRetval = 0; ArrayList indexList = new ArrayList(); for (int i = 0; i < Projects.Length; i++) { if (Projects[i].ShowProject) { indexList.Add(i); } } IProjectMonitor[] retVal = new IProjectMonitor[indexList.Count]; foreach (int i in indexList) { if (Projects[i].ShowProject) { ICruiseProjectManager projectManager = cruiseProjectManagerFactory.Create(Projects[i], serverManagersList); ISingleServerMonitor serverMonitor = GetServerMonitorForProject(Projects[i], serverMonitors); retVal[indexRetval++] = new ProjectMonitor(Projects[i], projectManager, serverMonitor); } } return(retVal); }
// CCNET-1179: Include the configuration in the arguments. public ProjectMonitor(CCTrayProject configuration, ICruiseProjectManager cruiseProjectManager, ISingleServerMonitor serverMonitor, DateTimeProvider dateTimeProvider) { buildDurationTracker = new BuildDurationTracker(dateTimeProvider); this.cruiseProjectManager = cruiseProjectManager; this.serverMonitor = serverMonitor; this._configuration = configuration; }
public ISingleServerMonitor[] GetServerMonitors() { BuildServer[] buildServers = GetUniqueBuildServerList(); ISingleServerMonitor[] serverMonitors = new ISingleServerMonitor[buildServers.Length]; for (int i = 0; i < buildServers.Length; i++) { BuildServer buildServer = buildServers[i]; ICruiseServerManager serverManager = cruiseServerManagerFactory.Create(buildServer); serverManagersList[buildServer] = serverManager; serverMonitors[i] = new ServerMonitor(serverManager); } return(serverMonitors); }
public ISingleServerMonitor[] GetServerMonitors() { BuildServer[] buildServers = GetUniqueBuildServerList(); ISingleServerMonitor[] serverMonitors = new ISingleServerMonitor[buildServers.Length]; for (int i = 0; i < buildServers.Length; i++) { BuildServer buildServer = buildServers[i]; ICruiseServerManager serverManager = cruiseServerManagerFactory.Create(buildServer); serverManagersList[buildServer] = serverManager; serverMonitors[i] = new ServerMonitor(serverManager); } return serverMonitors; }
public SynchronizedServerMonitor(ISingleServerMonitor serverMonitor, ISynchronizeInvoke synchronizeInvoke) { this.serverMonitor = serverMonitor; // Pass on the ServerSnapshotChanged event serverMonitor.ServerSnapshotChanged += (sender, args) => { if (ServerSnapshotChanged != null) ServerSnapshotChanged(sender, args); }; this.synchronizeInvoke = synchronizeInvoke; serverMonitor.Polled += new MonitorServerPolledEventHandler(ServerMonitor_Polled); serverMonitor.QueueChanged += new MonitorServerQueueChangedEventHandler(ServerMonitor_QueueChanged); }
public SynchronizedServerMonitor(ISingleServerMonitor serverMonitor, ISynchronizeInvoke synchronizeInvoke) { this.serverMonitor = serverMonitor; // Pass on the ServerSnapshotChanged event serverMonitor.ServerSnapshotChanged += (sender, args) => { if (ServerSnapshotChanged != null) { ServerSnapshotChanged(sender, args); } }; this.synchronizeInvoke = synchronizeInvoke; serverMonitor.Polled += new MonitorServerPolledEventHandler(ServerMonitor_Polled); serverMonitor.QueueChanged += new MonitorServerQueueChangedEventHandler(ServerMonitor_QueueChanged); }
public void SetUp() { mockProjectMonitor = new DynamicMock(typeof (IProjectMonitor)); mockProjectMonitor.Strict = true; projectMonitor = (IProjectMonitor) mockProjectMonitor.MockInstance; mockConfiguration = new DynamicMock(typeof (ICCTrayMultiConfiguration)); configuration = (ICCTrayMultiConfiguration) mockConfiguration.MockInstance; ISingleServerMonitor[] serverMonitors = new ISingleServerMonitor[0]; mockConfiguration.SetupResult("GetServerMonitors", serverMonitors); mockConfiguration.SetupResult("GetProjectStatusMonitors", new IProjectMonitor[0], typeof(ISingleServerMonitor[])); mockConfiguration.SetupResult("Icons", new Icons()); mockConfiguration.SetupResult("FixUserName", "John"); GrowlConfiguration growlConfig = new GrowlConfiguration(); mockConfiguration.SetupResult("Growl", growlConfig); eventCount = 0; controller = new MainFormController(configuration, null, null); }
public void SetUp() { mockProjectMonitor = new Mock <IProjectMonitor>(MockBehavior.Strict); projectMonitor = (IProjectMonitor)mockProjectMonitor.Object; mockConfiguration = new Mock <ICCTrayMultiConfiguration>(); configuration = (ICCTrayMultiConfiguration)mockConfiguration.Object; ISingleServerMonitor[] serverMonitors = new ISingleServerMonitor[0]; mockConfiguration.Setup(_configuration => _configuration.GetServerMonitors()).Returns(serverMonitors); mockConfiguration.Setup(_configuration => _configuration.GetProjectStatusMonitors(It.IsAny <ISingleServerMonitor[]>())).Returns(new IProjectMonitor[0]); mockConfiguration.SetupGet(_configuration => _configuration.Icons).Returns(new Icons()); mockConfiguration.SetupGet(_configuration => _configuration.FixUserName).Returns("John"); GrowlConfiguration growlConfig = new GrowlConfiguration(); mockConfiguration.SetupGet(_configuration => _configuration.Growl).Returns(growlConfig); eventCount = 0; controller = new MainFormController(configuration, null, null); }
public void SetUp() { mockProjectMonitor = new DynamicMock(typeof(IProjectMonitor)); mockProjectMonitor.Strict = true; projectMonitor = (IProjectMonitor)mockProjectMonitor.MockInstance; mockConfiguration = new DynamicMock(typeof(ICCTrayMultiConfiguration)); configuration = (ICCTrayMultiConfiguration)mockConfiguration.MockInstance; ISingleServerMonitor[] serverMonitors = new ISingleServerMonitor[0]; mockConfiguration.SetupResult("GetServerMonitors", serverMonitors); mockConfiguration.SetupResult("GetProjectStatusMonitors", new IProjectMonitor[0], typeof(ISingleServerMonitor[])); mockConfiguration.SetupResult("Icons", new Icons()); mockConfiguration.SetupResult("FixUserName", "John"); GrowlConfiguration growlConfig = new GrowlConfiguration(); mockConfiguration.SetupResult("Growl", growlConfig); eventCount = 0; controller = new MainFormController(configuration, null, null); }
public IProjectMonitor[] GetProjectStatusMonitors(ISingleServerMonitor[] serverMonitors) { int indexRetval = 0; ArrayList indexList = new ArrayList(); for (int i = 0; i < Projects.Length; i++) { if (Projects[i].ShowProject) indexList.Add(i); } IProjectMonitor[] retVal = new IProjectMonitor[indexList.Count]; foreach (int i in indexList) { if (Projects[i].ShowProject) { ICruiseProjectManager projectManager = cruiseProjectManagerFactory.Create(Projects[i], serverManagersList); ISingleServerMonitor serverMonitor = GetServerMonitorForProject(Projects[i], serverMonitors); retVal[indexRetval++] = new ProjectMonitor(Projects[i], projectManager, serverMonitor); } } return retVal; }
public IntegrationQueueTreeNodeAdaptor(ISingleServerMonitor serverMonitor) { this.serverMonitor = serverMonitor; serverTreeNode = new TreeNode(); serverTreeNode.Tag = new IntegrationQueueTreeNodeTag(this); }
// CCNET-1179: Include the configuration in the arguments. public ProjectMonitor(CCTrayProject configuration, ICruiseProjectManager cruiseProjectManager, ISingleServerMonitor serverMonitor) : this(configuration, cruiseProjectManager, serverMonitor, new DateTimeProvider()) { }
public MonitorServerQueueChangedEventArgs(ISingleServerMonitor serverMonitor) { ServerMonitor = serverMonitor; }