public void SetUp() { integrationQueues = new IntegrationQueueSet(); integrationQueues.Add(TestQueueName, new DefaultQueueConfiguration(TestQueueName)); integrationQueues.Add(TestQueueName2, new DefaultQueueConfiguration(TestQueueName2)); integrationQueue1 = integrationQueues[TestQueueName]; integrationQueue2 = integrationQueues[TestQueueName2]; integrationRequest = new IntegrationRequest(BuildCondition.ForceBuild, "Test", null); project1Mock = new LatchMock(typeof(IProject)); project1Mock.Strict = true; project1Mock.SetupResult("Name", "ProjectOne"); project1Mock.SetupResult("QueueName", TestQueueName); project1Mock.SetupResult("QueuePriority", 0); project2Mock = new LatchMock(typeof(IProject)); project2Mock.Strict = true; project2Mock.SetupResult("Name", "ProjectTwo"); project2Mock.SetupResult("QueueName", TestQueueName2); project2Mock.SetupResult("QueuePriority", 0); queueNotifier1Mock = new LatchMock(typeof(IIntegrationQueueNotifier)); queueNotifier1Mock.Strict = true; queueNotifier2Mock = new LatchMock(typeof(IIntegrationQueueNotifier)); queueNotifier2Mock.Strict = true; integrationQueueItem1 = new IntegrationQueueItem((IProject)project1Mock.MockInstance, integrationRequest, (IIntegrationQueueNotifier)queueNotifier1Mock.MockInstance); integrationQueueItem2 = new IntegrationQueueItem((IProject)project2Mock.MockInstance, integrationRequest, (IIntegrationQueueNotifier)queueNotifier2Mock.MockInstance); }
public void SetUp() { integrationQueues = new IntegrationQueueSet(); integrationQueues.Add(TestQueueName, new DefaultQueueConfiguration(TestQueueName)); integrationQueues.Add(TestQueueName2, new DefaultQueueConfiguration(TestQueueName2)); integrationQueue1 = integrationQueues[TestQueueName]; integrationQueue2 = integrationQueues[TestQueueName2]; integrationRequest = new IntegrationRequest(BuildCondition.ForceBuild, "Test", null); project1Mock = new Mock <IProject>(MockBehavior.Strict); project1Mock.SetupGet(project => project.Name).Returns("ProjectOne"); project1Mock.SetupGet(project => project.QueueName).Returns(TestQueueName); project1Mock.SetupGet(project => project.QueuePriority).Returns(0); project2Mock = new Mock <IProject>(MockBehavior.Strict); project2Mock.SetupGet(project => project.Name).Returns("ProjectTwo"); project2Mock.SetupGet(project => project.QueueName).Returns(TestQueueName2); project2Mock.SetupGet(project => project.QueuePriority).Returns(0); queueNotifier1Mock = new Mock <IIntegrationQueueNotifier>(MockBehavior.Strict); queueNotifier2Mock = new Mock <IIntegrationQueueNotifier>(MockBehavior.Strict); integrationQueueItem1 = new IntegrationQueueItem((IProject)project1Mock.Object, integrationRequest, (IIntegrationQueueNotifier)queueNotifier1Mock.Object); integrationQueueItem2 = new IntegrationQueueItem((IProject)project2Mock.Object, integrationRequest, (IIntegrationQueueNotifier)queueNotifier2Mock.Object); }
public void AddQueueNameCreatesNewQueue() { set.Add("q1", new DefaultQueueConfiguration("q1")); IIntegrationQueue q = set["q1"]; Assert.IsNotNull(q); }
private void Initialize(IConfiguration configuration) { foreach (IProject project in configuration.Projects) { // Force the queue to be created if it does not exist already. IQueueConfiguration config = configuration.FindQueueConfiguration(project.QueueName); integrationQueues.Add(project.QueueName, config); } projectIntegrators = projectIntegratorListFactory.CreateProjectIntegrators(configuration.Projects, integrationQueues); if (projectIntegrators.Count == 0) { Log.Info("No projects found"); } }
public void SetUp() { integrationTriggerMock = new Mock <ITrigger>(MockBehavior.Strict); projectMock = new Mock <IProject>(MockBehavior.Strict); projectMock.SetupGet(_project => _project.Name).Returns("project"); projectMock.SetupGet(_project => _project.QueueName).Returns(TestQueueName); projectMock.SetupGet(_project => _project.QueuePriority).Returns(0); projectMock.SetupGet(_project => _project.Triggers).Returns(integrationTriggerMock.Object); projectMock.SetupGet(_project => _project.WorkingDirectory).Returns(tempWorkingDir1); projectMock.SetupGet(_project => _project.ArtifactDirectory).Returns(tempArtifactDir1); integrationQueues = new IntegrationQueueSet(); integrationQueues.Add(TestQueueName, new DefaultQueueConfiguration(TestQueueName)); integrationQueue = integrationQueues[TestQueueName]; integrator = new ProjectIntegrator((IProject)projectMock.Object, integrationQueue); }
public void SetUp() { integrationTriggerMock = new LatchMock(typeof(ITrigger)); integrationTriggerMock.Strict = true; projectMock = new LatchMock(typeof(IProject)); projectMock.Strict = true; projectMock.SetupResult("Name", "project"); projectMock.SetupResult("QueueName", TestQueueName); projectMock.SetupResult("QueuePriority", 0); projectMock.SetupResult("Triggers", integrationTriggerMock.MockInstance); projectMock.SetupResult("WorkingDirectory", tempWorkingDir1); projectMock.SetupResult("ArtifactDirectory", tempArtifactDir1); integrationQueues = new IntegrationQueueSet(); integrationQueues.Add(TestQueueName, new DefaultQueueConfiguration(TestQueueName)); integrationQueue = integrationQueues[TestQueueName]; integrator = new ProjectIntegrator((IProject)projectMock.MockInstance, integrationQueue); }
public void SetUp() { integrationQueues = new IntegrationQueueSet(); integrationQueues.Add(TestQueueName, new DefaultQueueConfiguration(TestQueueName)); integrationQueueUseFirst = integrationQueues[TestQueueName]; // Generate a queue to test re-adding string secondQueueName = "Test Queue #2"; IQueueConfiguration readConfig = new DefaultQueueConfiguration(secondQueueName); readConfig.HandlingMode = QueueDuplicateHandlingMode.ApplyForceBuildsReAdd; integrationQueues.Add(secondQueueName, readConfig); integrationQueueReAdd = integrationQueues[secondQueueName]; // Generate a queue to test re-adding to top var fourthQueueName = "Test Queue #4"; var raddTopConfig = new DefaultQueueConfiguration(fourthQueueName); raddTopConfig.HandlingMode = QueueDuplicateHandlingMode.ApplyForceBuildsReAddTop; integrationQueues.Add(fourthQueueName, raddTopConfig); integrationQueueReAddTop = integrationQueues[fourthQueueName]; // Generate a queue to test replacing string thirdQueueName = "Test Queue #3"; IQueueConfiguration replaceConfig = new DefaultQueueConfiguration(thirdQueueName); replaceConfig.HandlingMode = QueueDuplicateHandlingMode.ApplyForceBuildsReplace; integrationQueues.Add(thirdQueueName, replaceConfig); integrationQueueReplace = integrationQueues[thirdQueueName]; integrationRequestForceBuild = new IntegrationRequest(BuildCondition.ForceBuild, "Test", null); integrationRequestIfModificationExists = new IntegrationRequest(BuildCondition.IfModificationExists, "Test", null); project1Mock = new LatchMock(typeof(IProject)); project1Mock.Strict = true; project1Mock.SetupResult("Name", "ProjectOne"); project1Mock.SetupResult("QueueName", TestQueueName); project1Mock.SetupResult("QueuePriority", 0); project2Mock = new LatchMock(typeof(IProject)); project2Mock.Strict = true; project2Mock.SetupResult("Name", "ProjectTwo"); project2Mock.SetupResult("QueueName", TestQueueName); project2Mock.SetupResult("QueuePriority", 0); project3Mock = new LatchMock(typeof(IProject)); project3Mock.Strict = true; project3Mock.SetupResult("Name", "ProjectThree"); project3Mock.SetupResult("QueueName", TestQueueName); project3Mock.SetupResult("QueuePriority", 1); queueNotifier1Mock = new LatchMock(typeof(IIntegrationQueueNotifier)); queueNotifier1Mock.Strict = true; queueNotifier2Mock = new LatchMock(typeof(IIntegrationQueueNotifier)); queueNotifier2Mock.Strict = true; queueNotifier3Mock = new LatchMock(typeof(IIntegrationQueueNotifier)); queueNotifier3Mock.Strict = true; integrationQueueItem1 = new IntegrationQueueItem((IProject)project1Mock.MockInstance, integrationRequestForceBuild, (IIntegrationQueueNotifier)queueNotifier1Mock.MockInstance); integrationQueueItem2 = new IntegrationQueueItem((IProject)project2Mock.MockInstance, integrationRequestForceBuild, (IIntegrationQueueNotifier)queueNotifier2Mock.MockInstance); integrationQueueItem3 = new IntegrationQueueItem((IProject)project3Mock.MockInstance, integrationRequestForceBuild, (IIntegrationQueueNotifier)queueNotifier3Mock.MockInstance); integrationQueueItem4 = new IntegrationQueueItem((IProject)project2Mock.MockInstance, integrationRequestIfModificationExists, (IIntegrationQueueNotifier)queueNotifier2Mock.MockInstance); }
public void SetUp() { integrationQueues = new IntegrationQueueSet(); integrationQueues.Add(TestQueueName, new DefaultQueueConfiguration(TestQueueName)); integrationQueueUseFirst = integrationQueues[TestQueueName]; // Generate a queue to test re-adding string secondQueueName = "Test Queue #2"; IQueueConfiguration readConfig = new DefaultQueueConfiguration(secondQueueName); readConfig.HandlingMode = QueueDuplicateHandlingMode.ApplyForceBuildsReAdd; integrationQueues.Add(secondQueueName, readConfig); integrationQueueReAdd = integrationQueues[secondQueueName]; // Generate a queue to test re-adding to top var fourthQueueName = "Test Queue #4"; var raddTopConfig = new DefaultQueueConfiguration(fourthQueueName); raddTopConfig.HandlingMode = QueueDuplicateHandlingMode.ApplyForceBuildsReAddTop; integrationQueues.Add(fourthQueueName, raddTopConfig); integrationQueueReAddTop = integrationQueues[fourthQueueName]; // Generate a queue to test replacing string thirdQueueName = "Test Queue #3"; IQueueConfiguration replaceConfig = new DefaultQueueConfiguration(thirdQueueName); replaceConfig.HandlingMode = QueueDuplicateHandlingMode.ApplyForceBuildsReplace; integrationQueues.Add(thirdQueueName, replaceConfig); integrationQueueReplace = integrationQueues[thirdQueueName]; integrationRequestForceBuild = new IntegrationRequest(BuildCondition.ForceBuild, "Test", null); integrationRequestIfModificationExists = new IntegrationRequest(BuildCondition.IfModificationExists, "Test", null); project1Mock = new Mock <IProject>(MockBehavior.Strict); project1Mock.SetupGet(project => project.Name).Returns("ProjectOne"); project1Mock.SetupGet(project => project.QueueName).Returns(TestQueueName); project1Mock.SetupGet(project => project.QueuePriority).Returns(0); project2Mock = new Mock <IProject>(MockBehavior.Strict); project2Mock.SetupGet(project => project.Name).Returns("ProjectTwo"); project2Mock.SetupGet(project => project.QueueName).Returns(TestQueueName); project2Mock.SetupGet(project => project.QueuePriority).Returns(0); project3Mock = new Mock <IProject>(MockBehavior.Strict); project3Mock.SetupGet(project => project.Name).Returns("ProjectThree"); project3Mock.SetupGet(project => project.QueueName).Returns(TestQueueName); project3Mock.SetupGet(project => project.QueuePriority).Returns(1); queueNotifier1Mock = new Mock <IIntegrationQueueNotifier>(MockBehavior.Strict); queueNotifier2Mock = new Mock <IIntegrationQueueNotifier>(MockBehavior.Strict); queueNotifier3Mock = new Mock <IIntegrationQueueNotifier>(MockBehavior.Strict); integrationQueueItem1 = new IntegrationQueueItem((IProject)project1Mock.Object, integrationRequestForceBuild, (IIntegrationQueueNotifier)queueNotifier1Mock.Object); integrationQueueItem2 = new IntegrationQueueItem((IProject)project2Mock.Object, integrationRequestForceBuild, (IIntegrationQueueNotifier)queueNotifier2Mock.Object); integrationQueueItem3 = new IntegrationQueueItem((IProject)project3Mock.Object, integrationRequestForceBuild, (IIntegrationQueueNotifier)queueNotifier3Mock.Object); integrationQueueItem4 = new IntegrationQueueItem((IProject)project2Mock.Object, integrationRequestIfModificationExists, (IIntegrationQueueNotifier)queueNotifier2Mock.Object); }