Annotation Interface EmbeddedTomcatConfiguration
- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
-
TomcatContext
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe Tomcat features -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe resource location of an alternative deployment descriptor for the web application.The resource location of the Tomcat'sbase directory.Class<?>[]The component classes to use for loading anApplicationContext.The context path of TomcatThe resource location of the Tomcat'sthe root directory of context document.Enable the Tomcat featuresbooleanWhether context initializers from test superclasses and enclosing classes should be inherited.booleanWhether resource locations or component classes from test superclasses and enclosing classes should be inherited.Class<? extends org.springframework.context.ApplicationContextInitializer<?>>[]The application context initializer classes to use for initializing aConfigurableApplicationContext.String[]The resource locations to use for loading anApplicationContext.intThe port of Tomcat
-
Element Details
-
port
int portThe port of Tomcat- Returns:
- the default value of port : 8080
- Default:
- 8080
-
contextPath
String contextPathThe context path of Tomcat- Returns:
- the default value of context path : ""
- See Also:
-
Context.setPath(String)
- Default:
- ""
-
basedir
String basedirThe resource location of the Tomcat'sbase directory.The value supports two types of locations:
- File System, e.g: /tmp/catalina
- Spring Resource location, e.g: classpath:/catalina, file:/temp/catalina
- Returns:
- the default value of basedir : The "java.io.tmpdir" system property (the directory where Java temporary
directory) where a directory named tomcat.$PORT will be created. $PORT is the value configured via
Tomcat.setPort(int)which defaults to 8080 if not set - See Also:
-
Tomcat.setBaseDir(String)
- Default:
- "${java.io.tmpdir}"
-
docBase
@AliasFor(annotation=org.springframework.test.context.web.WebAppConfiguration.class, attribute="value") String docBaseThe resource location of the Tomcat'sthe root directory of context document.The value supports two types of locations:
- File System, e.g: /tmp/webapp
- Spring Resource location, e.g: classpath:/WEB-INF/webapp, file:/temp/webapp
Alias for
WebAppConfiguration.value().Note :
docBase()could be ignored ifalternativeWebXml()is specified.- Returns:
- the default value : "classpath:/webapp"
- See Also:
-
Context.setDocBase(String)
- Default:
- "classpath:/webapp"
-
alternativeWebXml
String alternativeWebXmlThe resource location of an alternative deployment descriptor for the web application.The value supports two types of locations:
- File System, e.g: /tmp/web.xml
- Spring Resource location, e.g: classpath:/WEB-INF/web.xml, file:/temp/web.xml
Note : Whether the location is based on File System or Spring Resource, Tomcat only uses the deployment descriptor whose underlying layer resource must be the file, please reference to
the Tomcat's source code.If
alternativeWebXml()is specified,docBase()will be ignored, and the context's document base will be the parent directory of the alternative deployment descriptor.- Returns:
- the default value is "", which means no alternative deployment descriptor required.
- See Also:
-
Context.setAltDDName(String)
- Default:
- ""
-
features
EmbeddedTomcatConfiguration.Feature[] featuresEnable the Tomcat features- Returns:
- the empty array as default
- Default:
- {}
-
classes
@AliasFor(annotation=org.springframework.test.context.ContextConfiguration.class) Class<?>[] classesThe component classes to use for loading anApplicationContext.Alias for
ContextConfiguration.classes().- Default:
- {}
-
locations
@AliasFor(annotation=org.springframework.test.context.ContextConfiguration.class) String[] locationsThe resource locations to use for loading anApplicationContext.Alias for
ContextConfiguration.locations().- Default:
- {}
-
initializers
@AliasFor(annotation=org.springframework.test.context.ContextConfiguration.class) Class<? extends org.springframework.context.ApplicationContextInitializer<?>>[] initializersThe application context initializer classes to use for initializing aConfigurableApplicationContext.Alias for
ContextConfiguration.initializers().- Default:
- {}
-
inheritLocations
@AliasFor(annotation=org.springframework.test.context.ContextConfiguration.class) boolean inheritLocationsWhether resource locations or component classes from test superclasses and enclosing classes should be inherited.Alias for
ContextConfiguration.inheritLocations().- Default:
- true
-
inheritInitializers
@AliasFor(annotation=org.springframework.test.context.ContextConfiguration.class) boolean inheritInitializersWhether context initializers from test superclasses and enclosing classes should be inherited.Alias for
ContextConfiguration.inheritInitializers().- Default:
- true
-