Class TestBootstrapManager
java.lang.Object
com.atlassian.bamboo.testutils.setup.TestBootstrapManager
- All Implemented Interfaces:
BootstrapManager,com.atlassian.config.bootstrap.AtlassianBootstrapManager
-
Field Summary
Fields inherited from interface com.atlassian.bamboo.setup.BootstrapManager
INSTANCE_FINGERPRINT_PARAM, SERVER_FINGERPRINT_PARAM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbootstrapDatabase(com.atlassian.config.db.DatabaseDetails dbDetails, boolean embedded) voidbootstrapDatasource(String datasourceName, String hibernateDialect) booleandatabaseContainsExistingData(Connection connection) com.atlassian.config.ApplicationConfigurationThis method returns the root directory underneath which the artifacts are stored.Shared home properties (bamboo-shared.cfg.xml)Gets the directory where Bamboo's build files sit.This method returns the root directory underneath which the build directories are located.Gets the directory where Bamboo's administration.xml file sits@NotNull ServerFingerprintcom.atlassian.config.db.HibernateConfigcom.atlassian.config.db.HibernateConfiguratorLocal home directory;getPropertiesWithPrefix(String prefix) getProperty(String key) @NotNull StringintReturns server key used forBambooEntityOids of this Bamboo instance.com.atlassian.config.setup.SetupPersisterShared home directory;getTestDatabaseConnection(com.atlassian.config.db.DatabaseDetails databaseDetails) getTestDatasourceConnection(String datasourceName) voidinit()booleanbooleanInitializes server key used forBambooEntityOids of this Bamboo instance based onserver ID.booleanbooleanbooleanisPropertyTrue(String prop) booleanvoidvoidvoidremoveProperty(String key) booleanvoidsave()voidsetApplicationConfig(com.atlassian.config.ApplicationConfiguration applicationConfig) voidsetApplicationHome(String applicationHome) Make sure you use either this method orsetApplicationConfig(ApplicationConfiguration)not bothvoidsetArtifactsDirectory(String artifactsDir) voidsetBrokerClientURI(URI brokerURI) voidsetBrokerURI(URI brokerUrl) voidsetBuildDirectory(String buildDirectory) voidsetBuildNumber(String buildNumber) voidsetBuildWorkingDirectory(String buildWorkingDirectory) voidsetConfigDirectory(String configurationDirectory) voidsetDelegate(BootstrapManager bootstrapManager) voidsetH2Version(String h2Version) voidsetHibernateConfigurator(com.atlassian.config.db.HibernateConfigurator hibernateConfigurator) voidsetOperation(String operation) voidsetProperty(String key, Object value) voidsetRepositoryLogsDirectory(String repositoryLogsDirectory) voidsetServerID(String serverId) voidsetServerKey(int serverKey) Set server key used forBambooEntityOids for this Bamboo instance.voidsetSetupComplete(boolean complete)
-
Constructor Details
-
TestBootstrapManager
public TestBootstrapManager()
-
-
Method Details
-
setDelegate
-
removeDelegate
public void removeDelegate() -
getConfigDirectory
Description copied from interface:BootstrapManagerGets the directory where Bamboo's administration.xml file sits- Specified by:
getConfigDirectoryin interfaceBootstrapManager- Returns:
- String representing the path to the folder. Null if not configured
-
setConfigDirectory
- Specified by:
setConfigDirectoryin interfaceBootstrapManager
-
getBuildDirectory
Description copied from interface:BootstrapManagerGets the directory where Bamboo's build files sit. This includes artifacts and the like- Specified by:
getBuildDirectoryin interfaceBootstrapManager- Returns:
- String representing the path to the folder. Null if not configured
-
setBuildDirectory
- Specified by:
setBuildDirectoryin interfaceBootstrapManager
-
getBuildWorkingDirectory
Description copied from interface:BootstrapManagerThis method returns the root directory underneath which the build directories are located. The structure below this directory is not documented - you most likely do not want to use this method, consider using DefaultBuildDirectoryManager methods instead.- Specified by:
getBuildWorkingDirectoryin interfaceBootstrapManager
-
setBuildWorkingDirectory
- Specified by:
setBuildWorkingDirectoryin interfaceBootstrapManager
-
getArtifactsDirectory
Description copied from interface:BootstrapManagerThis method returns the root directory underneath which the artifacts are stored. The structure below this directory is not documented - you most likely do not want to use this method, consider using com.atlassian.bamboo.fileserver.SystemDirectory methods instead.- Specified by:
getArtifactsDirectoryin interfaceBootstrapManager
-
setArtifactsDirectory
- Specified by:
setArtifactsDirectoryin interfaceBootstrapManager
-
getRepositoryLogsDirectory
- Specified by:
getRepositoryLogsDirectoryin interfaceBootstrapManager- Returns:
- the root directory underneath which the repositories logs directories are located.
-
setRepositoryLogsDirectory
- Specified by:
setRepositoryLogsDirectoryin interfaceBootstrapManager
-
getServerID
- Specified by:
getServerIDin interfaceBootstrapManager
-
setServerID
- Specified by:
setServerIDin interfaceBootstrapManager
-
initializeServerKey
public boolean initializeServerKey()Description copied from interface:BootstrapManagerInitializes server key used forBambooEntityOids of this Bamboo instance based onserver ID. Does nothing if the server key is already configured. This method should be externally synchronized.- Specified by:
initializeServerKeyin interfaceBootstrapManager- Returns:
- true if server key has been initialized, false otherwise
-
getServerKey
public int getServerKey()Description copied from interface:BootstrapManagerReturns server key used forBambooEntityOids of this Bamboo instance.- Specified by:
getServerKeyin interfaceBootstrapManager
-
setServerKey
public void setServerKey(int serverKey) Description copied from interface:BootstrapManagerSet server key used forBambooEntityOids for this Bamboo instance.- Specified by:
setServerKeyin interfaceBootstrapManager- Parameters:
serverKey- server key of this instance
-
getBrokerURI
- Specified by:
getBrokerURIin interfaceBootstrapManager- Throws:
URISyntaxException
-
setBrokerURI
- Specified by:
setBrokerURIin interfaceBootstrapManager
-
getBrokerClientURI
- Specified by:
getBrokerClientURIin interfaceBootstrapManager- Throws:
URISyntaxException
-
setBrokerClientURI
- Specified by:
setBrokerClientURIin interfaceBootstrapManager
-
getFingerprint
- Specified by:
getFingerprintin interfaceBootstrapManager- Returns:
- a unique identifier for this startup
-
isBootstrapped
public boolean isBootstrapped()- Specified by:
isBootstrappedin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
getProperty
- Specified by:
getPropertyin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
setProperty
- Specified by:
setPropertyin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
isPropertyTrue
- Specified by:
isPropertyTruein interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
removeProperty
- Specified by:
removePropertyin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
getString
- Specified by:
getStringin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
getFilePathProperty
- Specified by:
getFilePathPropertyin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
getPropertyKeys
- Specified by:
getPropertyKeysin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
getPropertiesWithPrefix
- Specified by:
getPropertiesWithPrefixin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
getBuildNumber
- Specified by:
getBuildNumberin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
setBuildNumber
- Specified by:
setBuildNumberin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
isApplicationHomeValid
public boolean isApplicationHomeValid()- Specified by:
isApplicationHomeValidin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
getHibernateProperties
- Specified by:
getHibernatePropertiesin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
save
public void save() throws com.atlassian.config.ConfigurationException- Specified by:
savein interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager- Throws:
com.atlassian.config.ConfigurationException
-
isSetupComplete
public boolean isSetupComplete()- Specified by:
isSetupCompletein interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
getOperation
- Specified by:
getOperationin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
setOperation
- Specified by:
setOperationin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
setSetupComplete
public void setSetupComplete(boolean complete) - Specified by:
setSetupCompletein interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
bootstrapDatasource
public void bootstrapDatasource(String datasourceName, String hibernateDialect) throws com.atlassian.config.bootstrap.BootstrapException - Specified by:
bootstrapDatasourcein interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager- Throws:
com.atlassian.config.bootstrap.BootstrapException
-
getSetupPersister
public com.atlassian.config.setup.SetupPersister getSetupPersister()- Specified by:
getSetupPersisterin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
getApplicationConfig
public com.atlassian.config.ApplicationConfiguration getApplicationConfig()- Specified by:
getApplicationConfigin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
setApplicationConfig
public void setApplicationConfig(com.atlassian.config.ApplicationConfiguration applicationConfig) -
getApplicationHome
- Specified by:
getApplicationHomein interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
setApplicationHome
public void setApplicationHome(String applicationHome) throws com.atlassian.config.ConfigurationException Make sure you use either this method orsetApplicationConfig(ApplicationConfiguration)not both- Throws:
com.atlassian.config.ConfigurationException
-
getConfiguredApplicationHome
- Specified by:
getConfiguredApplicationHomein interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
getBootstrapFailureReason
- Specified by:
getBootstrapFailureReasonin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
init
public void init() throws com.atlassian.config.bootstrap.BootstrapException- Specified by:
initin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager- Throws:
com.atlassian.config.bootstrap.BootstrapException
-
publishConfiguration
public void publishConfiguration()- Specified by:
publishConfigurationin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
bootstrapDatabase
public void bootstrapDatabase(com.atlassian.config.db.DatabaseDetails dbDetails, boolean embedded) throws com.atlassian.config.bootstrap.BootstrapException - Specified by:
bootstrapDatabasein interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager- Throws:
com.atlassian.config.bootstrap.BootstrapException
-
getHibernateConfigurator
public com.atlassian.config.db.HibernateConfigurator getHibernateConfigurator()- Specified by:
getHibernateConfiguratorin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
setHibernateConfigurator
public void setHibernateConfigurator(com.atlassian.config.db.HibernateConfigurator hibernateConfigurator) - Specified by:
setHibernateConfiguratorin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
getHibernateConfig
public com.atlassian.config.db.HibernateConfig getHibernateConfig()- Specified by:
getHibernateConfigin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
getTestDatasourceConnection
public Connection getTestDatasourceConnection(String datasourceName) throws com.atlassian.config.bootstrap.BootstrapException - Specified by:
getTestDatasourceConnectionin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager- Throws:
com.atlassian.config.bootstrap.BootstrapException
-
databaseContainsExistingData
- Specified by:
databaseContainsExistingDatain interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager
-
getTestDatabaseConnection
public Connection getTestDatabaseConnection(com.atlassian.config.db.DatabaseDetails databaseDetails) throws com.atlassian.config.bootstrap.BootstrapException - Specified by:
getTestDatabaseConnectionin interfacecom.atlassian.config.bootstrap.AtlassianBootstrapManager- Throws:
com.atlassian.config.bootstrap.BootstrapException
-
getH2VersionFromConfig
- Specified by:
getH2VersionFromConfigin interfaceBootstrapManager
-
resetH2Version
public boolean resetH2Version()- Specified by:
resetH2Versionin interfaceBootstrapManager
-
setH2Version
- Specified by:
setH2Versionin interfaceBootstrapManager
-
getLocalHomePath
Description copied from interface:BootstrapManagerLocal home directory;- Specified by:
getLocalHomePathin interfaceBootstrapManager
-
initializeBuildNumberIfRequired
public boolean initializeBuildNumberIfRequired() throws com.atlassian.config.ConfigurationException- Specified by:
initializeBuildNumberIfRequiredin interfaceBootstrapManager- Throws:
com.atlassian.config.ConfigurationException
-