private void AssertQueueSetChanged(bool result, QueueSetSnapshot firstSnapshot, QueueSetSnapshot secondSnapshot)
        {
            CruiseServerSnapshot cruiseServerSnapshot1 = new CruiseServerSnapshot(null, firstSnapshot);
            CruiseServerSnapshot cruiseServerSnapshot2 = new CruiseServerSnapshot(null, secondSnapshot);

            Assert.AreEqual(result, cruiseServerSnapshot1.IsQueueSetSnapshotChanged(cruiseServerSnapshot2.QueueSetSnapshot));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Polls this server for the latest cruise control server project statuses and queues.
        /// </summary>
        public void Poll()
        {
            try
            {
                CruiseServerSnapshot cruiseServerSnapshot = cruiseServerManager.GetCruiseServerSnapshot();
                if ((lastCruiseServerSnapshot == null) ||
                    (cruiseServerSnapshot == null) ||
                    lastCruiseServerSnapshot.IsQueueSetSnapshotChanged(cruiseServerSnapshot.QueueSetSnapshot))
                {
                    OnQueueChanged(new MonitorServerQueueChangedEventArgs(this));
                }
                lastCruiseServerSnapshot = cruiseServerSnapshot;

                // Find any changes
                DetectAnyChanges(cruiseServerSnapshot);
            }
            catch (Exception ex)
            {
                Trace.WriteLine("ServerMonitorPoll Exception: " + ex);
                lastCruiseServerSnapshot = null;
                connectException         = ex;
                OnQueueChanged(new MonitorServerQueueChangedEventArgs(this));
            }

            OnPolled(new MonitorServerPolledEventArgs(this));
        }