本文整理汇总了C#中ThoughtWorks.CruiseControl.Remote.ProjectStatus类的典型用法代码示例。如果您正苦于以下问题:C# ProjectStatus类的具体用法?C# ProjectStatus怎么用?C# ProjectStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectStatus类属于ThoughtWorks.CruiseControl.Remote命名空间,在下文中一共展示了ProjectStatus类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: WriteProjectStatus
private static void WriteProjectStatus(XmlWriter xmlWriter, ProjectStatus status, IServerSpecifier serverSpecifier)
{
xmlWriter.WriteStartElement("Project");
xmlWriter.WriteAttributeString("name", status.Name);
xmlWriter.WriteAttributeString("category", status.Category);
xmlWriter.WriteAttributeString("activity", status.Activity.ToString());
xmlWriter.WriteAttributeString("lastBuildStatus", status.BuildStatus.ToString());
xmlWriter.WriteAttributeString("lastBuildLabel", status.LastSuccessfulBuildLabel);
xmlWriter.WriteAttributeString("lastBuildTime", XmlConvert.ToString(status.LastBuildDate, XmlDateTimeSerializationMode.Local));
xmlWriter.WriteAttributeString("nextBuildTime", XmlConvert.ToString(status.NextBuildTime, XmlDateTimeSerializationMode.Local));
xmlWriter.WriteAttributeString("webUrl", status.WebURL);
xmlWriter.WriteAttributeString("CurrentMessage", status.CurrentMessage);
xmlWriter.WriteAttributeString("BuildStage", status.BuildStage);
xmlWriter.WriteAttributeString("serverName", serverSpecifier.ServerName);
xmlWriter.WriteAttributeString("description", status.Description);
xmlWriter.WriteStartElement("messages");
foreach (Message m in status.Messages)
{
xmlWriter.WriteStartElement("message");
xmlWriter.WriteAttributeString("text", m.Text);
xmlWriter.WriteAttributeString("kind", m.Kind.ToString());
xmlWriter.WriteEndElement();
}
xmlWriter.WriteEndElement();
xmlWriter.WriteEndElement();
}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:30,代码来源:XmlReportAction.cs
示例2: ToStringSerialisesAllValues
public void ToStringSerialisesAllValues()
{
ProjectStatus projectStatus = new ProjectStatus("test project", IntegrationStatus.Success, DateTime.Now);
ProjectStatusResponse response = new ProjectStatusResponse();
response.ErrorMessages.Add(new ErrorMessage("Error 1"));
response.ErrorMessages.Add(new ErrorMessage("Error 2"));
response.RequestIdentifier = "request";
response.Result = ResponseResult.Success;
response.Timestamp = DateTime.Now;
response.Projects.Add(projectStatus);
string actual = response.ToString();
string expected = string.Format(System.Globalization.CultureInfo.CurrentCulture,"<projectStatusResponse xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +
"timestamp=\"{2:yyyy-MM-ddTHH:mm:ss.FFFFFFFzzz}\" identifier=\"{0}\" result=\"{1}\">" +
"<error>Error 1</error>" +
"<error>Error 2</error>" +
"<project showForceBuildButton=\"true\" showStartStopButton=\"true\" serverName=\"{5}\" status=\"Running\" buildStatus=\"Success\" name=\"test project\" " +
"queuePriority=\"0\" lastBuildDate=\"{3:yyyy-MM-ddTHH:mm:ss.FFFFFFF}\" nextBuildTime=\"{4:yyyy-MM-ddTHH:mm:ss.FFFFFFF}\">" +
"<activity type=\"Sleeping\" />" +
"</project>" +
"</projectStatusResponse>",
response.RequestIdentifier,
response.Result,
response.Timestamp,
projectStatus.LastBuildDate,
projectStatus.NextBuildTime,
Environment.MachineName);
Assert.AreEqual(expected, actual);
}
开发者ID:robrich,项目名称:CruiseControl.NET,代码行数:28,代码来源:ProjectStatusResponseTests.cs
示例3: DisplayProject
private static void DisplayProject(ProjectStatus project)
{
WriteLine(string.Format("{0}: {1}", project.Name, project.Status), ConsoleColor.White);
WriteLine(string.Format("\tActivity: {0}", project.Activity), ConsoleColor.White);
WriteLine(string.Format("\tBuild Status: {0}", project.BuildStatus), ConsoleColor.White);
if (!string.IsNullOrEmpty(project.BuildStage))
{
XmlDocument stageXml = new XmlDocument();
try
{
stageXml.LoadXml(project.BuildStage);
foreach (XmlElement stageItem in stageXml.SelectNodes("/data/Item"))
{
string stageTime = stageItem.GetAttribute("Time");
string stageData = stageItem.GetAttribute("Data");
WriteLine(string.Format("\tBuild Stage: {0} ({1})", stageData, stageTime), ConsoleColor.White);
}
}
catch
{
WriteLine(string.Format("\tBuild Stage: {0}", project.BuildStage), ConsoleColor.White);
}
}
WriteLine(string.Format("\tLast Build: {0:G}", project.LastBuildDate), ConsoleColor.White);
WriteLine(string.Format("\tNext Build: {0:G}", project.NextBuildTime), ConsoleColor.White);
}
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:26,代码来源:Program.cs
示例4: ProjectGridRow
public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier,
string url, string parametersUrl, Translations translations)
{
this.status = status;
this.serverSpecifier = serverSpecifier;
this.url = url;
this.parametersUrl = parametersUrl;
}
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:8,代码来源:ProjectGridRow.cs
示例5: CompareProjectStatusByQueueAndQueuePriority
private int CompareProjectStatusByQueueAndQueuePriority(ProjectStatus x, ProjectStatus y)
{
if (x.Queue == y.Queue)
{
return x.QueuePriority.CompareTo(y.QueuePriority);
}
return x.Queue.CompareTo(y.Queue);
}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:9,代码来源:ProjectConfigurationServerPlugin.cs
示例6: NameReturnsNameFromStatus
public void NameReturnsNameFromStatus()
{
var client = mocks.DynamicMock<CruiseServerClientBase>();
var server = InitialiseServer();
var status = new ProjectStatus { Name = "Test Project" };
var project = new Project(client, server, status);
mocks.ReplayAll();
Assert.AreEqual(status.Name, project.Name);
}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:9,代码来源:ProjectTests.cs
示例7: ServerReturnsUnderlyingServer
public void ServerReturnsUnderlyingServer()
{
var client = mocks.DynamicMock<CruiseServerClientBase>();
var server = InitialiseServer();
var status = new ProjectStatus();
var project = new Project(client, server, status);
mocks.ReplayAll();
Assert.AreSame(server, project.Server);
}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:9,代码来源:ProjectTests.cs
示例8: ShouldReturnNullIfNamedProjectNotFound
public void ShouldReturnNullIfNamedProjectNotFound()
{
ProjectStatus[] projectStatuses = new ProjectStatus[1];
projectStatuses[0] = new ProjectStatus("no names", IntegrationStatus.Failure, DateTime.Now);
CruiseServerSnapshot cruiseServerSnapshot = new CruiseServerSnapshot(projectStatuses, null);
Assert.IsNull(cruiseServerSnapshot.GetProjectStatus("this doesn't match"));
}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:9,代码来源:CruiseServerSnapshotTest.cs
示例9: GetProjectStatusSendsRequest
public void GetProjectStatusSendsRequest()
{
ProjectStatus status = new ProjectStatus("Test project", IntegrationStatus.Success, DateTime.Now);
ProjectStatusResponse response = new ProjectStatusResponse();
response.Result = ResponseResult.Success;
response.Projects.Add(status);
CruiseServerClient client = new CruiseServerClient(
new ServerStub("GetProjectStatus", typeof(ServerRequest), response));
client.GetProjectStatus();
}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:10,代码来源:CruiseServerClientTests.cs
示例10: CorrectAssignmentOfConstructorArguments
public void CorrectAssignmentOfConstructorArguments()
{
ProjectStatus[] projectStatuses = new ProjectStatus[0];
QueueSetSnapshot queueSetSnapshot = new QueueSetSnapshot();
CruiseServerSnapshot cruiseServerSnapshot = new CruiseServerSnapshot(projectStatuses, queueSetSnapshot);
Assert.AreSame(projectStatuses, cruiseServerSnapshot.ProjectStatuses);
Assert.AreSame(queueSetSnapshot, cruiseServerSnapshot.QueueSetSnapshot);
}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:10,代码来源:CruiseServerSnapshotTest.cs
示例11: ShouldFindProjectStatusBasedOnProjectName
public void ShouldFindProjectStatusBasedOnProjectName()
{
ProjectStatus[] projectStatuses = new ProjectStatus[2];
projectStatuses[0] = new ProjectStatus("test1", IntegrationStatus.Failure, DateTime.Now);
projectStatuses[1] = new ProjectStatus("test2", IntegrationStatus.Success, DateTime.Now);
CruiseServerSnapshot cruiseServerSnapshot = new CruiseServerSnapshot(projectStatuses, null);
Assert.AreSame(projectStatuses[0], cruiseServerSnapshot.GetProjectStatus("test1"));
Assert.AreSame(projectStatuses[1], cruiseServerSnapshot.GetProjectStatus("test2"));
}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:11,代码来源:CruiseServerSnapshotTest.cs
示例12: WhenPollIsCalledRetrievesANewCopyOfTheProjectStatus
public void WhenPollIsCalledRetrievesANewCopyOfTheProjectStatus()
{
ProjectStatus status = new ProjectStatus();
mockProjectManager.ExpectAndReturn("ProjectName", PROJECT_NAME);
mockServerMonitor.ExpectAndReturn("GetProjectStatus", status, PROJECT_NAME);
monitor.Poll();
// deliberately called twice: should not go back to server on 2nd
// call
Assert.AreSame(status, monitor.ProjectStatus);
Assert.AreSame(status, monitor.ProjectStatus);
}
开发者ID:BiYiTuan,项目名称:CruiseControl.NET,代码行数:13,代码来源:ProjectMonitorTest.cs
示例13: SaveAndLoadProjectStatus
public void SaveAndLoadProjectStatus()
{
ProjectStatus projectStatus = new ProjectStatus("project", "category", ProjectActivity.Building, IntegrationStatus.Failure,
ProjectIntegratorState.Running, "http://localhost/ccnet", DateTime.Now, "1.0", "1.0", DateTime.Now, "building", "", 0);
BinaryFormatter binaryFormatter = new BinaryFormatter();
using (MemoryStream stream = new MemoryStream())
{
binaryFormatter.Serialize(stream, projectStatus);
stream.Seek(0, SeekOrigin.Begin);
binaryFormatter.Deserialize(stream);
}
}
开发者ID:robrich,项目名称:CruiseControl.NET,代码行数:13,代码来源:ProjectStatusCompatibilityTest.cs
示例14: ThePollEventIsFiredWhenPollIsInvoked
public void ThePollEventIsFiredWhenPollIsInvoked()
{
Assert.AreEqual(0, pollCount);
ProjectStatus status = new ProjectStatus();
mockProjectManager.ExpectAndReturn("ProjectName", PROJECT_NAME);
mockServerMonitor.ExpectAndReturn("GetProjectStatus", status, PROJECT_NAME);
monitor.Poll();
Assert.AreEqual(1, pollCount);
mockProjectManager.ExpectAndReturn("ProjectName", PROJECT_NAME);
mockServerMonitor.ExpectAndReturn("GetProjectStatus", status, PROJECT_NAME);
monitor.Poll();
Assert.AreEqual(2, pollCount);
}
开发者ID:BiYiTuan,项目名称:CruiseControl.NET,代码行数:15,代码来源:ProjectMonitorTest.cs
示例15: ToStringSerialisesAllValues
public void ToStringSerialisesAllValues()
{
QueueSnapshot queueSnapshot = new QueueSnapshot("queue1");
queueSnapshot.Requests.Add(new QueuedRequestSnapshot("test project", ProjectActivity.Pending));
QueueSetSnapshot queueSetSnapshot = new QueueSetSnapshot();
queueSetSnapshot.Queues.Add(queueSnapshot);
ProjectStatus projectStatus = new ProjectStatus("test project", IntegrationStatus.Success, DateTime.Now);
CruiseServerSnapshot snapshot = new CruiseServerSnapshot(
new ProjectStatus[] { projectStatus },
queueSetSnapshot);
SnapshotResponse response = new SnapshotResponse();
response.ErrorMessages.Add(new ErrorMessage("Error 1"));
response.ErrorMessages.Add(new ErrorMessage("Error 2"));
response.RequestIdentifier = "request";
response.Result = ResponseResult.Success;
response.Timestamp = DateTime.Now;
response.Snapshot = snapshot;
string actual = response.ToString();
string expected = string.Format(System.Globalization.CultureInfo.CurrentCulture,"<snapshotResponse xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +
"timestamp=\"{2:yyyy-MM-ddTHH:mm:ss.FFFFFFFzzz}\" identifier=\"{0}\" result=\"{1}\">" +
"<error>Error 1</error>" +
"<error>Error 2</error>" +
"<snapshot>" +
"<projects>" +
"<projectStatus showForceBuildButton=\"true\" showStartStopButton=\"true\" serverName=\"{6}\" status=\"Running\" buildStatus=\"Success\" name=\"test project\" " +
"queuePriority=\"0\" lastBuildDate=\"{3:yyyy-MM-ddTHH:mm:ss.FFFFFFF}\" nextBuildTime=\"{4:yyyy-MM-ddTHH:mm:ss.FFFFFFF}\">" +
"<activity type=\"Sleeping\" />" +
"<parameters />" +
"</projectStatus>" +
"</projects>" +
"<queueSet>" +
"<queue name=\"queue1\">" +
"<queueRequest projectName=\"test project\" time=\"{5:yyyy-MM-ddTHH:mm:ss.FFFFFFF}\">" +
"<activity type=\"Pending\" />" +
"</queueRequest>" +
"</queue>" +
"</queueSet>" +
"</snapshot>" +
"</snapshotResponse>",
response.RequestIdentifier,
response.Result,
response.Timestamp,
projectStatus.LastBuildDate,
projectStatus.NextBuildTime,
DateTime.MinValue,
Environment.MachineName);
Assert.AreEqual(expected, actual);
}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:48,代码来源:SnapshotResponseTests.cs
示例16: WriteProjectStatus
private static void WriteProjectStatus(XmlWriter xmlWriter, ProjectStatus projectStatus)
{
xmlWriter.WriteStartElement("Project");
xmlWriter.WriteAttributeString("name", projectStatus.Name);
xmlWriter.WriteAttributeString("category", projectStatus.Category);
xmlWriter.WriteAttributeString("activity", projectStatus.Activity.ToString());
xmlWriter.WriteAttributeString("status", projectStatus.Status.ToString());
xmlWriter.WriteAttributeString("lastBuildStatus", projectStatus.BuildStatus.ToString());
xmlWriter.WriteAttributeString("lastBuildLabel", projectStatus.LastSuccessfulBuildLabel);
xmlWriter.WriteAttributeString("lastBuildTime", XmlConvert.ToString(projectStatus.LastBuildDate, XmlDateTimeSerializationMode.Local));
xmlWriter.WriteAttributeString("nextBuildTime", XmlConvert.ToString(projectStatus.NextBuildTime, XmlDateTimeSerializationMode.Local));
xmlWriter.WriteAttributeString("webUrl", projectStatus.WebURL);
xmlWriter.WriteAttributeString("buildStage", projectStatus.BuildStage);
xmlWriter.WriteAttributeString("serverName", projectStatus.ServerName);
xmlWriter.WriteEndElement();
}
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:16,代码来源:CruiseXmlWriter.cs
示例17: GetProjectStatusReturnsProjects
public void GetProjectStatusReturnsProjects()
{
ProjectStatus status = new ProjectStatus("Test project", IntegrationStatus.Success, DateTime.Now);
ProjectStatusResponse response = new ProjectStatusResponse();
response.Result = ResponseResult.Success;
response.Projects.Add(status);
IServerConnection connection = mocks.DynamicMock<IServerConnection>();
SetupResult.For(connection.SendMessage("GetProjectStatus", null))
.IgnoreArguments()
.Return(response);
mocks.ReplayAll();
CruiseServerClient client = new CruiseServerClient(connection);
ProjectStatus[] results = client.GetProjectStatus();
Assert.AreEqual(1, results.Length);
Assert.AreEqual(status, results[0]);
}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:17,代码来源:CruiseServerClientTests.cs
示例18: ShouldRunIntegration
public BuildCondition ShouldRunIntegration()
{
BuildCondition buildCondition = InnerTrigger.ShouldRunIntegration();
if (buildCondition == BuildCondition.NoBuild) return buildCondition;
IntegrationCompleted(); // reset inner trigger
ProjectStatus currentStatus = GetCurrentProjectStatus();
if (lastStatus == null)
{
lastStatus = currentStatus;
return BuildCondition.NoBuild;
}
if (currentStatus.LastBuildDate > lastStatus.LastBuildDate && currentStatus.BuildStatus == TriggerStatus)
{
lastStatus = currentStatus;
return buildCondition;
}
return BuildCondition.NoBuild;
}
开发者ID:vardars,项目名称:ci-factory,代码行数:19,代码来源:ProjectTrigger.cs
示例19: ExecuteGeneratesReport
public void ExecuteGeneratesReport()
{
var projectName = "daProject";
var farmService = this.mocks.StrictMock<IFarmService>();
var cruiseRequest = this.mocks.StrictMock<ICruiseRequest>();
var sessionRetriever = this.mocks.StrictMock<ISessionRetriever>();
var server = this.mocks.StrictMock<IServerSpecifier>();
var project = new ProjectStatus(projectName, IntegrationStatus.Success, new DateTime(2010, 1, 2, 3, 4, 5));
project.ServerName = "TESTMACHINE";
var status = new ProjectStatusOnServer(project, server);
var snapshot = new ProjectStatusListAndExceptions(
new ProjectStatusOnServer[] { status },
new CruiseServerException[0]);
SetupResult.For(cruiseRequest.ProjectName).Return(projectName);
SetupResult.For(cruiseRequest.ServerSpecifier).Return(server);
SetupResult.For(cruiseRequest.RetrieveSessionToken(sessionRetriever)).Return(null);
SetupResult.For(farmService.GetProjectStatusListAndCaptureExceptions(server, null))
.Return(snapshot);
this.mocks.ReplayAll();
var report = new ProjectXmlReport(farmService, sessionRetriever);
var response = report.Execute(cruiseRequest);
this.mocks.VerifyAll();
Assert.IsInstanceOf<XmlFragmentResponse>(response);
var actual = response as XmlFragmentResponse;
var expected = "<CruiseControl>" +
"<Projects>" +
"<Project name=\"daProject\" category=\"\" activity=\"Sleeping\" " +
"status=\"Running\" lastBuildStatus=\"Success\" lastBuildLabel=\"\" " +
"lastBuildTime=\"" + XmlConvert.ToString(project.LastBuildDate, XmlDateTimeSerializationMode.Local) +
"\" nextBuildTime=\"" + XmlConvert.ToString(project.NextBuildTime, XmlDateTimeSerializationMode.Local) + "\" " +
"webUrl=\"\" buildStage=\"\" serverName=\"TESTMACHINE\" />" +
"</Projects>" +
"<Queues />" +
"</CruiseControl>";
Assert.AreEqual(expected, actual.ResponseFragment);
}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:38,代码来源:ProjectXmlReportTests.cs
示例20: TestShouldRunIntegrationAllowedByExclusionFilter
public void TestShouldRunIntegrationAllowedByExclusionFilter()
{
ProjectForceFilter TestSubject = new ProjectForceFilter();
TestSubject.ProjectFilters = new ProjectFilterList();
ProjectFilter Project = new ProjectFilter();
Project.Project = "TestProject";
Project.ServerUri = "TestUri";
Project.ExclusionFilters.Activities = new ProjectActivity[2] { ProjectActivity.Building, ProjectActivity.CheckingModifications };
Project.ExclusionFilters.Conditions = new IntegrationStatus[1] { IntegrationStatus.Failure };
RecorderIRemotingService RemotingRecorder = new RecorderIRemotingService();
RecorderICruiseManager CruiseRecorder = new RecorderICruiseManager();
ProjectStatus Stati = new ProjectStatus();
Stati.Name = "TestProject";
Stati.Activity = ProjectActivity.Sleeping;
Stati.BuildStatus = IntegrationStatus.Success;
CruiseRecorder.Recordings.GetProjectStatusRecording.ReturnValue = new ProjectStatus[1] { Stati };
RemotingRecorder.Recordings.ConnectTypeStringRecording.ReturnValue = CruiseRecorder;
Project.RemoteService = RemotingRecorder;
TestSubject.ProjectFilters.Add(Project);
bool Condition = TestSubject.ShouldRunIntegration(null, null);
Assert.IsTrue(RemotingRecorder.Recordings.ConnectTypeStringRecording.Called);
Assert.AreEqual("TestUri", RemotingRecorder.Recordings.ConnectTypeStringRecording.PassedStringuri);
Assert.AreEqual(typeof(ICruiseManager), RemotingRecorder.Recordings.ConnectTypeStringRecording.PassedTypeproxyType);
Assert.IsTrue(CruiseRecorder.Recordings.GetProjectStatusRecording.Called);
Assert.IsTrue(Condition);
}
开发者ID:vardars,项目名称:ci-factory,代码行数:38,代码来源:TestProjectForceFilter.cs
注:本文中的ThoughtWorks.CruiseControl.Remote.ProjectStatus类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论