Class AbstractEmbeddedTomcat<CONFIGURATION extends com.github.mjeanroy.junit.servers.tomcat.AbstractEmbeddedTomcatConfiguration>

java.lang.Object
com.github.mjeanroy.junit.servers.servers.AbstractEmbeddedServer<org.apache.catalina.startup.Tomcat,CONFIGURATION>
com.github.mjeanroy.junit.servers.tomcat.AbstractEmbeddedTomcat<CONFIGURATION>
Type Parameters:
CONFIGURATION - The tomcat configuration implementation.
All Implemented Interfaces:
EmbeddedServer<CONFIGURATION>

public abstract class AbstractEmbeddedTomcat<CONFIGURATION extends com.github.mjeanroy.junit.servers.tomcat.AbstractEmbeddedTomcatConfiguration> extends AbstractEmbeddedServer<org.apache.catalina.startup.Tomcat,CONFIGURATION>
Embedded server using tomcat as implementation.
  • Constructor Details

    • AbstractEmbeddedTomcat

      protected AbstractEmbeddedTomcat(CONFIGURATION configuration)
      Build embedded tomcat.
      Parameters:
      configuration - Tomcat configuration.
  • Method Details

    • getDelegate

      public org.apache.catalina.startup.Tomcat getDelegate()
      Description copied from class: AbstractEmbeddedServer
      Get internal server implementation. Note that this method should not be used to start or stop internal server, use dedicated method instead. This method can be used to do some custom configuration on original implementation.
      Specified by:
      getDelegate in class AbstractEmbeddedServer<org.apache.catalina.startup.Tomcat,CONFIGURATION extends com.github.mjeanroy.junit.servers.tomcat.AbstractEmbeddedTomcatConfiguration>
      Returns:
      Original server implementation.
    • doStart

      protected void doStart()
      Description copied from class: AbstractEmbeddedServer
      Start embedded server. Must block until server is fully started.
      Specified by:
      doStart in class AbstractEmbeddedServer<org.apache.catalina.startup.Tomcat,CONFIGURATION extends com.github.mjeanroy.junit.servers.tomcat.AbstractEmbeddedTomcatConfiguration>
    • doStop

      protected void doStop()
      Description copied from class: AbstractEmbeddedServer
      Stop embedded server. Must block until server is fully stopped.
      Specified by:
      doStop in class AbstractEmbeddedServer<org.apache.catalina.startup.Tomcat,CONFIGURATION extends com.github.mjeanroy.junit.servers.tomcat.AbstractEmbeddedTomcatConfiguration>
    • getScheme

      public String getScheme()
      Description copied from interface: EmbeddedServer
      Get the protocol scheme ("http", "https").
      Specified by:
      getScheme in interface EmbeddedServer<CONFIGURATION extends com.github.mjeanroy.junit.servers.tomcat.AbstractEmbeddedTomcatConfiguration>
      Overrides:
      getScheme in class AbstractEmbeddedServer<org.apache.catalina.startup.Tomcat,CONFIGURATION extends com.github.mjeanroy.junit.servers.tomcat.AbstractEmbeddedTomcatConfiguration>
      Returns:
      Protocol scheme.
    • doGetPort

      protected int doGetPort()
      Description copied from class: AbstractEmbeddedServer
      Get port once server is started.
      Specified by:
      doGetPort in class AbstractEmbeddedServer<org.apache.catalina.startup.Tomcat,CONFIGURATION extends com.github.mjeanroy.junit.servers.tomcat.AbstractEmbeddedTomcatConfiguration>
      Returns:
      The port.
    • getContext

      protected org.apache.catalina.Context getContext()
      Get tomcat context.
      Returns:
      Tomcat context.