private BuildState ParseToBuildStatus(IntegrationStatus status, ProjectActivity activity)
        {
            if (activity == ProjectActivity.Building)
                return BuildState.Building;
            
            if (status == IntegrationStatus.Success)
                return BuildState.Good;

            return BuildState.Broken;
        }
Ejemplo n.º 2
0
 public ProjectStatus(ProjectIntegratorState status, IntegrationStatus buildStatus, ProjectActivity activity, string name, string webURL, DateTime lastBuildDate, string lastBuildLabel, string lastSuccessfulBuildLabel, DateTime nextBuildTime)
 {
     this.status                   = status;
     this.buildStatus              = buildStatus;
     this.activity                 = activity;
     this.name                     = name;
     this.webURL                   = webURL;
     this.lastBuildDate            = lastBuildDate;
     this.lastBuildLabel           = lastBuildLabel;
     this.lastSuccessfulBuildLabel = lastSuccessfulBuildLabel;
     this.nextBuildTime            = nextBuildTime;
 }
Ejemplo n.º 3
0
 public ProjectStatus(ProjectIntegratorState status, IntegrationStatus buildStatus, ProjectActivity activity, string name, string webURL, DateTime lastBuildDate, string lastBuildLabel, string lastSuccessfulBuildLabel, DateTime nextBuildTime)
 {
     this.status = status;
     this.buildStatus = buildStatus;
     this.activity = activity;
     this.name = name;
     this.webURL = webURL;
     this.lastBuildDate = lastBuildDate;
     this.lastBuildLabel = lastBuildLabel;
     this.lastSuccessfulBuildLabel = lastSuccessfulBuildLabel;
     this.nextBuildTime = nextBuildTime;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initialise a new populated <see cref="ProjectStatus"/>.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="category"></param>
 /// <param name="activity"></param>
 /// <param name="buildStatus"></param>
 /// <param name="status"></param>
 /// <param name="webURL"></param>
 /// <param name="lastBuildDate"></param>
 /// <param name="lastBuildLabel"></param>
 /// <param name="lastSuccessfulBuildLabel"></param>
 /// <param name="nextBuildTime"></param>
 /// <param name="buildStage"></param>
 /// <param name="queue"></param>
 /// <param name="queuePriority"></param>
 public ProjectStatus(string name, string category, ProjectActivity activity, IntegrationStatus buildStatus, ProjectIntegratorState status, string webURL, DateTime lastBuildDate, string lastBuildLabel, string lastSuccessfulBuildLabel, DateTime nextBuildTime, string buildStage, string queue, int queuePriority)
 {
     this.status = status;
     this.buildStatus = buildStatus;
     this.activity = activity;
     this.name = name;
     this.category = category;
     this.webURL = webURL;
     this.lastBuildDate = new SerializableDateTime(lastBuildDate);
     this.lastBuildLabel = lastBuildLabel;
     this.lastSuccessfulBuildLabel = lastSuccessfulBuildLabel;
     this.nextBuildTime = new SerializableDateTime(nextBuildTime);
     this.currentBuildStage = buildStage;
     this.queue = queue;
     this.queuePriority = queuePriority;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initialise a new populated <see cref="ProjectStatus"/>.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="category"></param>
 /// <param name="activity"></param>
 /// <param name="buildStatus"></param>
 /// <param name="status"></param>
 /// <param name="webURL"></param>
 /// <param name="lastBuildDate"></param>
 /// <param name="lastBuildLabel"></param>
 /// <param name="lastSuccessfulBuildLabel"></param>
 /// <param name="nextBuildTime"></param>
 /// <param name="buildStage"></param>
 /// <param name="queue"></param>
 /// <param name="queuePriority"></param>
 public ProjectStatus(string name, string category, ProjectActivity activity, IntegrationStatus buildStatus, ProjectIntegratorState status, string webURL, DateTime lastBuildDate, string lastBuildLabel, string lastSuccessfulBuildLabel, DateTime nextBuildTime, string buildStage, string queue, int queuePriority)
 {
     this.status                   = status;
     this.buildStatus              = buildStatus;
     this.activity                 = activity;
     this.name                     = name;
     this.category                 = category;
     this.webURL                   = webURL;
     this.lastBuildDate            = new SerializableDateTime(lastBuildDate);
     this.lastBuildLabel           = lastBuildLabel;
     this.lastSuccessfulBuildLabel = lastSuccessfulBuildLabel;
     this.nextBuildTime            = new SerializableDateTime(nextBuildTime);
     this.currentBuildStage        = buildStage;
     this.queue                    = queue;
     this.queuePriority            = queuePriority;
 }
Ejemplo n.º 6
0
 public ProjectStatus(ProjectIntegratorState status, IntegrationStatus buildStatus, 
     ProjectActivity activity, string name, string webURL, DateTime lastBuildDate, TimeSpan lastBuildDuration,
     string lastBuildLabel, string lastSuccessfulBuildLabel, DateTime nextBuildTime,
     string forcee, Modification[] modifications, DateTime currentBuildStartTime, BuildCondition buildCondition)
 {
     this.status = status;
     this.buildStatus = buildStatus;
     this.activity = activity;
     this.name = name;
     this.webURL = webURL;
     this.lastBuildDate = lastBuildDate;
     this.lastBuildLabel = lastBuildLabel;
     this.lastSuccessfulBuildLabel = lastSuccessfulBuildLabel;
     this.nextBuildTime = nextBuildTime;
     this._Forcee = forcee;
     this._Modifications = modifications;
     this.currentBuildStartTime = currentBuildStartTime;
     this.buildCondition = buildCondition;
     this.lastBuildDuration = lastBuildDuration;
 }
Ejemplo n.º 7
0
 public ProjectStatus(ProjectIntegratorState status, IntegrationStatus buildStatus,
                      ProjectActivity activity, string name, string webURL, DateTime lastBuildDate, TimeSpan lastBuildDuration,
                      string lastBuildLabel, string lastSuccessfulBuildLabel, DateTime nextBuildTime,
                      string forcee, Modification[] modifications, DateTime currentBuildStartTime, BuildCondition buildCondition)
 {
     this.status                   = status;
     this.buildStatus              = buildStatus;
     this.activity                 = activity;
     this.name                     = name;
     this.webURL                   = webURL;
     this.lastBuildDate            = lastBuildDate;
     this.lastBuildLabel           = lastBuildLabel;
     this.lastSuccessfulBuildLabel = lastSuccessfulBuildLabel;
     this.nextBuildTime            = nextBuildTime;
     this._Forcee                  = forcee;
     this._Modifications           = modifications;
     this.currentBuildStartTime    = currentBuildStartTime;
     this.buildCondition           = buildCondition;
     this.lastBuildDuration        = lastBuildDuration;
 }
        /// <summary>
        /// Converts a <see cref="ProjectActivity"/> to a <see cref="ProjectSummaryActivity"/>.
        /// </summary>
        /// <param name="activity">The <see cref="ProjectActivity"/>.</param>
        /// <returns>
        /// The <see cref="ProjectSummaryActivity"/>.
        /// </returns>
        private static ProjectSummaryActivity Convert(ProjectActivity activity)
        {
            if (activity.IsBuilding())
            {
                return ProjectSummaryActivity.Building;
            }

            if (activity.IsCheckingModifications())
            {
                return ProjectSummaryActivity.CheckingModifications;
            }

            if (activity.IsPending())
            {
                return ProjectSummaryActivity.Pending;
            }

            if (activity.IsSleeping())
            {
                return ProjectSummaryActivity.Sleeping;
            }

            return ProjectSummaryActivity.Unknown;
        }
		public static ProjectStatus New(ProjectActivity activity, string label)
		{
			return New(DefaultProject, activity, DefaultIntegrationStatus, DefaultIntegratorState, label, DefaultLastBuildDate);
		}
Ejemplo n.º 10
0
 public ProjectStatus(string name, string category, ProjectActivity activity, IntegrationStatus buildStatus, ProjectIntegratorState status, string webURL, DateTime lastBuildDate, string lastBuildLabel, string lastSuccessfulBuildLabel, DateTime nextBuildTime, string buildStage, string queue, int queuePriority, ParameterBase[] parameters) : this(name, category, activity, buildStatus, status, webURL, lastBuildDate, lastBuildLabel, lastSuccessfulBuildLabel, nextBuildTime, buildStage, queue, queuePriority, (parameters == null) ? new List<ParameterBase>() : new List<ParameterBase>(parameters)) { }
Ejemplo n.º 11
0
        /// <summary>
        /// Checks if two <see cref="ProjectActivity"/> are the same.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            ProjectActivity other = obj as ProjectActivity;

            return(other != null && other.ToString() == ToString());
        }
		public static ProjectStatus New(string project, string category, ProjectActivity activity, IntegrationStatus integrationStatus, ProjectIntegratorState integratorState, string label, DateTime lastBuildDate)
		{
            return new ProjectStatus(project, category, activity, integrationStatus, integratorState, DefaultUrl, lastBuildDate, label, label, DefaultLastBuildDate,string.Empty,string.Empty, 0);
		}
Ejemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CCProject"/> class from being created.
 /// </summary>
 /// <param name="client">The client.</param>
 /// <param name="name">The name.</param>
 /// <param name="category">The category.</param>
 /// <param name="activity">The activity.</param>
 /// <param name="buildStatus">The build status.</param>
 /// <param name="status">The status.</param>
 /// <param name="webURL">The web URL.</param>
 /// <param name="lastBuildDate">The last build date.</param>
 /// <param name="lastBuildLabel">The last build label.</param>
 /// <param name="lastSuccessfulBuildLabel">The last successful build label.</param>
 /// <param name="nextBuildTime">The next build time.</param>
 /// <param name="buildStage">The build stage.</param>
 /// <param name="queue">The queue.</param>
 /// <param name="queuePriority">The queue priority.</param>
 /// <param name="parameters">The project parameters</param>
 private CCProject(CruiseServerClientBase client, string name, string category, ProjectActivity activity, IntegrationStatus buildStatus, ProjectIntegratorState status, string webURL, DateTime lastBuildDate, string lastBuildLabel, string lastSuccessfulBuildLabel, DateTime nextBuildTime, string buildStage, string queue, int queuePriority, List<ParameterBase> parameters)
     : base(name, category, activity, buildStatus, status, webURL, lastBuildDate, lastBuildLabel, lastSuccessfulBuildLabel, nextBuildTime, buildStage, queue, queuePriority, parameters)
 {
     this.client = client;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Notifies the state of the sleeping.	
 /// </summary>
 /// <remarks></remarks>
 public void NotifySleepingState()
 {
     currentActivity = ProjectActivity.Sleeping;
 }
 public void TypeGetSetTest()
 {
     ProjectActivity activity = new ProjectActivity();
     activity.Type = "testing";
     Assert.AreEqual("testing", activity.Type);
 }
Ejemplo n.º 16
0
 public ProjectStatus(string name, string category, ProjectActivity activity, IntegrationStatus buildStatus, ProjectIntegratorState status, string webURL, DateTime lastBuildDate, string lastBuildLabel, string lastSuccessfulBuildLabel, DateTime nextBuildTime, string buildStage, string queue, int queuePriority, ParameterBase[] parameters) : this(name, category, activity, buildStatus, status, webURL, lastBuildDate, lastBuildLabel, lastSuccessfulBuildLabel, nextBuildTime, buildStage, queue, queuePriority, (parameters == null) ? new List <ParameterBase>() : new List <ParameterBase>(parameters))
 {
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Notifies the state of the pending.	
 /// </summary>
 /// <remarks></remarks>
 public void NotifyPendingState()
 {
     currentActivity = ProjectActivity.Pending;
 }
Ejemplo n.º 18
0
 public static ProjectStatus New(string project, string category, ProjectActivity activity, IntegrationStatus integrationStatus, ProjectIntegratorState integratorState, string label, DateTime lastBuildDate, string buildStage)
 {
     return new ProjectStatus(project, category, activity, integrationStatus, integratorState, DefaultUrl, lastBuildDate, label, label, DefaultLastBuildDate, buildStage, string.Empty, 0, new List<ParameterBase>());
 }
		private ProjectStatus CreateProjectStatus(IntegrationStatus integrationStatus, ProjectActivity activity)
		{
			return ProjectStatusFixture.New(integrationStatus, activity);
		}
 /// <summary>
 /// Initialise a new populated <see cref="QueuedRequestSnapshot"/>.
 /// </summary>
 /// <param name="projectName"></param>
 /// <param name="activity"></param>
 public QueuedRequestSnapshot(string projectName, ProjectActivity activity)
     : this(projectName, activity, DateTime.MinValue)
 {
 }
Ejemplo n.º 21
0
		public static ProjectStatus New(IntegrationStatus integrationStatus, ProjectActivity activity, DateTime lastBuildDate)
		{
			return New(DefaultProject, activity, integrationStatus, DefaultIntegratorState, DefaultLabel, lastBuildDate);
		}		
        /// <summary>
        /// Initialise a new populated <see cref="QueuedRequestSnapshot"/>.
        /// </summary>
        /// <param name="projectName"></param>
        /// <param name="activity"></param>
        /// <param name="requestTime"></param>
        public QueuedRequestSnapshot(string projectName, ProjectActivity activity, DateTime requestTime)
		{
			this.projectName = projectName;
            this.activity = activity;
            this.requestTime = requestTime;
		}
        /// <summary>
        /// Initialise a new populated <see cref="QueuedRequestSnapshot"/>.
        /// </summary>
        /// <param name="projectName"></param>
        /// <param name="activity"></param>
		public QueuedRequestSnapshot(string projectName, ProjectActivity activity)
            : this(projectName, activity, DateTime.MinValue) { }
 /// <summary>
 /// Initialise a new populated <see cref="QueuedRequestSnapshot"/>.
 /// </summary>
 /// <param name="projectName"></param>
 /// <param name="activity"></param>
 /// <param name="requestTime"></param>
 public QueuedRequestSnapshot(string projectName, ProjectActivity activity, DateTime requestTime)
 {
     this.projectName = projectName;
     this.activity    = activity;
     this.requestTime = requestTime;
 }