Class TomcatContainer

java.lang.Object
com.atlassian.jira.plugins.ha.container.TomcatContainer
All Implemented Interfaces:
Container

public class TomcatContainer extends Object implements Container
  • Method Details

    • start

      public void start()
      Description copied from interface: Container
      Start the instance.
      Specified by:
      start in interface Container
    • stop

      public void stop()
      Description copied from interface: Container
      Cleanly stop the instance.
      Specified by:
      stop in interface Container
    • waitForContainerToDie

      public void waitForContainerToDie() throws TimeoutException
      Description copied from interface: Container
      Wait until container will die
      Specified by:
      waitForContainerToDie in interface Container
      Throws:
      TimeoutException - if container will not die
    • replication

      public ReplicationControl replication()
    • jiraNode

      public JiraCluster.Node jiraNode()
      Specified by:
      jiraNode in interface Container
      Returns:
      the JIRA cluster node the instance is running. Use this for accessing REST endpoints, etc.
    • 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

      public void installWar(Path warFile, String context)
      Description copied from interface: Container
      Installs a WAR file into this container.
      Specified by:
      installWar in interface Container
      Parameters:
      warFile - the WAR file to install.
      context - the context path. Do not include any leading or trailing '/' characters.
    • installJira

      public void installJira(JiraType warType)
      Description copied from interface: Container
      Installs a predefined JIRA WAR into this container.
      Specified by:
      installJira in interface Container
      Parameters:
      warType - the JIRA version to install.
    • getLocalHome

      public Path getLocalHome()
      Specified by:
      getLocalHome in interface Container
      Returns:
      a path to the local home directory of JIRA
    • getClusterProperties

      public ClusterNodeProperties getClusterProperties()
      Specified by:
      getClusterProperties in interface Container
      Returns:
      The wrapped property file for this node (cluster.properties from jirahome).
    • waitForLogMessage

      public void waitForLogMessage(org.hamcrest.Matcher<String> message, Duration timeout)
      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 use Container.waitForLogMessageFromNowOn(Matcher, Duration)
      Specified by:
      waitForLogMessage in interface Container
    • clearLogMessages

      public void clearLogMessages()
      Description copied from interface: Container
      Clears all the log messages collected so far in the in-memory WatchingLogger.LogWatcher. Logs written out to a file remain intact.
      Specified by:
      clearLogMessages in interface Container
    • waitForLogMessageFromNowOn

      public void waitForLogMessageFromNowOn(org.hamcrest.Matcher<String> message, Duration timeout)
      Description copied from interface: Container
      Clears already accumulated log messages and waits for a log message that matches the pattern.
      Specified by:
      waitForLogMessageFromNowOn in interface Container
    • getSystemProperties

      public Map<String,String> getSystemProperties()
      Specified by:
      getSystemProperties in interface Container
      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 interface Container
    • getProduct

      public JiraTestedProduct getProduct()
      Specified by:
      getProduct in interface Container
      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 interface Container
      Parameters:
      xmlReplacement - containing replacement data
    • getFreshDbConfig

      public void getFreshDbConfig() throws IOException
      Description copied from interface: Container
      Remove the dbconfig.xml file if exists and copy a fresh one to home
      Specified by:
      getFreshDbConfig in interface Container
      Throws:
      IOException