本文整理汇总了C#中ThoughtWorks.CruiseControl.Remote.IntegrationRequest类的典型用法代码示例。如果您正苦于以下问题:C# IntegrationRequest类的具体用法?C# IntegrationRequest怎么用?C# IntegrationRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IntegrationRequest类属于ThoughtWorks.CruiseControl.Remote命名空间,在下文中一共展示了IntegrationRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateFullManifest
public void GenerateFullManifest()
{
ManifestGenerator generator = new ManifestGenerator();
IntegrationRequest request = new IntegrationRequest(BuildCondition.ForceBuild, "Somewhere", null);
IntegrationSummary summary = new IntegrationSummary(IntegrationStatus.Success, "A Label", "Another Label", new DateTime(2009, 1, 1));
IntegrationResult result = new IntegrationResult("Test project", "Working directory", "Artifact directory", request, summary);
Modification modification1 = GenerateModification("first file", "Add");
Modification modification2 = GenerateModification("second file", "Modify");
result.Modifications = new Modification[] { modification1, modification2 };
List<string> files = new List<string>();
files.Add("first file");
XmlDocument manifest = generator.Generate(result, files.ToArray());
Assert.IsNotNull(manifest);
string actualManifest = manifest.OuterXml;
string expectedManifest = "<manifest>" +
"<header project=\"Test project\" label=\"A Label\" build=\"ForceBuild\" status=\"Unknown\">" +
"<modification user=\"johnDoe\" changeNumber=\"1\" time=\"2009-01-01T00:00:00\">" +
"<comment>A comment</comment>" +
"<file name=\"first file\" type=\"Add\" />" +
"<file name=\"second file\" type=\"Modify\" />" +
"</modification>" +
"</header>" +
"<file name=\"first file\" />" +
"</manifest>";
Assert.AreEqual(expectedManifest, actualManifest);
}
示例2: Fire
public IntegrationRequest Fire()
{
IntegrationRequest request = null;
if (this.lastChanged.HasValue)
{
if (this.InnerTrigger.Fire() != null)
{
var changeTime = File.GetLastWriteTime(this.MonitorFile);
if (changeTime > this.lastChanged.Value)
{
request = new IntegrationRequest(
this.BuildCondition,
this.GetType().Name,
null);
this.lastChanged = changeTime;
}
}
}
else
{
this.lastChanged = File.GetLastWriteTime(this.MonitorFile);
}
return request;
}
示例3: SetUp
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);
}
示例4: GetHashCodeReturnsAValidHasCode
public void GetHashCodeReturnsAValidHasCode()
{
IntegrationRequest request = new IntegrationRequest(BuildCondition.ForceBuild,
"Me",
null);
int expected = request.ToString().GetHashCode();
int actual = request.GetHashCode();
Assert.AreEqual(expected, actual);
}
示例5: HasAttributesAssignedCorrectly
public void HasAttributesAssignedCorrectly()
{
IProject project = new Project();
IntegrationRequest integrationRequest = new IntegrationRequest(BuildCondition.NoBuild, "Test", null);
IIntegrationQueueNotifier integrationQueueNotifier = new TestIntegrationQueueCallback();
IIntegrationQueueItem integrationQueueItem = new IntegrationQueueItem(project, integrationRequest, integrationQueueNotifier);
Assert.AreEqual(project, integrationQueueItem.Project);
Assert.AreEqual(integrationRequest, integrationQueueItem.IntegrationRequest);
Assert.AreEqual(integrationQueueNotifier, integrationQueueItem.IntegrationQueueNotifier);
}
示例6: VerifyNewGetSourceProcessInfoWithAttributes
public void VerifyNewGetSourceProcessInfoWithAttributes()
{
IntegrationRequest request = new IntegrationRequest(BuildCondition.ForceBuild, "source", null);
IntegrationSummary lastSummary = new IntegrationSummary(IntegrationStatus.Success, "label", "lastlabel", DateTime.Now);
IntegrationResult result = new IntegrationResult("test", @"c:\workspace", @"c:\artifacts", request, lastSummary);
PlasticSCM plasticscm = new PlasticSCM();
NetReflector.Read(PLASTICSCM_XML, plasticscm);
string expected = @"c:\plastic\client\cm.exe stb br:/main -repository=mainrep";
ProcessInfo info = plasticscm.GoToBranchProcessInfo(result);
Assert.AreEqual(expected, info.FileName + " " + info.Arguments);
}
示例7: VerifyNewGetSourceProcessInfoBasic
public void VerifyNewGetSourceProcessInfoBasic()
{
IntegrationRequest request = new IntegrationRequest(BuildCondition.ForceBuild, "source", null);
IntegrationSummary lastSummary =
new IntegrationSummary(IntegrationStatus.Success, "label", "lastlabel", DateTime.Now);
IntegrationResult result = new IntegrationResult("test", @"c:\workspace", @"c:\artifacts", request, lastSummary);
PlasticSCM plasticscm = new PlasticSCM();
NetReflector.Read(PLASTICSCM_BASIC_XML, plasticscm);
string expected = @"cm update c:\workspace";
ProcessInfo info = plasticscm.NewGetSourceProcessInfo(result);
Assert.AreEqual(expected, info.FileName + " " + info.Arguments);
}
示例8: VerifyCreateLabelProcessInfoWithAttributes
public void VerifyCreateLabelProcessInfoWithAttributes()
{
IntegrationRequest request = new IntegrationRequest(BuildCondition.ForceBuild, "source", null);
IntegrationSummary lastSummary = new IntegrationSummary(IntegrationStatus.Success, "label", "lastlabel", DateTime.Now);
IntegrationResult result = new IntegrationResult("test", @"c:\workspace", @"c:\artifacts", request, lastSummary);
result.Label = "1";
//check with attributes
PlasticSCM plasticscm = new PlasticSCM();
NetReflector.Read(PLASTICSCM_XML, plasticscm);
string expected = @"c:\plastic\client\cm.exe mklb BL1";
ProcessInfo info = plasticscm.CreateLabelProcessInfo(result);
Assert.AreEqual (expected, info.FileName + " " + info.Arguments);
}
示例9: StartNewIntegration
/// <summary>
/// Starts a new integration result.
/// </summary>
/// <param name="request">The request.</param>
/// <returns>
/// The new <see cref="IIntegrationResult"/>.
/// </returns>
public IIntegrationResult StartNewIntegration(IntegrationRequest request)
{
var result = resultManager.StartNewIntegration(request);
// Copy any parameters to the result
if ((request.BuildValues != null) && (request.BuildValues.Count > 0))
{
result.Parameters.AddRange(
NameValuePair.FromDictionary(request.BuildValues));
}
result.MarkStartTime();
this.GenerateSystemParameterValues(result);
return result;
}
示例10: IntegrationResult
public IntegrationResult(string projectName, string workingDirectory, string artifactDirectory, IntegrationRequest request, IntegrationSummary lastIntegration)
{
ProjectName = projectName;
WorkingDirectory = workingDirectory;
ArtifactDirectory = artifactDirectory;
this.request = (lastIntegration.IsInitial()) ? new IntegrationRequest(BuildCondition.ForceBuild, request.Source, request.UserName) : request;
this.lastIntegration = lastIntegration;
if ((lastIntegration.Status == IntegrationStatus.Exception)
|| (lastIntegration.Status == IntegrationStatus.Failure))
failureUsers = lastIntegration.FailureUsers; // Inherit the previous build's failureUser list if it failed.
buildProgressInformation = new BuildProgressInformation(artifactDirectory, projectName);
this.label = this.LastIntegration.Label;
}
示例11: FireFiresAfterTimePeriodHasExpired
public void FireFiresAfterTimePeriodHasExpired()
{
var innerTrigger = this.mocks.StrictMock<ITrigger>();
Expect.Call(() => { innerTrigger.IntegrationCompleted(); });
var expected = new IntegrationRequest(BuildCondition.IfModificationExists, "Test", null);
Expect.Call(innerTrigger.Fire()).Return(expected);
var clock = new TestClock { Now = DateTime.Now };
var trigger = new RollUpTrigger(clock);
trigger.MinimumTime = new Timeout(10, TimeUnits.MINUTES);
trigger.InnerTrigger = innerTrigger;
mocks.ReplayAll();
trigger.IntegrationCompleted();
clock.TimePasses(new TimeSpan(0, 11, 0));
var actual = trigger.Fire();
Assert.AreSame(expected, actual);
mocks.VerifyAll();
}
示例12: CancellingAPendingRequestWhileBuildingIgnoresState
public void CancellingAPendingRequestWhileBuildingIgnoresState()
{
IProject project = (IProject) projectMock.MockInstance;
IntegrationRequest request1 = new IntegrationRequest(BuildCondition.IfModificationExists, "intervalTrigger", null);
projectMock.Expect("NotifyPendingState");
IntegrationRequest request2 = new IntegrationRequest(BuildCondition.IfModificationExists, "intervalTrigger", null);
// As pending build is cancelled we should not alter state
projectMock.ExpectNoCall("NotifyPendingState");
projectMock.ExpectNoCall("NotifySleepingState");
integrationTriggerMock.Expect("IntegrationCompleted");
integrationQueue.Enqueue(new IntegrationQueueItem(project, request1, integrator));
integrationQueue.Enqueue(new IntegrationQueueItem(project, request2, integrator));
// Cancel second build project on queue
integrator.CancelPendingRequest();
VerifyAll();
}
示例13: ImportAbsoluteBasedManifest
public void ImportAbsoluteBasedManifest()
{
string sourceFile = Path.Combine(Path.GetTempPath(), "ImportManifest.xml");
string expectedManifest = "<manifest>" +
"From a file" +
"</manifest>";
if (File.Exists(sourceFile)) File.Delete(sourceFile);
File.WriteAllText(sourceFile, expectedManifest);
ManifestImporter generator = new ManifestImporter();
generator.FileName = sourceFile;
IntegrationRequest request = new IntegrationRequest(BuildCondition.ForceBuild, "Somewhere", null);
IntegrationSummary summary = new IntegrationSummary(IntegrationStatus.Success, "A Label", "Another Label", new DateTime(2009, 1, 1));
IntegrationResult result = new IntegrationResult("Test project", "Working directory", "Artifact directory", request, summary);
List<string> files = new List<string>();
XmlDocument manifest = generator.Generate(result, files.ToArray());
Assert.IsNotNull(manifest);
string actualManifest = manifest.OuterXml;
Assert.AreEqual(expectedManifest, actualManifest);
}
示例14: FirePassesOnParameters
public void FirePassesOnParameters()
{
var parameters = new[]
{
new NameValuePair("test", "testValue")
};
var request = new IntegrationRequest(BuildCondition.IfModificationExists, "test", null);
var innerTriggerMock = this.mocks.StrictMock<ITrigger>();
Expect.Call(innerTriggerMock.Fire()).Return(request);
var trigger = new ParameterTrigger
{
InnerTrigger = innerTriggerMock,
Parameters = parameters
};
mocks.ReplayAll();
var actual = trigger.Fire();
mocks.VerifyAll();
Assert.AreSame(request, actual);
Assert.AreEqual(1, request.BuildValues.Count);
Assert.AreEqual(parameters[0].Value,
request.BuildValues[parameters[0].Name]);
}
示例15: WriteRequest
private void WriteRequest(IntegrationRequest request)
{
if (request == null) return;
writer.WriteStartElement(Elements.Request);
writer.WriteAttributeString("source", request.Source);
writer.WriteAttributeString("buildCondition", request.BuildCondition.ToString());
writer.WriteString(request.ToString());
writer.WriteEndElement();
// Output the parameters
if ((request.BuildValues != null) && (request.BuildValues.Count > 0))
{
writer.WriteStartElement(Elements.Parameters);
foreach (string key in request.BuildValues.Keys)
{
writer.WriteStartElement(Elements.Parameter);
writer.WriteAttributeString("name", key);
writer.WriteAttributeString("value", request.BuildValues[key]);
writer.WriteEndElement();
}
writer.WriteEndElement();
}
}