|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.build.MockBuildManager
public class MockBuildManager
Constructor Summary | |
---|---|
MockBuildManager()
|
Method Summary | |
---|---|
void |
addBuildResults(Build build,
BuildResults buildResults)
|
void |
addChildBuild(Build build,
java.lang.String childBuildKey)
|
void |
createBuild(Build build,
BuildConfiguration buildConfiguration,
HibernateAcl acl)
Save a new build object with the passed buildConfiguration |
void |
deleteBuild(java.lang.String buildKey)
Removes the build from system |
boolean |
exists(java.lang.String key)
Returns true if build exists with the provided key (eg. |
java.util.Set<Build> |
filterFavouritedBuilds(java.util.Collection<Build> builds,
com.atlassian.user.User user)
Return a set of Build s that are a subset of the given Build s collection that are favourited by the User |
int |
generateBuildNumber(java.lang.String planKey)
|
java.util.Collection<Build> |
getAllBuilds()
Returns a collection of all Build objects |
java.util.Collection<Build> |
getAllBuildsForClone()
|
java.util.Collection<Build> |
getAllBuildsForEdit()
|
java.util.Collection<Build> |
getAllBuildsForRead()
|
java.util.Collection<Plan> |
getAllPlans()
Returns all Plan 's |
Build |
getBuildById(long id)
Returns the build given the id |
Build |
getBuildByKey(java.lang.String key)
Returns the build given a key |
Build |
getBuildByProjectAndName(java.lang.String projectKey,
java.lang.String buildName)
|
BuildResults |
getBuildResults(Build build,
java.lang.Integer buildNumber)
Return BuildResults for the given Build and buildNumber |
BuildResults |
getBuildResults(java.lang.String planKey,
java.lang.Integer buildNumber)
Return BuildResults for the given planKey and buildNumber |
java.util.Collection<Build> |
getBuildsByProjectForRead(Project project)
This is the manager equivalent of a project.getBuilds. |
java.util.Collection<Build> |
getBuildsForDeletion()
|
java.util.Collection |
getFavouriteBuildsByProjectForRead(Project project,
com.atlassian.user.User user)
Return a set of favourited builds Build s that belong to Project and @{link User} |
java.util.Collection |
getFavouriteBuildsForRead(com.atlassian.user.User user)
|
Plan |
getPlanById(long id)
Returns a Plan by its id |
Plan |
getPlanByKey(java.lang.String planKey)
Returns a Plan by its planKey |
int |
getPlanCount()
How many plans currently exist |
java.util.Map<Project,java.util.Collection<Build>> |
getProjectBuilds(boolean includeEmptyProjects)
Return a map of Build collections which belong to a Project |
boolean |
isAllowBuilding(java.lang.String planKey)
Checks if a particular build is allowed to be built. |
boolean |
isBuildingSuspended()
Checks whether or not bamboo is currently suspended from building due to license reasons. |
boolean |
isExistingBuildKey(java.lang.String projectKey,
java.lang.String buildKey)
Returns true if the build key already exists within the given project key |
boolean |
isExistingBuildName(java.lang.String projectKey,
java.lang.String buildName)
Returns true if the build name already exists within the given project key |
boolean |
isPlanCreationAllowed()
Check whether or not a plan can be created or not (based on licensing etc) USE SPARINGLY! |
boolean |
recheckBuildingSuspended()
Force the build manager to double check if building should be suspended or not. |
void |
recordLastBuildNumber(BuildResultsSummary summary,
BuildContext buildContext)
|
void |
removeDependencies(Build dependentBuild)
|
java.util.Collection<Build> |
retreiveAllBuilds()
|
java.lang.String |
revertVcsRevisionKey(java.lang.String buildKey,
java.lang.String revisionForBuild,
java.lang.String previousRevision)
Revert lastVcsRevisionKey in build based on previous build revision contained in BuildContext. |
void |
saveBuild(Build build)
Persists a build |
void |
saveBuildAndDefinition(Build build)
|
void |
saveBuildConfig(Build build,
BuildConfiguration buildConfiguration)
|
void |
savePlan(Plan plan)
Saves the Plan |
void |
saveSuspendBuild(java.lang.String buildKey,
boolean setSuspendBuild)
Persists a build for enable/disable |
void |
updateLatestVcsKey(Plan plan,
java.lang.String vcsRevisionKey)
Updates the build to the latest passed revision key |
void |
updateNames(java.lang.String projectName,
java.lang.String buildName,
Build build)
Updates project and plan names. |
void |
updateNamesAndDescription(java.lang.String projectName,
java.lang.String buildName,
java.lang.String buildDescription,
Build build)
Updates project and plan names and plan description. |
java.lang.String |
updateVcsRevisionKey(BuildContext buildContext)
Updates lastVcsRevisionKey in build based on revision contained in BuildContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockBuildManager()
Method Detail |
---|
public void removeDependencies(Build dependentBuild)
public void saveSuspendBuild(java.lang.String buildKey, boolean setSuspendBuild)
BuildManager
saveSuspendBuild
in interface BuildManager
buildKey
- of the build to be suspended/resumedsetSuspendBuild
- true if the build should be suspended, false if resumedpublic boolean isPlanCreationAllowed()
BuildManager
isPlanCreationAllowed
in interface BuildManager
public boolean isBuildingSuspended()
BuildManager
isBuildingSuspended
in interface BuildManager
public boolean recheckBuildingSuspended()
BuildManager
recheckBuildingSuspended
in interface BuildManager
public int getPlanCount()
BuildManager
getPlanCount
in interface BuildManager
public Build getBuildByKey(java.lang.String key)
BuildManager
getBuildByKey
in interface BuildManager
key
- - full key of the build. eg. BAM-MAIN null safe
Build
if the key matches. Otherwise nullpublic java.util.Set<Build> filterFavouritedBuilds(@NotNull java.util.Collection<Build> builds, @NotNull com.atlassian.user.User user)
BuildManager
Build
s that are a subset of the given Build
s collection that are favourited by the User
filterFavouritedBuilds
in interface BuildManager
@NotNull public java.util.Map<Project,java.util.Collection<Build>> getProjectBuilds(boolean includeEmptyProjects)
BuildManager
Build
collections which belong to a Project
getProjectBuilds
in interface BuildManager
includeEmptyProjects
- set to true if you want all of the projects regardless if they have any builds
public java.lang.String updateVcsRevisionKey(@NotNull BuildContext buildContext)
BuildManager
updateVcsRevisionKey
in interface BuildManager
public java.lang.String revertVcsRevisionKey(@NotNull java.lang.String buildKey, @NotNull java.lang.String revisionForBuild, @Nullable java.lang.String previousRevision)
BuildManager
revertVcsRevisionKey
in interface BuildManager
public Build getBuildById(long id)
BuildManager
getBuildById
in interface BuildManager
Build
. null if not found.public java.util.Collection<Build> getAllBuilds()
BuildManager
Build
objects
getAllBuilds
in interface BuildManager
Collections.emptyList()
if none existspublic java.util.Collection<Build> getAllBuildsForRead()
getAllBuildsForRead
in interface BuildManager
public java.util.Collection<Build> retreiveAllBuilds()
retreiveAllBuilds
in interface BuildManager
public java.util.Collection<Build> getAllBuildsForEdit()
getAllBuildsForEdit
in interface BuildManager
public java.util.Collection<Build> getAllBuildsForClone()
getAllBuildsForClone
in interface BuildManager
public java.util.Collection<Build> getBuildsForDeletion()
getBuildsForDeletion
in interface BuildManager
public java.util.Collection getFavouriteBuildsForRead(com.atlassian.user.User user)
getFavouriteBuildsForRead
in interface BuildManager
public java.util.Collection getFavouriteBuildsByProjectForRead(Project project, com.atlassian.user.User user)
BuildManager
Build
s that belong to Project
and @{link User}
getFavouriteBuildsByProjectForRead
in interface BuildManager
public java.util.Collection<Build> getBuildsByProjectForRead(Project project)
BuildManager
getBuildsByProjectForRead
in interface BuildManager
public boolean isExistingBuildName(java.lang.String projectKey, java.lang.String buildName)
BuildManager
isExistingBuildName
in interface BuildManager
projectKey
- (doesn't have to exist for this check)buildName
- to check
public boolean isExistingBuildKey(java.lang.String projectKey, java.lang.String buildKey)
BuildManager
isExistingBuildKey
in interface BuildManager
projectKey
- (doesn't have to exist for this check)buildKey
- to check
public boolean exists(java.lang.String key)
BuildManager
exists
in interface BuildManager
public void createBuild(Build build, BuildConfiguration buildConfiguration, HibernateAcl acl)
BuildManager
createBuild
in interface BuildManager
build
- @NotNullbuildConfiguration
- @NotNullpublic void saveBuild(Build build)
BuildManager
saveBuild
in interface BuildManager
build
- cannot be nullpublic void saveBuildAndDefinition(Build build)
public void saveBuildConfig(Build build, BuildConfiguration buildConfiguration)
public void deleteBuild(java.lang.String buildKey)
BuildManager
deleteBuild
in interface BuildManager
buildKey
- String name for buildpublic void addBuildResults(Build build, BuildResults buildResults)
addBuildResults
in interface BuildManager
@Nullable public BuildResults getBuildResults(Build build, java.lang.Integer buildNumber)
BuildManager
BuildResults
for the given Build
and buildNumber
getBuildResults
in interface BuildManager
public BuildResults getBuildResults(java.lang.String planKey, java.lang.Integer buildNumber)
BuildManager
BuildResults
for the given planKey and buildNumber
getBuildResults
in interface BuildManager
public int generateBuildNumber(java.lang.String planKey)
public void recordLastBuildNumber(BuildResultsSummary summary, BuildContext buildContext)
public void addChildBuild(Build build, java.lang.String childBuildKey)
public Build getBuildByProjectAndName(java.lang.String projectKey, java.lang.String buildName)
getBuildByProjectAndName
in interface BuildManager
public void updateNames(java.lang.String projectName, java.lang.String buildName, Build build)
BuildManager
updateNames
in interface BuildManager
projectName
- new name of the projectbuildName
- new name of the planbuild
- build object to be modified and stored.public void updateNamesAndDescription(java.lang.String projectName, java.lang.String buildName, java.lang.String buildDescription, Build build)
BuildManager
updateNamesAndDescription
in interface BuildManager
projectName
- new name of the projectbuildName
- new name of the planbuildDescription
- new plan descriptionbuild
- build object to be modified and stored.public void updateLatestVcsKey(@NotNull Plan plan, @NotNull java.lang.String vcsRevisionKey)
PlanManager
updateLatestVcsKey
in interface PlanManager
plan
- - Plan keyvcsRevisionKey
- - revision keypublic boolean isAllowBuilding(@NotNull java.lang.String planKey)
BuildManager
isAllowBuilding
in interface BuildManager
public Plan getPlanById(long id)
PlanManager
Plan
by its id
getPlanById
in interface PlanManager
public Plan getPlanByKey(@NotNull java.lang.String planKey)
PlanManager
Plan
by its planKey
getPlanByKey
in interface PlanManager
@NotNull public java.util.Collection<Plan> getAllPlans()
PlanManager
Plan
's
getAllPlans
in interface PlanManager
public void savePlan(@NotNull Plan plan)
PlanManager
Plan
savePlan
in interface PlanManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |