Class TomcatContainer
java.lang.Object
com.atlassian.jira.plugins.ha.container.TomcatContainer
- All Implemented Interfaces:
Container
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
addXmlReplacement
(org.codehaus.cargo.util.XmlReplacement xmlReplacement) Replaces values in xml files of the containervoid
Clears all the log messages collected so far in the in-memoryWatchingLogger.LogWatcher
.void
Generate a thread dump of this process to the logs.org.codehaus.cargo.container.tomcat.Tomcat9xInstalledLocalContainer
Access the underlying cargo container.void
Remove the dbconfig.xml file if exists and copy a fresh one to homevoid
installJira
(JiraType warType) Installs a predefined JIRA WAR into this container.void
installWar
(Path warFile, String context) Installs a WAR file into this container.jiraNode()
void
start()
Start the instance.void
stop()
Cleanly stop the instance.void
Wait until container will dievoid
waitForLogMessage
(org.hamcrest.Matcher<String> message, Duration timeout) Waits for a log message that matches the pattern.void
waitForLogMessageFromNowOn
(org.hamcrest.Matcher<String> message, Duration timeout) Clears already accumulated log messages and waits for a log message that matches the pattern.
-
Method Details
-
start
public void start()Description copied from interface:Container
Start the instance. -
stop
public void stop()Description copied from interface:Container
Cleanly stop the instance. -
waitForContainerToDie
Description copied from interface:Container
Wait until container will die- Specified by:
waitForContainerToDie
in interfaceContainer
- Throws:
TimeoutException
- if container will not die
-
replication
-
jiraNode
-
getCargoContainer
public org.codehaus.cargo.container.tomcat.Tomcat9xInstalledLocalContainer getCargoContainer()Access the underlying cargo container. Can be useful for fine-grained customization.- Returns:
- cargo container hosting the JIRA instance.
-
installWar
Description copied from interface:Container
Installs a WAR file into this container.- Specified by:
installWar
in interfaceContainer
- Parameters:
warFile
- the WAR file to install.context
- the context path. Do not include any leading or trailing '/' characters.
-
installJira
Description copied from interface:Container
Installs a predefined JIRA WAR into this container.- Specified by:
installJira
in interfaceContainer
- Parameters:
warType
- the JIRA version to install.
-
getLocalHome
- Specified by:
getLocalHome
in interfaceContainer
- Returns:
- a path to the local home directory of JIRA
-
getClusterProperties
- Specified by:
getClusterProperties
in interfaceContainer
- Returns:
- The wrapped property file for this node (cluster.properties from jirahome).
-
waitForLogMessage
Description copied from interface:Container
Waits for a log message that matches the pattern. Mind that messages are accumulated from the start of container. If you want to wait from message from now on useContainer.waitForLogMessageFromNowOn(Matcher, Duration)
- Specified by:
waitForLogMessage
in interfaceContainer
-
clearLogMessages
public void clearLogMessages()Description copied from interface:Container
Clears all the log messages collected so far in the in-memoryWatchingLogger.LogWatcher
. Logs written out to a file remain intact.- Specified by:
clearLogMessages
in interfaceContainer
-
waitForLogMessageFromNowOn
Description copied from interface:Container
Clears already accumulated log messages and waits for a log message that matches the pattern.- Specified by:
waitForLogMessageFromNowOn
in interfaceContainer
-
getSystemProperties
- Specified by:
getSystemProperties
in interfaceContainer
- Returns:
- the system properties for the container. Can be modified.
-
generateThreadDump
public void generateThreadDump()Description copied from interface:Container
Generate a thread dump of this process to the logs.- Specified by:
generateThreadDump
in interfaceContainer
-
getProduct
- Specified by:
getProduct
in interfaceContainer
- Returns:
- The JiraTestedProduct for this node. Use this for accessing the page binder, web driver, environment data, etc.
-
addXmlReplacement
public void addXmlReplacement(org.codehaus.cargo.util.XmlReplacement xmlReplacement) Description copied from interface:Container
Replaces values in xml files of the container- Specified by:
addXmlReplacement
in interfaceContainer
- Parameters:
xmlReplacement
- containing replacement data
-
getFreshDbConfig
Description copied from interface:Container
Remove the dbconfig.xml file if exists and copy a fresh one to home- Specified by:
getFreshDbConfig
in interfaceContainer
- Throws:
IOException
-