com.atlassian.bamboo.results
Class BuildResultsImpl

java.lang.Object
  extended by com.atlassian.bamboo.results.BuildResultsImpl
All Implemented Interfaces:
BuildResults

public class BuildResultsImpl
extends Object
implements BuildResults

This contains a build's build results.


Constructor Summary
BuildResultsImpl()
           
BuildResultsImpl(String buildKey, File sourceDirectory, BuildState state, List buildErrors, Collection changeList, ReasonForBuild reasonForBuild, Map artifacts)
          Create the build results
 
Method Summary
 void addBuildErrors(List fieldErrors)
           
 void addErrorMessage(String errorMessage)
          Add a build error
 void addErrorMessages(ErrorCollection errors)
           
 boolean equals(Object o)
           
 Map getArtifacts()
           
 Build getBuild()
           
 Date getBuildCompletedTimeStamp()
           
 long getBuildDurationInMilliseconds()
          How long did the build take?
 List getBuildErrors()
          What build errors do we have?
 String getBuildKey()
          Which build are these results for?
 List getBuildLog()
           
 int getBuildNumber()
          Which build generated these results
 String getBuildResultsKey()
           
 BuildResultsSummary getBuildResultsSummary()
          Find the Build Results Summary object related to this build result summary
 BuildResultsSummaryManager getBuildResultsSummaryManager()
           
 BuildState getBuildState()
          What was the status of the build?
 long getBuildTime()
           
 Date getBuildTimeStamp()
          What was the date and time of the build?
 Collection getChanges()
          Obtain the changes that triggered the build
 Map getCustomBuildData()
           
 int getFailedTestCount()
          Get the number of tests that failed during the build
 List getFailedTestResults()
          Obtain the collection of unit TestResults that failed.
 Collection getFailedTestResultsByClass()
          Returns a Collection of TestClassResult for all failed tests
 Map getFailedTestResultsByClassAsMap()
          Map of failed test results by class.
 String getFullKey()
           
 Collection getJiraIssueKeys()
           
 BuildResults getNextBuildResults()
           
 String getPrettyBuildTime()
           
 BuildResults getPreviousBuildResults()
           
 BuildProgressBar getProgressBar()
           
 ReasonForBuild getReasonForBuild()
           
 File getSourceDirectory()
          Where are build's source files
 StopWatch getStopWatch()
           
 int getSuccessfulTestCount()
          How many successful tests are there?
 double getSuccessfulTestDuration()
           
 String getSuccessfulTestDurationAsText()
           
 List getSuccessfulTestResults()
          Obtain the collection of unit TestResults that passed.
 Collection getSuccessfulTestResultsByClass()
          Returns a Collection of TestClassResult
 int getTestCount()
          Get the total number of build tests
 TestResultsSummary getTestResults()
           
 Set getUniqueAuthors()
          Gets a the unique ChangeAuthors from the getChanges().
 boolean hasBuildErrors()
          Does this build have any errors
 boolean hasFailedTests()
           
 int hashCode()
           
 boolean hasSuccessfulTests()
           
 boolean isCurrentlyQueuedOnly()
           
 void setArtifacts(Map artifacts)
           
 void setBuildKey(String buildKey)
           
 void setBuildLog(List buildLog)
           
 void setBuildManager(BuildManager buildManager)
           
 void setBuildNumber(int buildNumber)
          Set the build number associated with these results
 void setBuildResultsSummaryManager(BuildResultsSummaryManager buildResultsSummaryManager)
           
 void setBuildState(BuildState buildState)
          Set the build state
 void setBuildTimeStamp(Date date)
          Specify when the build occurred.
 void setDurationInMilliseconds(long buildDuration)
           
 void setFailedTestResults(List failedTestResults)
          Set the tests that failed.
 void setReasonForBuild(ReasonForBuild reasonForBuild)
           
 void setSourceDirectory(File sourceCodeDirectory)
           
 void setSuccessfulTestResults(List successfulTestResults)
          Set the tests that passed.
 void startTimer()
           
 void stopTimer()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BuildResultsImpl

public BuildResultsImpl()

BuildResultsImpl

public BuildResultsImpl(String buildKey,
                        File sourceDirectory,
                        BuildState state,
                        List buildErrors,
                        Collection changeList,
                        ReasonForBuild reasonForBuild,
                        Map artifacts)
Create the build results

Parameters:
buildKey - The unique key of the build
sourceDirectory - The location of the build source files
state - Was thebuild successful?
buildErrors - Errors generated by the builder
changeList - The changes that triggered the build
reasonForBuild - Why are we building the build?
artifacts - Custom build artifacts
Method Detail

getBuild

public Build getBuild()
Specified by:
getBuild in interface BuildResults

getBuildKey

public String getBuildKey()
Which build are these results for?

Specified by:
getBuildKey in interface BuildResults
Returns:
The unique key of the build

getFullKey

public String getFullKey()
Specified by:
getFullKey in interface BuildResults

getBuildResultsSummary

public BuildResultsSummary getBuildResultsSummary()
Find the Build Results Summary object related to this build result summary

Specified by:
getBuildResultsSummary in interface BuildResults
Returns:

getBuildResultsSummaryManager

public BuildResultsSummaryManager getBuildResultsSummaryManager()

setBuildResultsSummaryManager

public void setBuildResultsSummaryManager(BuildResultsSummaryManager buildResultsSummaryManager)

setBuildTimeStamp

public void setBuildTimeStamp(Date date)
Specify when the build occurred.

Specified by:
setBuildTimeStamp in interface BuildResults
Parameters:
date - The date and time of the build

getBuildTimeStamp

public Date getBuildTimeStamp()
What was the date and time of the build?

Specified by:
getBuildTimeStamp in interface BuildResults
Returns:
The build time stamp

getBuildCompletedTimeStamp

public Date getBuildCompletedTimeStamp()
Specified by:
getBuildCompletedTimeStamp in interface BuildResults

setDurationInMilliseconds

public void setDurationInMilliseconds(long buildDuration)
Specified by:
setDurationInMilliseconds in interface BuildResults

getBuildDurationInMilliseconds

public long getBuildDurationInMilliseconds()
How long did the build take?

Specified by:
getBuildDurationInMilliseconds in interface BuildResults
Returns:
The time in milliseconds

getBuildState

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

Specified by:
getBuildState in interface BuildResults
Returns:
Build status

setBuildState

public void setBuildState(BuildState buildState)
Set the build state

Specified by:
setBuildState in interface BuildResults
Parameters:
buildState - The pass/fail state of the build

getChanges

public Collection getChanges()
Obtain the changes that triggered the build

Specified by:
getChanges in interface BuildResults
Returns:
List of changes

addErrorMessage

public void addErrorMessage(String errorMessage)
Add a build error

Specified by:
addErrorMessage in interface BuildResults
Parameters:
errorMessage - The error message to add

addBuildErrors

public void addBuildErrors(List fieldErrors)
Specified by:
addBuildErrors in interface BuildResults

getBuildErrors

public List getBuildErrors()
What build errors do we have?

Specified by:
getBuildErrors in interface BuildResults
Returns:
The errors.

hasBuildErrors

public boolean hasBuildErrors()
Does this build have any errors

Specified by:
hasBuildErrors in interface BuildResults
Returns:
true iff the build has errors

setBuildNumber

public void setBuildNumber(int buildNumber)
Set the build number associated with these results

Specified by:
setBuildNumber in interface BuildResults
Parameters:
buildNumber - The build number

getBuildNumber

public int getBuildNumber()
Which build generated these results

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

getFailedTestResults

public List getFailedTestResults()
Obtain the collection of unit TestResults that failed.

Specified by:
getFailedTestResults in interface BuildResults
Returns:
The unit tests that failed

hasFailedTests

public boolean hasFailedTests()
Specified by:
hasFailedTests in interface BuildResults

getFailedTestCount

public int getFailedTestCount()
Get the number of tests that failed during the build

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

setFailedTestResults

public void setFailedTestResults(List failedTestResults)
Set the tests that failed. This is a collection of TestResults, one for each unit test.

Specified by:
setFailedTestResults in interface BuildResults
Parameters:
failedTestResults - The failed unit test results

getSuccessfulTestResults

public List getSuccessfulTestResults()
Obtain the collection of unit TestResults that passed.

Specified by:
getSuccessfulTestResults in interface BuildResults
Returns:
The unit tests that passed

hasSuccessfulTests

public boolean hasSuccessfulTests()
Specified by:
hasSuccessfulTests in interface BuildResults

getSuccessfulTestResultsByClass

public Collection getSuccessfulTestResultsByClass()
Returns a Collection of TestClassResult

Specified by:
getSuccessfulTestResultsByClass in interface BuildResults
Returns:
Collection of TestClassResult. An empty collection if no tests

getFailedTestResultsByClass

public Collection getFailedTestResultsByClass()
Returns a Collection of TestClassResult for all failed tests

Specified by:
getFailedTestResultsByClass in interface BuildResults
Returns:
Collection of TestClassResult. An empty collection if no tests

getFailedTestResultsByClassAsMap

public Map getFailedTestResultsByClassAsMap()
Map of failed test results by class. key is the class name, and the value is a TestClassResult

Specified by:
getFailedTestResultsByClassAsMap in interface BuildResults
Returns:

getSuccessfulTestCount

public int getSuccessfulTestCount()
How many successful tests are there?

Specified by:
getSuccessfulTestCount in interface BuildResults
Returns:
The number of tests that passed

getTestCount

public int getTestCount()
Get the total number of build tests

Specified by:
getTestCount in interface BuildResults
Returns:
The sum of success and failed tests

setSuccessfulTestResults

public void setSuccessfulTestResults(List successfulTestResults)
Set the tests that passed. This is a collection of TestResults, one for each unit test.

Specified by:
setSuccessfulTestResults in interface BuildResults
Parameters:
successfulTestResults - The successful unit test results

getSourceDirectory

public File getSourceDirectory()
Where are build's source files

Specified by:
getSourceDirectory in interface BuildResults
Returns:
The location of the build source files

setSourceDirectory

public void setSourceDirectory(File sourceCodeDirectory)
Specified by:
setSourceDirectory in interface BuildResults

getReasonForBuild

public ReasonForBuild getReasonForBuild()
Specified by:
getReasonForBuild in interface BuildResults

setReasonForBuild

public void setReasonForBuild(ReasonForBuild reasonForBuild)
Specified by:
setReasonForBuild in interface BuildResults

getArtifacts

public Map getArtifacts()
Specified by:
getArtifacts in interface BuildResults

setArtifacts

public void setArtifacts(Map artifacts)
Specified by:
setArtifacts in interface BuildResults

getCustomBuildData

public Map getCustomBuildData()
Specified by:
getCustomBuildData in interface BuildResults

equals

public boolean equals(Object o)
Specified by:
equals in interface BuildResults
Overrides:
equals in class Object

getSuccessfulTestDuration

public double getSuccessfulTestDuration()
Specified by:
getSuccessfulTestDuration in interface BuildResults

getSuccessfulTestDurationAsText

public String getSuccessfulTestDurationAsText()
Specified by:
getSuccessfulTestDurationAsText in interface BuildResults

addErrorMessages

public void addErrorMessages(ErrorCollection errors)
Specified by:
addErrorMessages in interface BuildResults

getBuildLog

public List getBuildLog()
Specified by:
getBuildLog in interface BuildResults

setBuildLog

public void setBuildLog(List buildLog)
Specified by:
setBuildLog in interface BuildResults

getUniqueAuthors

public Set getUniqueAuthors()
Gets a the unique ChangeAuthors from the getChanges().

Specified by:
getUniqueAuthors in interface BuildResults
Returns:
Set of ChangeAuthor. Empty set if no changes

getTestResults

public TestResultsSummary getTestResults()
Specified by:
getTestResults in interface BuildResults

getPreviousBuildResults

public BuildResults getPreviousBuildResults()
Specified by:
getPreviousBuildResults in interface BuildResults

getNextBuildResults

public BuildResults getNextBuildResults()
Specified by:
getNextBuildResults in interface BuildResults

setBuildKey

public void setBuildKey(String buildKey)
Specified by:
setBuildKey in interface BuildResults

isCurrentlyQueuedOnly

public boolean isCurrentlyQueuedOnly()
Specified by:
isCurrentlyQueuedOnly in interface BuildResults

getStopWatch

public StopWatch getStopWatch()
Specified by:
getStopWatch in interface BuildResults

startTimer

public void startTimer()
Specified by:
startTimer in interface BuildResults

stopTimer

public void stopTimer()
Specified by:
stopTimer in interface BuildResults

getBuildTime

public long getBuildTime()
Specified by:
getBuildTime in interface BuildResults

getPrettyBuildTime

public String getPrettyBuildTime()
Specified by:
getPrettyBuildTime in interface BuildResults

setBuildManager

public void setBuildManager(BuildManager buildManager)
Specified by:
setBuildManager in interface BuildResults

getProgressBar

public BuildProgressBar getProgressBar()
Specified by:
getProgressBar in interface BuildResults

hashCode

public int hashCode()
Specified by:
hashCode in interface BuildResults
Overrides:
hashCode in class Object

getJiraIssueKeys

public Collection getJiraIssueKeys()
Specified by:
getJiraIssueKeys in interface BuildResults

getBuildResultsKey

public String getBuildResultsKey()
Specified by:
getBuildResultsKey in interface BuildResults

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006 Atlassian Software Systems. All Rights Reserved.