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 TypeMethodDescriptionvoidaddXmlReplacement(org.codehaus.cargo.util.XmlReplacement xmlReplacement) Replaces values in xml files of the containervoidClears all the log messages collected so far in the in-memoryWatchingLogger.LogWatcher.voidGenerate a thread dump of this process to the logs.org.codehaus.cargo.container.tomcat.Tomcat9xInstalledLocalContainerAccess the underlying cargo container.voidRemove the dbconfig.xml file if exists and copy a fresh one to homevoidinstallJira(JiraType warType) Installs a predefined JIRA WAR into this container.voidinstallWar(Path warFile, String context) Installs a WAR file into this container.jiraNode()voidstart()Start the instance.voidstop()Cleanly stop the instance.voidWait until container will dievoidwaitForLogMessage(org.hamcrest.Matcher<String> message, Duration timeout) Waits for a log message that matches the pattern.voidwaitForLogMessageFromNowOn(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:ContainerStart the instance. -
stop
public void stop()Description copied from interface:ContainerCleanly stop the instance. -
waitForContainerToDie
Description copied from interface:ContainerWait until container will die- Specified by:
waitForContainerToDiein 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:ContainerInstalls a WAR file into this container.- Specified by:
installWarin 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:ContainerInstalls a predefined JIRA WAR into this container.- Specified by:
installJirain interfaceContainer- Parameters:
warType- the JIRA version to install.
-
getLocalHome
- Specified by:
getLocalHomein interfaceContainer- Returns:
- a path to the local home directory of JIRA
-
getClusterProperties
- Specified by:
getClusterPropertiesin interfaceContainer- Returns:
- The wrapped property file for this node (cluster.properties from jirahome).
-
waitForLogMessage
Description copied from interface:ContainerWaits 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:
waitForLogMessagein interfaceContainer
-
clearLogMessages
public void clearLogMessages()Description copied from interface:ContainerClears all the log messages collected so far in the in-memoryWatchingLogger.LogWatcher. Logs written out to a file remain intact.- Specified by:
clearLogMessagesin interfaceContainer
-
waitForLogMessageFromNowOn
Description copied from interface:ContainerClears already accumulated log messages and waits for a log message that matches the pattern.- Specified by:
waitForLogMessageFromNowOnin interfaceContainer
-
getSystemProperties
- Specified by:
getSystemPropertiesin interfaceContainer- Returns:
- the system properties for the container. Can be modified.
-
generateThreadDump
public void generateThreadDump()Description copied from interface:ContainerGenerate a thread dump of this process to the logs.- Specified by:
generateThreadDumpin interfaceContainer
-
getProduct
- Specified by:
getProductin 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:ContainerReplaces values in xml files of the container- Specified by:
addXmlReplacementin interfaceContainer- Parameters:
xmlReplacement- containing replacement data
-
getFreshDbConfig
Description copied from interface:ContainerRemove the dbconfig.xml file if exists and copy a fresh one to home- Specified by:
getFreshDbConfigin interfaceContainer- Throws:
IOException
-