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>
- 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.
-
Field Summary
Fields inherited from class com.github.mjeanroy.junit.servers.servers.AbstractEmbeddedServer
configuration
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractEmbeddedTomcat
(CONFIGURATION configuration) Build embedded tomcat. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
Get port once server is started.protected void
doStart()
Start embedded server.protected void
doStop()
Stop embedded server.protected org.apache.catalina.Context
org.apache.catalina.startup.Tomcat
Get internal server implementation.Get the protocol scheme ("http"
,"https"
).Methods inherited from class com.github.mjeanroy.junit.servers.servers.AbstractEmbeddedServer
getConfiguration, getHost, getPath, getPort, getUrl, isStarted, restart, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.github.mjeanroy.junit.servers.servers.EmbeddedServer
getServletContext
-
Constructor Details
-
AbstractEmbeddedTomcat
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 classAbstractEmbeddedServer<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 classAbstractEmbeddedServer<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 classAbstractEmbeddedServer<org.apache.catalina.startup.Tomcat,
CONFIGURATION extends com.github.mjeanroy.junit.servers.tomcat.AbstractEmbeddedTomcatConfiguration>
-
getScheme
Description copied from interface:EmbeddedServer
Get the protocol scheme ("http"
,"https"
).- Specified by:
getScheme
in interfaceEmbeddedServer<CONFIGURATION extends com.github.mjeanroy.junit.servers.tomcat.AbstractEmbeddedTomcatConfiguration>
- Overrides:
getScheme
in classAbstractEmbeddedServer<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 classAbstractEmbeddedServer<org.apache.catalina.startup.Tomcat,
CONFIGURATION extends com.github.mjeanroy.junit.servers.tomcat.AbstractEmbeddedTomcatConfiguration> - Returns:
- The port.
-
getContext
protected org.apache.catalina.Context getContext()
-