com.atlassian.bamboo.results
Class BuildResultsImpl

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

public class BuildResultsImpl
extends java.lang.Object
implements BuildResults

This contains a build's build results.


Constructor Summary
BuildResultsImpl()
           
BuildResultsImpl(java.lang.String buildKey, BuildState state, java.util.List<java.lang.String> buildErrors, java.util.Collection<Commit> commits, ReasonForBuild reasonForBuild, java.util.Map<java.lang.String,Artifact> artifacts)
          Create the build results
 
Method Summary
 void addBuildErrors(java.util.List<java.lang.String> errorMessages)
          Obtain the changes that triggered the build
 void clearBuildErrors()
           
 BuildResults cloneAsBuildResults(BuildContext buildContext, ReasonForBuild reasonForBuild)
           
 boolean equals(java.lang.Object o)
           
 java.util.Map<java.lang.String,Artifact> getArtifacts()
           
 Build getBuild()
           
 BuildChanges getBuildChanges()
           
 java.util.Date getBuildCompletedTimeStamp()
           
 long getBuildDurationInMilliseconds()
          How long did the build take?
 java.util.List<java.lang.String> getBuildErrors()
          What build errors do we have?
 java.lang.String getBuildKey()
          Which build are these results for?
 BuildManager getBuildManager()
           
 int getBuildNumber()
          Which build generated these results
 java.lang.String getBuildResultsKey()
           
 ExtendedBuildResultsSummary getBuildResultsSummary()
          Find the Build Results Summary object related to this build result summary
 BuildResultsSummaryManager getBuildResultsSummaryManager()
           
 int getBuildReturnCode()
           
 BuildState getBuildState()
          What was the status of the build?
 long getBuildTime()
           
 java.util.Set<Commit> getCommits()
           
 java.util.Map<java.lang.String,java.lang.String> getCustomBuildData()
          Returns a map of string keyed strings for storing arbitrary data
 int getFailedTestCount()
          Get the number of tests that failed during the build
 java.util.List getFailedTestResults()
          Obtain the collection of unit TestResults that failed.
 java.util.Collection getFailedTestResultsByClass()
          Returns a Collection of TestClassResult for all failed tests
 java.util.Map getFailedTestResultsByClassAsMap()
          Map of failed test results by class.
 java.lang.String getFullKey()
           
 BuildResults getNextBuildResults()
           
 java.lang.String getPrettyBuildTime()
           
 BuildResults getPreviousBuildResults()
           
 ReasonForBuild getReasonForBuild()
           
static ReasonForBuild getReasonForBuild(BuildContext buildContext)
           
 java.util.Date getStartTime()
          What was the date and time of the build?
 org.apache.commons.lang.time.StopWatch getStopWatch()
           
 int getSuccessfulTestCount()
          How many successful tests are there?
 double getSuccessfulTestDuration()
           
 java.lang.String getSuccessfulTestDurationAsText()
           
 java.util.List getSuccessfulTestResults()
          Obtain the collection of unit TestResults that passed.
 java.util.Collection getSuccessfulTestResultsByClass()
          Returns a Collection of TestClassResult
 int getTestCount()
          Get the total number of build tests
 TestResultsSummary getTestResults()
           
 java.util.Set<Author> getUniqueAuthors()
          Gets a the unique ChangeAuthors from the getCommits().
 boolean hasFailedTests()
           
 int hashCode()
           
 boolean hasSuccessfulTests()
           
 boolean isCurrentlyQueuedOnly()
           
 void setArtifacts(java.util.Map<java.lang.String,Artifact> artifacts)
           
 void setBuildChanges(BuildChanges buildChanges)
           
 void setBuildErrors(java.util.List<java.lang.String> buildErrors)
           
 void setBuildKey(java.lang.String buildKey)
           
 void setBuildManager(BuildManager buildManager)
           
 void setBuildNumber(int buildNumber)
          Set the build number associated with these results
 void setBuildResultsSummaryManager(BuildResultsSummaryManager buildResultsSummaryManager)
           
 void setBuildReturnCode(int buildReturnCode)
           
 void setBuildState(BuildState buildState)
          Set the build state
 void setCustomBuildData(java.util.Map<java.lang.String,java.lang.String> customBuildData)
           
 void setDurationInMilliseconds(long buildDuration)
           
 void setFailedTestResults(java.util.List failedTestResults)
          Set the tests that failed.
 void setReasonForBuild(ReasonForBuild reasonForBuild)
           
 void setStartTime(java.util.Date date)
          Specify when the build occurred.
 void setSuccessfulTestResults(java.util.List successfulTestResults)
          Set the tests that passed.
 void setTestResults(java.util.Set<TestResults> successfulTestResults, java.util.Set<TestResults> failedTestResults)
           
 void startTimer()
           
 void stopTimer()
           
 java.lang.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(java.lang.String buildKey,
                        BuildState state,
                        java.util.List<java.lang.String> buildErrors,
                        java.util.Collection<Commit> commits,
                        ReasonForBuild reasonForBuild,
                        java.util.Map<java.lang.String,Artifact> artifacts)
Create the build results

Parameters:
buildKey - The unique key of the build
state - Was thebuild successful?
buildErrors - Errors generated by the builder
commits - 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

getBuildChanges

public BuildChanges getBuildChanges()
Specified by:
getBuildChanges in interface BuildResults

setBuildChanges

public void setBuildChanges(BuildChanges buildChanges)
Specified by:
setBuildChanges in interface BuildResults

getBuildKey

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

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

getFullKey

public java.lang.String getFullKey()
Specified by:
getFullKey in interface BuildResults

getBuildResultsSummary

public ExtendedBuildResultsSummary 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)

setStartTime

public void setStartTime(java.util.Date date)
Specify when the build occurred.

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

getStartTime

public java.util.Date getStartTime()
What was the date and time of the build?

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

getBuildCompletedTimeStamp

public java.util.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(@NotNull
                          BuildState buildState)
Set the build state

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

addBuildErrors

public void addBuildErrors(java.util.List<java.lang.String> errorMessages)
Obtain the changes that triggered the build

Specified by:
addBuildErrors in interface BuildResults

getBuildErrors

public java.util.List<java.lang.String> getBuildErrors()
What build errors do we have?

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

setBuildErrors

public void setBuildErrors(java.util.List<java.lang.String> buildErrors)

setTestResults

public void setTestResults(java.util.Set<TestResults> successfulTestResults,
                           java.util.Set<TestResults> failedTestResults)
Specified by:
setTestResults in interface BuildResults

cloneAsBuildResults

public BuildResults cloneAsBuildResults(BuildContext buildContext,
                                        ReasonForBuild reasonForBuild)
Specified by:
cloneAsBuildResults in interface BuildResults

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 java.util.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(java.util.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 java.util.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 java.util.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 java.util.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 java.util.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(java.util.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

getReasonForBuild

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

setReasonForBuild

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

getArtifacts

public java.util.Map<java.lang.String,Artifact> getArtifacts()
Specified by:
getArtifacts in interface BuildResults

setArtifacts

public void setArtifacts(java.util.Map<java.lang.String,Artifact> artifacts)
Specified by:
setArtifacts in interface BuildResults

getCustomBuildData

@NotNull
public java.util.Map<java.lang.String,java.lang.String> getCustomBuildData()
Description copied from interface: BuildResults
Returns a map of string keyed strings for storing arbitrary data

Specified by:
getCustomBuildData in interface BuildResults
Returns:

setCustomBuildData

public void setCustomBuildData(java.util.Map<java.lang.String,java.lang.String> customBuildData)
Specified by:
setCustomBuildData in interface BuildResults

equals

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

getSuccessfulTestDuration

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

getSuccessfulTestDurationAsText

public java.lang.String getSuccessfulTestDurationAsText()
Specified by:
getSuccessfulTestDurationAsText in interface BuildResults

getBuildReturnCode

public int getBuildReturnCode()
Specified by:
getBuildReturnCode in interface BuildResults

setBuildReturnCode

public void setBuildReturnCode(int buildReturnCode)
Specified by:
setBuildReturnCode in interface BuildResults

getUniqueAuthors

public java.util.Set<Author> getUniqueAuthors()
Gets a the unique ChangeAuthors from the getCommits().

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

getCommits

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

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(java.lang.String buildKey)
Specified by:
setBuildKey in interface BuildResults

isCurrentlyQueuedOnly

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

getStopWatch

public org.apache.commons.lang.time.StopWatch getStopWatch()
Specified by:
getStopWatch in interface BuildResults

startTimer

public void startTimer()

stopTimer

public void stopTimer()

clearBuildErrors

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

getBuildTime

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

getPrettyBuildTime

public java.lang.String getPrettyBuildTime()
Specified by:
getPrettyBuildTime in interface BuildResults

setBuildManager

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

hashCode

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

getBuildResultsKey

public java.lang.String getBuildResultsKey()
Specified by:
getBuildResultsKey in interface BuildResults

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getBuildManager

public BuildManager getBuildManager()

getReasonForBuild

public static ReasonForBuild getReasonForBuild(BuildContext buildContext)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.