com.atlassian.bamboo.testutils.setup
Class TestBootstrapManager

java.lang.Object
  extended by com.atlassian.bamboo.testutils.setup.TestBootstrapManager
All Implemented Interfaces:
BootstrapManager, com.atlassian.config.bootstrap.AtlassianBootstrapManager

@ThreadSafe
public class TestBootstrapManager
extends Object
implements BootstrapManager


Field Summary
 
Fields inherited from interface com.atlassian.bamboo.setup.BootstrapManager
INSTANCE_FINGERPRINT_PARAM, SERVER_FINGERPRINT_PARAM
 
Constructor Summary
TestBootstrapManager()
           
 
Method Summary
 void bootstrapDatabase(com.atlassian.config.db.DatabaseDetails dbDetails, boolean embedded)
           
 void bootstrapDatasource(String datasourceName, String hibernateDialect)
           
 boolean databaseContainsExistingData(Connection connection)
           
 com.atlassian.config.ApplicationConfiguration getApplicationConfig()
           
 String getApplicationHome()
           
 String getArtifactsDirectory()
          This method returns the root directory underneath which the artifacts are stored.
 String getBootstrapFailureReason()
           
 URI getBrokerClientURI()
           
 URI getBrokerURI()
           
 String getBuildDirectory()
          Gets the directory where Bamboo's build files sit.
 String getBuildNumber()
           
 String getBuildWorkingDirectory()
          This method returns the root directory underneath which the build directories are located.
 String getConfigDirectory()
          Gets the directory where Bamboo's administration.xml file sits
 String getConfiguredApplicationHome()
           
 String getFilePathProperty(String key)
           
 ServerFingerprint getFingerprint()
          Provides a unique identifier for this startup
 com.atlassian.config.db.HibernateConfig getHibernateConfig()
           
 com.atlassian.config.db.HibernateConfigurator getHibernateConfigurator()
           
 Properties getHibernateProperties()
           
 File getIndexDirectory()
          Returns the index directory as stored in the cfg.xml file with the bambooHome preopty replaced
 String getOperation()
           
 Map getPropertiesWithPrefix(String prefix)
           
 Object getProperty(String key)
           
 Collection getPropertyKeys()
           
 String getServerID()
           
 com.atlassian.config.setup.SetupPersister getSetupPersister()
           
 String getString(String key)
           
 Connection getTestDatabaseConnection(com.atlassian.config.db.DatabaseDetails databaseDetails)
           
 Connection getTestDatasourceConnection(String datasourceName)
           
 void init()
           
 boolean isApplicationHomeValid()
           
 boolean isBootstrapped()
           
 boolean isPropertyTrue(String prop)
           
 boolean isSetupComplete()
           
 void publishConfiguration()
           
 void removeProperty(String key)
           
 void save()
           
 void setApplicationConfig(com.atlassian.config.ApplicationConfiguration applicationConfig)
           
 void setApplicationHome(String applicationHome)
          Make sure you use either this method or setApplicationConfig(ApplicationConfiguration) not both
 void setArtifactsDirectory(String artifactsDir)
           
 void setBrokerClientURI(URI brokerURI)
           
 void setBrokerURI(URI brokerUrl)
           
 void setBuildDirectory(String buildDirectory)
           
 void setBuildNumber(String buildNumber)
           
 void setBuildWorkingDirectory(String buildWorkingDirectory)
           
 void setConfigDirectory(String configurationDirectory)
           
 void setHibernateConfigurator(com.atlassian.config.db.HibernateConfigurator hibernateConfigurator)
           
 void setOperation(String operation)
           
 void setProperty(String key, Object value)
           
 void setServerID(String serverId)
           
 void setSetupComplete(boolean complete)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestBootstrapManager

public TestBootstrapManager()
Method Detail

getConfigDirectory

public String getConfigDirectory()
Description copied from interface: BootstrapManager
Gets the directory where Bamboo's administration.xml file sits

Specified by:
getConfigDirectory in interface BootstrapManager
Returns:
String representing the path to the folder. Null if not configured

setConfigDirectory

public void setConfigDirectory(String configurationDirectory)
Specified by:
setConfigDirectory in interface BootstrapManager

getBuildDirectory

public String getBuildDirectory()
Description copied from interface: BootstrapManager
Gets the directory where Bamboo's build files sit. This includes artifacts and the like

Specified by:
getBuildDirectory in interface BootstrapManager
Returns:
String representing the path to the folder. Null if not configured

setBuildDirectory

public void setBuildDirectory(String buildDirectory)
Specified by:
setBuildDirectory in interface BootstrapManager

getBuildWorkingDirectory

public String getBuildWorkingDirectory()
Description copied from interface: BootstrapManager
This 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:
getBuildWorkingDirectory in interface BootstrapManager

setBuildWorkingDirectory

public void setBuildWorkingDirectory(String buildWorkingDirectory)
Specified by:
setBuildWorkingDirectory in interface BootstrapManager

getArtifactsDirectory

public String getArtifactsDirectory()
Description copied from interface: BootstrapManager
This 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 SystemDirectory methods instead.

Specified by:
getArtifactsDirectory in interface BootstrapManager

setArtifactsDirectory

public void setArtifactsDirectory(String artifactsDir)
Specified by:
setArtifactsDirectory in interface BootstrapManager

getIndexDirectory

@Nullable
public File getIndexDirectory()
Description copied from interface: BootstrapManager
Returns the index directory as stored in the cfg.xml file with the bambooHome preopty replaced

Specified by:
getIndexDirectory in interface BootstrapManager

getServerID

public String getServerID()
Specified by:
getServerID in interface BootstrapManager

setServerID

public void setServerID(String serverId)
Specified by:
setServerID in interface BootstrapManager

getBrokerURI

public URI getBrokerURI()
                 throws URISyntaxException
Specified by:
getBrokerURI in interface BootstrapManager
Throws:
URISyntaxException

setBrokerURI

public void setBrokerURI(URI brokerUrl)
Specified by:
setBrokerURI in interface BootstrapManager

getBrokerClientURI

public URI getBrokerClientURI()
                       throws URISyntaxException
Specified by:
getBrokerClientURI in interface BootstrapManager
Throws:
URISyntaxException

setBrokerClientURI

public void setBrokerClientURI(URI brokerURI)
Specified by:
setBrokerClientURI in interface BootstrapManager

getFingerprint

@NotNull
public ServerFingerprint getFingerprint()
Description copied from interface: BootstrapManager
Provides a unique identifier for this startup

Specified by:
getFingerprint in interface BootstrapManager
Returns:

isBootstrapped

public boolean isBootstrapped()
Specified by:
isBootstrapped in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

getProperty

public Object getProperty(String key)
Specified by:
getProperty in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

setProperty

public void setProperty(String key,
                        Object value)
Specified by:
setProperty in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

isPropertyTrue

public boolean isPropertyTrue(String prop)
Specified by:
isPropertyTrue in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

removeProperty

public void removeProperty(String key)
Specified by:
removeProperty in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

getString

public String getString(String key)
Specified by:
getString in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

getFilePathProperty

public String getFilePathProperty(String key)
Specified by:
getFilePathProperty in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

getPropertyKeys

public Collection getPropertyKeys()
Specified by:
getPropertyKeys in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

getPropertiesWithPrefix

public Map getPropertiesWithPrefix(String prefix)
Specified by:
getPropertiesWithPrefix in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

getBuildNumber

public String getBuildNumber()
Specified by:
getBuildNumber in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

setBuildNumber

public void setBuildNumber(String buildNumber)
Specified by:
setBuildNumber in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

isApplicationHomeValid

public boolean isApplicationHomeValid()
Specified by:
isApplicationHomeValid in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

getHibernateProperties

public Properties getHibernateProperties()
Specified by:
getHibernateProperties in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

save

public void save()
          throws com.atlassian.config.ConfigurationException
Specified by:
save in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
Throws:
com.atlassian.config.ConfigurationException

isSetupComplete

public boolean isSetupComplete()
Specified by:
isSetupComplete in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

getOperation

public String getOperation()
Specified by:
getOperation in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

setOperation

public void setOperation(String operation)
Specified by:
setOperation in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

setSetupComplete

public void setSetupComplete(boolean complete)
Specified by:
setSetupComplete in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

bootstrapDatasource

public void bootstrapDatasource(String datasourceName,
                                String hibernateDialect)
                         throws com.atlassian.config.bootstrap.BootstrapException
Specified by:
bootstrapDatasource in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
Throws:
com.atlassian.config.bootstrap.BootstrapException

getSetupPersister

public com.atlassian.config.setup.SetupPersister getSetupPersister()
Specified by:
getSetupPersister in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

getApplicationConfig

public com.atlassian.config.ApplicationConfiguration getApplicationConfig()
Specified by:
getApplicationConfig in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

setApplicationConfig

public void setApplicationConfig(com.atlassian.config.ApplicationConfiguration applicationConfig)

getApplicationHome

public String getApplicationHome()
Specified by:
getApplicationHome in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

setApplicationHome

public void setApplicationHome(String applicationHome)
                        throws com.atlassian.config.ConfigurationException
Make sure you use either this method or setApplicationConfig(ApplicationConfiguration) not both

Throws:
com.atlassian.config.ConfigurationException

getConfiguredApplicationHome

public String getConfiguredApplicationHome()
Specified by:
getConfiguredApplicationHome in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

getBootstrapFailureReason

public String getBootstrapFailureReason()
Specified by:
getBootstrapFailureReason in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

init

public void init()
          throws com.atlassian.config.bootstrap.BootstrapException
Specified by:
init in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
Throws:
com.atlassian.config.bootstrap.BootstrapException

publishConfiguration

public void publishConfiguration()
Specified by:
publishConfiguration in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

bootstrapDatabase

public void bootstrapDatabase(com.atlassian.config.db.DatabaseDetails dbDetails,
                              boolean embedded)
                       throws com.atlassian.config.bootstrap.BootstrapException
Specified by:
bootstrapDatabase in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
Throws:
com.atlassian.config.bootstrap.BootstrapException

getHibernateConfigurator

public com.atlassian.config.db.HibernateConfigurator getHibernateConfigurator()
Specified by:
getHibernateConfigurator in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

setHibernateConfigurator

public void setHibernateConfigurator(com.atlassian.config.db.HibernateConfigurator hibernateConfigurator)
Specified by:
setHibernateConfigurator in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

getHibernateConfig

public com.atlassian.config.db.HibernateConfig getHibernateConfig()
Specified by:
getHibernateConfig in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

getTestDatasourceConnection

public Connection getTestDatasourceConnection(String datasourceName)
                                       throws com.atlassian.config.bootstrap.BootstrapException
Specified by:
getTestDatasourceConnection in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
Throws:
com.atlassian.config.bootstrap.BootstrapException

databaseContainsExistingData

public boolean databaseContainsExistingData(Connection connection)
Specified by:
databaseContainsExistingData in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager

getTestDatabaseConnection

public Connection getTestDatabaseConnection(com.atlassian.config.db.DatabaseDetails databaseDetails)
                                     throws com.atlassian.config.bootstrap.BootstrapException
Specified by:
getTestDatabaseConnection in interface com.atlassian.config.bootstrap.AtlassianBootstrapManager
Throws:
com.atlassian.config.bootstrap.BootstrapException


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.