Interface Container
- All Known Implementing Classes:
TomcatContainer
public interface Container
A single webapp container that can hold a running instance of JIRA.
-
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.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
void start()Start the instance. -
stop
void stop()Cleanly stop the instance. -
jiraNode
JiraCluster.Node jiraNode()- Returns:
- the JIRA cluster node the instance is running. Use this for accessing REST endpoints, etc.
-
installWar
Installs a WAR file into this container.- Parameters:
warFile- the WAR file to install.context- the context path. Do not include any leading or trailing '/' characters.
-
installJira
Installs a predefined JIRA WAR into this container.- Parameters:
warType- the JIRA version to install.
-
getProduct
JiraTestedProduct getProduct()- Returns:
- The JiraTestedProduct for this node. Use this for accessing the page binder, web driver, environment data, etc.
-
getLocalHome
Path getLocalHome()- Returns:
- a path to the local home directory of JIRA
-
getClusterProperties
ClusterNodeProperties getClusterProperties()- Returns:
- The wrapped property file for this node (cluster.properties from jirahome).
-
waitForLogMessage
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 usewaitForLogMessageFromNowOn(Matcher, Duration) -
clearLogMessages
void clearLogMessages()Clears all the log messages collected so far in the in-memoryWatchingLogger.LogWatcher. Logs written out to a file remain intact. -
waitForLogMessageFromNowOn
Clears already accumulated log messages and waits for a log message that matches the pattern. -
getSystemProperties
- Returns:
- the system properties for the container. Can be modified.
- Since:
- 7.3.5
-
generateThreadDump
void generateThreadDump()Generate a thread dump of this process to the logs.- Since:
- 7.3.5
-
waitForContainerToDie
Wait until container will die- Throws:
TimeoutException- if container will not die- Since:
- 8.11
-
addXmlReplacement
void addXmlReplacement(org.codehaus.cargo.util.XmlReplacement xmlReplacement) Replaces values in xml files of the container- Parameters:
xmlReplacement- containing replacement data- Since:
- 8.21
-
getFreshDbConfig
Remove the dbconfig.xml file if exists and copy a fresh one to home- Throws:
IOException- Since:
- 10.2
-