com.atlassian.bamboo.resultsummary
Class BuildResultsSummaryForTesting

java.lang.Object
  extended by com.atlassian.bamboo.resultsummary.BuildResultsSummaryForTesting
All Implemented Interfaces:
BambooObject, BuildResultsSummary, ExtendedBuildResultsSummary, ResultStatisticsProvider, java.lang.Comparable<BuildResultsSummary>

public class BuildResultsSummaryForTesting
extends java.lang.Object
implements ExtendedBuildResultsSummary


Constructor Summary
BuildResultsSummaryForTesting()
          Simple constructor for BuildResultsSummary
BuildResultsSummaryForTesting(BuildResults buildResults)
          Create a summary from an existing build results
BuildResultsSummaryForTesting(BuildState buildState, int buildNumber, long failedTestCount, long successfulTestCount, java.util.Date buildTimeStamp, long duration, ReasonForBuild reasonForBuild, java.util.Collection changeList)
          Initialise the summary with the desired state and build number.
BuildResultsSummaryForTesting(java.lang.String planKey, int buildNumber, BuildState buildState)
           
 
Method Summary
 int compareTo(BuildResultsSummary brs)
           
protected  java.lang.String createChangedByAuthors(java.util.Set updators)
           
 boolean equals(java.lang.Object object)
           
 java.util.Collection<ArtifactLink> getAllArtifactLinks()
          Returns all artifacts.
 java.util.Collection<ArtifactLink> getArtifactLinks()
          Returns only artifacts that exists
 java.lang.Long getBuildAgentId()
          The agent Id
 java.util.Date getBuildCompletedDate()
          When the build finished
 java.util.Date getBuildDate()
          When was the build?
 java.lang.String getBuildKey()
          Full key of the plan.
 int getBuildNumber()
          Which build number was this?
 java.lang.String getBuildResultKey()
          A full build result key e.g.
 BuildState getBuildState()
          What was the success status of the build?
 java.lang.String getBuildTime()
          When did the build start?
 java.lang.String getChangedByAuthors()
           
 java.lang.String getChangesListSummary()
           
 java.lang.String getChangesListSummaryAsJs()
           
 java.util.List<Comment> getComments()
          Gets the associated user comments for the build
 java.util.Set<Commit> getCommits()
           
 java.util.Map<java.lang.String,java.lang.String> getCustomBuildData()
          Custom data map to store random metadata about the build
 DeltaState getDeltaState()
          Gets the DeltaState of the summary.
 long getDuration()
          Get the duration of the build
 java.lang.String getDurationDescription()
          Returns the duration in a "pretty" format.
 double getDurationInSeconds()
           
 long getFailedTestCount()
          How many of the build's tests failed?
 java.util.Set<LinkedJiraIssue> getFixingJiraIssues()
          Return JIRA issues that this build result summary fixes
 long getId()
          Database id of the result
 java.util.Set<java.lang.String> getJiraIssueKeys()
          Returns all the JIRA issue keys linked to this build result
 java.util.Set getJiraIssues()
          Returns all the JIRA issues linked to this build result
 java.util.List getLabellings()
          Tags / labels assocaited with the build
 java.util.List getLabelNames()
          A shortcust method to get all of the label names from the labbellings
 long getQueueDuration()
          How long build was in the queue (in miliseconds)
 java.util.Date getQueueTime()
          When the build queued
 ReasonForBuild getReasonForBuild()
           
 java.lang.String getReasonSummary()
           
 java.util.Set<LinkedJiraIssue> getRelatedJiraIssues()
          Returns JIRA issues that are related to this build result.
 java.lang.String getRelativeBuildDate()
           
 java.lang.String getRelativeBuildDate(java.util.Date comparedTo)
          Provides a relative build date, such as 2 hours ago.
 long getSuccessfulTestCount()
          How many of the build's tests passed?
 java.lang.String getTestSummary()
           
 java.lang.Long getTimeToFix()
          A stored version of how long (milli seconds) it took for this build to fix a failure.
 TriggerReason getTriggerReason()
          Why the build was was triggered
protected  TriggerReasonManager getTriggerReasonManager()
           
 java.util.Set<Author> getUniqueAuthors()
          A shortcut method to get the unique set of authors contributing to this build.
 java.lang.String getVcsRevisionKey()
          The string representing the revision when the build was run.
 long getVcsUpdateDuration()
          How long checkout take (in miliseconds)
 java.util.Date getVcsUpdateTime()
          When the source syncronisation was kicked off
 int hashCode()
           
 boolean isBuiltToday()
           
 boolean isFailed()
          Shortcut method to see if ResultStatisticsProvider.getBuildState() is BuildState.FAILED
 boolean isSuccessful()
          Shortcut method to see if ResultStatisticsProvider.getBuildState() is BuildState.SUCCESS
 void setArtifactLinks(java.util.Collection<ArtifactLink> artifactLinks)
           
 void setBuildState(BuildState buildState)
           
 void setCommits(java.util.Set<Commit> commits)
           
 void setDuration(long duration)
           
 void setId(long id)
           
 void setQueueTime(java.util.Date queueTime)
           
 void setReasonForBuild(ReasonForBuild reasonForBuild)
           
 void setSourceChangeList(java.util.Collection sourceChangeList)
          Convert the change log into a smaller (when persisted to xml) and more convenient format
 void setTriggerReasonManager(TriggerReasonManager triggerReasonManager)
           
 void setVcsRevisionKey(java.lang.String vcsRevisionKey)
           
 void setVcsUpdateTime(java.util.Date vcsUpdateTime)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildResultsSummaryForTesting

public BuildResultsSummaryForTesting()
Simple constructor for BuildResultsSummary


BuildResultsSummaryForTesting

public BuildResultsSummaryForTesting(BuildResults buildResults)
Create a summary from an existing build results

Parameters:
buildResults -

BuildResultsSummaryForTesting

public BuildResultsSummaryForTesting(BuildState buildState,
                                     int buildNumber,
                                     long failedTestCount,
                                     long successfulTestCount,
                                     java.util.Date buildTimeStamp,
                                     long duration,
                                     ReasonForBuild reasonForBuild,
                                     java.util.Collection changeList)
Initialise the summary with the desired state and build number.

Parameters:
buildState - The state of the build
buildNumber - The number of the build
failedTestCount - The number of failed tests in this build
successfulTestCount - The number of successful tests in this build
buildTimeStamp - The time of the build
duration - How long the build took
reasonForBuild - The reason for the build
changeList - The collection of ChangeLogEntrys that triggered the build

BuildResultsSummaryForTesting

public BuildResultsSummaryForTesting(java.lang.String planKey,
                                     int buildNumber,
                                     BuildState buildState)
Method Detail

getBuildKey

@NotNull
public java.lang.String getBuildKey()
Description copied from interface: BuildResultsSummary
Full key of the plan. e.g BAM-MAIN

Specified by:
getBuildKey in interface BuildResultsSummary
Returns:

getCommits

public java.util.Set<Commit> getCommits()
Specified by:
getCommits in interface ExtendedBuildResultsSummary

setCommits

public void setCommits(java.util.Set<Commit> commits)

getBuildState

public BuildState getBuildState()
What was the success status of the build?

Specified by:
getBuildState in interface ResultStatisticsProvider
Returns:
The build state

getBuildNumber

public int getBuildNumber()
Which build number was this?

Specified by:
getBuildNumber in interface ResultStatisticsProvider
Returns:
The build number

getFailedTestCount

public long getFailedTestCount()
How many of the build's tests failed?

Specified by:
getFailedTestCount in interface BuildResultsSummary
Returns:
The number of failed tests

getSuccessfulTestCount

public long getSuccessfulTestCount()
How many of the build's tests passed?

Specified by:
getSuccessfulTestCount in interface BuildResultsSummary
Returns:
The number of successful tests

setDuration

public void setDuration(long duration)

setBuildState

public void setBuildState(BuildState buildState)

getBuildDate

public java.util.Date getBuildDate()
When was the build?

Specified by:
getBuildDate in interface ResultStatisticsProvider
Returns:
The date and time of the build.

getCustomBuildData

@NotNull
public java.util.Map<java.lang.String,java.lang.String> getCustomBuildData()
Description copied from interface: BuildResultsSummary
Custom data map to store random metadata about the build

Specified by:
getCustomBuildData in interface BuildResultsSummary
Returns:

getLabellings

public java.util.List getLabellings()
Description copied from interface: BuildResultsSummary
Tags / labels assocaited with the build

Specified by:
getLabellings in interface BuildResultsSummary
Returns:

getLabelNames

@NotNull
public java.util.List getLabelNames()
Description copied from interface: BuildResultsSummary
A shortcust method to get all of the label names from the labbellings

Specified by:
getLabelNames in interface BuildResultsSummary
Returns:

getJiraIssues

@NotNull
public java.util.Set getJiraIssues()
Description copied from interface: BuildResultsSummary
Returns all the JIRA issues linked to this build result

Specified by:
getJiraIssues in interface BuildResultsSummary
Returns:

getJiraIssueKeys

public java.util.Set<java.lang.String> getJiraIssueKeys()
Description copied from interface: BuildResultsSummary
Returns all the JIRA issue keys linked to this build result

Specified by:
getJiraIssueKeys in interface BuildResultsSummary
Returns:

getTimeToFix

public java.lang.Long getTimeToFix()
Description copied from interface: BuildResultsSummary
A stored version of how long (milli seconds) it took for this build to fix a failure.

Specified by:
getTimeToFix in interface BuildResultsSummary
Returns:
Null if not a fixing build

getComments

@NotNull
public java.util.List<Comment> getComments()
Description copied from interface: BuildResultsSummary
Gets the associated user comments for the build

Specified by:
getComments in interface BuildResultsSummary
Returns:

getUniqueAuthors

public java.util.Set<Author> getUniqueAuthors()
Description copied from interface: BuildResultsSummary
A shortcut method to get the unique set of authors contributing to this build.

Specified by:
getUniqueAuthors in interface BuildResultsSummary
Returns:
Set of Authors

getBuildCompletedDate

public java.util.Date getBuildCompletedDate()
Description copied from interface: BuildResultsSummary
When the build finished

Specified by:
getBuildCompletedDate in interface BuildResultsSummary
Returns:

getDuration

public long getDuration()
Get the duration of the build

Specified by:
getDuration in interface BuildResultsSummary
Returns:
The duration in milliseconds

getDurationInSeconds

public double getDurationInSeconds()
Specified by:
getDurationInSeconds in interface ResultStatisticsProvider

getReasonForBuild

public ReasonForBuild getReasonForBuild()

getTriggerReason

@NotNull
public TriggerReason getTriggerReason()
Description copied from interface: BuildResultsSummary
Why the build was was triggered

Specified by:
getTriggerReason in interface BuildResultsSummary
Returns:

getBuildAgentId

public java.lang.Long getBuildAgentId()
Description copied from interface: BuildResultsSummary
The agent Id

Specified by:
getBuildAgentId in interface BuildResultsSummary
Returns:

setReasonForBuild

public void setReasonForBuild(ReasonForBuild reasonForBuild)

setSourceChangeList

public void setSourceChangeList(java.util.Collection sourceChangeList)
Convert the change log into a smaller (when persisted to xml) and more convenient format

Parameters:
sourceChangeList - The original change log entry

getChangedByAuthors

public java.lang.String getChangedByAuthors()
Specified by:
getChangedByAuthors in interface BuildResultsSummary

getChangesListSummary

public java.lang.String getChangesListSummary()
Specified by:
getChangesListSummary in interface ExtendedBuildResultsSummary

getChangesListSummaryAsJs

public java.lang.String getChangesListSummaryAsJs()

getDeltaState

public DeltaState getDeltaState()
Description copied from interface: BuildResultsSummary
Gets the DeltaState of the summary. It can be a build that fixes, breaks, failing, successfull. Provides a status relative to the previous summary.

Specified by:
getDeltaState in interface BuildResultsSummary
Returns:

getBuildResultKey

@NotNull
public java.lang.String getBuildResultKey()
Description copied from interface: BuildResultsSummary
A full build result key e.g. BAM-MAIN-100

Specified by:
getBuildResultKey in interface BuildResultsSummary
Returns:
String

getVcsRevisionKey

@Nullable
public java.lang.String getVcsRevisionKey()
Description copied from interface: BuildResultsSummary
The string representing the revision when the build was run. This is Repository specific, so may not correspond and thus be parseable by the current repository configuration. May return null since this data is not always available

Specified by:
getVcsRevisionKey in interface BuildResultsSummary
Returns:

setVcsRevisionKey

public void setVcsRevisionKey(java.lang.String vcsRevisionKey)
Specified by:
setVcsRevisionKey in interface BuildResultsSummary

getDurationDescription

@NotNull
public java.lang.String getDurationDescription()
Description copied from interface: BuildResultsSummary
Returns the duration in a "pretty" format. Handles when duration is not known

Specified by:
getDurationDescription in interface BuildResultsSummary
Returns:

getRelativeBuildDate

public java.lang.String getRelativeBuildDate()
Specified by:
getRelativeBuildDate in interface BuildResultsSummary

isBuiltToday

public boolean isBuiltToday()

getRelativeBuildDate

public java.lang.String getRelativeBuildDate(java.util.Date comparedTo)
Provides a relative build date, such as 2 hours ago.

Specified by:
getRelativeBuildDate in interface BuildResultsSummary
Returns:
The relative date

createChangedByAuthors

protected java.lang.String createChangedByAuthors(java.util.Set updators)

getReasonSummary

public java.lang.String getReasonSummary()
Specified by:
getReasonSummary in interface BuildResultsSummary

getTestSummary

public java.lang.String getTestSummary()
Specified by:
getTestSummary in interface BuildResultsSummary

isFailed

public boolean isFailed()
Description copied from interface: BuildResultsSummary
Shortcut method to see if ResultStatisticsProvider.getBuildState() is BuildState.FAILED

Specified by:
isFailed in interface BuildResultsSummary
Returns:

isSuccessful

public boolean isSuccessful()
Description copied from interface: BuildResultsSummary
Shortcut method to see if ResultStatisticsProvider.getBuildState() is BuildState.SUCCESS

Specified by:
isSuccessful in interface BuildResultsSummary
Returns:

getFixingJiraIssues

@NotNull
public java.util.Set<LinkedJiraIssue> getFixingJiraIssues()
Description copied from interface: BuildResultsSummary
Return JIRA issues that this build result summary fixes

Specified by:
getFixingJiraIssues in interface BuildResultsSummary
Returns:

getRelatedJiraIssues

@NotNull
public java.util.Set<LinkedJiraIssue> getRelatedJiraIssues()
Description copied from interface: BuildResultsSummary
Returns JIRA issues that are related to this build result. Does not include fixing issues

Specified by:
getRelatedJiraIssues in interface BuildResultsSummary
Returns:

getAllArtifactLinks

@NotNull
public java.util.Collection<ArtifactLink> getAllArtifactLinks()
Description copied from interface: BuildResultsSummary
Returns all artifacts. Even if the files don't exist

Specified by:
getAllArtifactLinks in interface BuildResultsSummary
Returns:

setArtifactLinks

public void setArtifactLinks(java.util.Collection<ArtifactLink> artifactLinks)

getArtifactLinks

public java.util.Collection<ArtifactLink> getArtifactLinks()
Description copied from interface: BuildResultsSummary
Returns only artifacts that exists

Specified by:
getArtifactLinks in interface BuildResultsSummary
Returns:

getBuildTime

public java.lang.String getBuildTime()
When did the build start?

Specified by:
getBuildTime in interface BuildResultsSummary
Returns:
The date and time of the build.

getId

public long getId()
Description copied from interface: BuildResultsSummary
Database id of the result

Specified by:
getId in interface BambooObject
Specified by:
getId in interface BuildResultsSummary

setId

public void setId(long id)
Specified by:
setId in interface BambooObject

getTriggerReasonManager

protected TriggerReasonManager getTriggerReasonManager()

setTriggerReasonManager

public void setTriggerReasonManager(TriggerReasonManager triggerReasonManager)

getQueueTime

public java.util.Date getQueueTime()
Description copied from interface: BuildResultsSummary
When the build queued

Specified by:
getQueueTime in interface BuildResultsSummary
Returns:

getQueueDuration

public long getQueueDuration()
Description copied from interface: BuildResultsSummary
How long build was in the queue (in miliseconds)

Specified by:
getQueueDuration in interface BuildResultsSummary
Returns:

setQueueTime

public void setQueueTime(java.util.Date queueTime)

getVcsUpdateTime

public java.util.Date getVcsUpdateTime()
Description copied from interface: BuildResultsSummary
When the source syncronisation was kicked off

Specified by:
getVcsUpdateTime in interface BuildResultsSummary
Returns:

getVcsUpdateDuration

public long getVcsUpdateDuration()
Description copied from interface: BuildResultsSummary
How long checkout take (in miliseconds)

Specified by:
getVcsUpdateDuration in interface BuildResultsSummary
Returns:

setVcsUpdateTime

public void setVcsUpdateTime(java.util.Date vcsUpdateTime)

compareTo

public int compareTo(BuildResultsSummary brs)
Specified by:
compareTo in interface java.lang.Comparable<BuildResultsSummary>

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.