protected override void Given() { Queues.Add(_queueA); Queues.Add(_queueB); }
public static void Write(string title, string content) { _Queues.Add(new LogInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fffffff"), title, content)); }
public void CreateQueue(QueueDescription queue) { queue = _namespaceManager.CreateQueue(queue); Queues.Add(queue); }
/// <summary> /// Deserializes the specified <see cref="System.Xml.XmlDocument">XmlDocument</see>. /// </summary> /// <param name="ccnetConfig">The ccnet config.</param> /// <exception cref="CCNetConfig.Core.Exceptions.DuplicateProjectNameException">DuplicateProjectNameException</exception> public void Deserialize(XmlDocument ccnetConfig) { this.Projects.Clear(); Queues.Clear(); Version v = Util.GetConfigFileVersion(ccnetConfig); if (v != null) { this.Version = v; } if (ccnetConfig.DocumentElement != null && string.Compare(ccnetConfig.DocumentElement.Name, "cruisecontrol", false) == 0) { /*this.Entities = ccnetConfig.DocumentType.Entities; * foreach ( XmlEntity entity in this.Entities ) { * Console.WriteLine ( entity.ToString () ); * }*/ ItemSerialiserFactory factory = new ItemSerialiserFactory(); // Attempt to deserialise each item in the configuration foreach (XmlElement item in ccnetConfig.DocumentElement.SelectNodes("*")) { IItemSerialiser serialiser = factory.Retrieve(item.Name); if (serialiser != null) { // The serialiser factory knows the item type, so it can be deserialised and // added to the correct collection object output = serialiser.Deserialize(item); if (output is Project) { Project p = output as Project; if (!this.Projects.Contains(p.Name)) { this.Projects.Add(p); } else { throw new DuplicateProjectNameException(p.Name); } } else if (output is Queue) { Queue q = output as Queue; if (!Queues.Contains(q.Name)) { Queues.Add(q); } else { throw new Exception(string.Format("Duplicate queue definition: '{0}'", q.Name)); } } else if (output is ServerSecurity) { Security = output as ServerSecurity; } } else { // Currently throwing an exception if an unhandled item is found // This should be changed to something a bit nicer throw new Exception( string.Format("Unhandled item found: '{0}'", item.Name)); } } if (Util.UserSettings.SortProject) { this.Projects.Sort(new ProjectList.ProjectComparer()); } // Check all the projects and add any explicit queues that don't have their own configuration foreach (Project p in Projects) { if (!string.IsNullOrEmpty(p.Queue)) { if (!Queues.Contains(p.Queue)) { Queue queue = new Queue(); queue.Name = p.Queue; Queues.Add(queue); } Queues[p.Queue].Projects.Add(p); } } } else { throw new InvalidCastException(string.Format("Can not convert {0} to a cruisecontrol", ccnetConfig.DocumentElement != null ? ccnetConfig.DocumentElement.Name : "UNKNOWN")); } }
private void AddDummyTriggerQueueView() { var dummyTriggerQueueView = new DummyTriggerQueueView(_server); Queues.Add(dummyTriggerQueueView); }
public void AddQueue(ASECloudQueue aseCloudQueue) { Queues.Add(aseCloudQueue); SortQueues(); }