Package org.xwiki.test.docker.junit5
Class TestConfiguration
- java.lang.Object
-
- org.xwiki.test.docker.junit5.TestConfiguration
-
public class TestConfiguration extends Object
Configuration options for the test.- Since:
- 10.9
- Version:
- $Id: 3d8fa3aea0298ce911dbed641b5cf2cddf1c0a90 $
-
-
Constructor Summary
Constructors Constructor Description TestConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Browser
getBrowser()
Database
getDatabase()
Properties
getDatabaseCommands()
String
getDatabaseTag()
List<org.xwiki.tool.extension.ExtensionOverride>
getExtensionOverrides()
Set<org.xwiki.test.integration.maven.ArtifactCoordinate>
getExtraJARs()
List<ServletEngine>
getForbiddenServletEngines()
String
getJDBCDriverVersion()
String
getName()
String
getOutputDirectory()
List<String>
getProfiles()
Properties
getProperties()
ServletEngine
getServletEngine()
String
getServletEngineTag()
List<Integer>
getSSHPorts()
boolean
isDatabaseDataSaved()
boolean
isDebug()
boolean
isOffice()
boolean
isOffline()
boolean
isPermanentDirectoryDataSaved()
boolean
isResolveExtraJARs()
boolean
isVerbose()
boolean
isWCAG()
void
merge(TestConfiguration testConfiguration)
void
setBrowser(Browser browser)
void
setDatabase(Database database)
void
setDatabaseCommands(Properties databaseCommands)
void
setDatabaseTag(String databaseTag)
void
setDebug(boolean debug)
void
setExtensionOverrides(List<org.xwiki.tool.extension.ExtensionOverride> extensionOverrides)
void
setExtraJARs(Set<org.xwiki.test.integration.maven.ArtifactCoordinate> extraJARs)
void
setForbiddenServletEngines(List<ServletEngine> forbiddenServletEngines)
void
setJDBCDriverVersion(String jdbcDriverVersion)
void
setOffice(boolean office)
void
setOffline(boolean offline)
void
setProfiles(List<String> profiles)
void
setProperties(Properties properties)
void
setResolveExtraJARs(boolean resolveExtraJARs)
void
setSaveDatabaseData(boolean saveDatabaseData)
void
setSavePermanentDirectoryData(boolean savePermanentDirectoryData)
void
setServletEngine(ServletEngine servletEngine)
void
setServletEngineTag(String servletEngineTag)
void
setSSHPorts(List<Integer> sshPorts)
void
setVerbose(boolean verbose)
void
setVNC(boolean vnc)
void
setWCAG(boolean wcag)
boolean
vnc()
-
-
-
Method Detail
-
merge
public void merge(TestConfiguration testConfiguration) throws DockerTestException
- Parameters:
testConfiguration
- the configuration to merge with the current one- Throws:
DockerTestException
- when a merge error occurs
-
getBrowser
public Browser getBrowser()
- Returns:
- the browser to use
-
setBrowser
public void setBrowser(Browser browser)
- Parameters:
browser
- seegetBrowser()
-
getDatabase
public Database getDatabase()
- Returns:
- the database to use
-
setDatabase
public void setDatabase(Database database)
- Parameters:
database
- seegetDatabase()
-
getServletEngine
public ServletEngine getServletEngine()
- Returns:
- the Servlet engine to use
-
setServletEngine
public void setServletEngine(ServletEngine servletEngine)
- Parameters:
servletEngine
- seegetServletEngine()
-
isVerbose
public boolean isVerbose()
- Returns:
- true if the test should output verbose console logs or not
-
setVerbose
public void setVerbose(boolean verbose)
- Parameters:
verbose
- seeisVerbose()
-
isDebug
public boolean isDebug()
- Returns:
- true if the test should output debug console logs or not
- Since:
- 10.11RC1
-
setDebug
public void setDebug(boolean debug)
- Parameters:
debug
- seeisDebug()
-
isOffline
public boolean isOffline()
- Returns:
- true if the Maven resolving is done in offline mode (i.e. you need to have the required artifacts in your local repository). False by default to avoid developer problems but should be set to true in the CI to improve performance of functional tests
- Since:
- 10.10RC1
-
setOffline
public void setOffline(boolean offline)
- Parameters:
offline
- seeisOffline()
-
getDatabaseTag
public String getDatabaseTag()
- Returns:
- the docker image tag to use (if not specified, uses the default from TestContainers)
- Since:
- 10.10RC1
-
setDatabaseTag
public void setDatabaseTag(String databaseTag)
- Parameters:
databaseTag
- seegetDatabaseTag()
-
getServletEngineTag
public String getServletEngineTag()
- Returns:
- the docker image tag to use (if not specified, uses the "latest" tag)
- Since:
- 10.10RC1
-
setServletEngineTag
public void setServletEngineTag(String servletEngineTag)
- Parameters:
servletEngineTag
- seegetServletEngineTag()
-
getJDBCDriverVersion
public String getJDBCDriverVersion()
- Returns:
- the version of the JDBC driver to use for the selected database (if not specified, uses a default version depending on the database)
- Since:
- 10.10RC1
-
setJDBCDriverVersion
public void setJDBCDriverVersion(String jdbcDriverVersion)
- Parameters:
jdbcDriverVersion
- seegetJDBCDriverVersion()
-
vnc
public boolean vnc()
- Returns:
- true if VNC container is started and recording is done and saved on test exit
- Since:
- 10.10RC1
-
setVNC
public void setVNC(boolean vnc)
- Parameters:
vnc
- seevnc()
-
isWCAG
public boolean isWCAG()
- Returns:
- true if WCAG rules should be checked.
- Since:
- 15.2RC1
-
setWCAG
public void setWCAG(boolean wcag)
- Parameters:
wcag
- seeisWCAG()
- Since:
- 15.2RC1
-
getProperties
public Properties getProperties()
- Returns:
- the list of configuration properties to use when generating the XWiki configuration files such as as
xwiki.properties
(checkxwiki.properties.vm
to find the list of supported properties) - Since:
- 10.10RC1
-
setProperties
public void setProperties(Properties properties)
- Parameters:
properties
- seegetProperties()
-
getDatabaseCommands
public Properties getDatabaseCommands()
- Returns:
- the list of database docker commands to use and that will override default commands (example of command
character-set-server=utf8mb4
- Since:
- 11.2RC1
-
setDatabaseCommands
public void setDatabaseCommands(Properties databaseCommands)
- Parameters:
databaseCommands
- seegetDatabaseCommands()
-
getExtraJARs
public Set<org.xwiki.test.integration.maven.ArtifactCoordinate> getExtraJARs()
- Returns:
- the list of extra JARs to add to the
WEB-INF/lib
directory - Since:
- 10.11RC1
-
setExtraJARs
public void setExtraJARs(Set<org.xwiki.test.integration.maven.ArtifactCoordinate> extraJARs)
- Parameters:
extraJARs
- seegetExtraJARs()
-
isResolveExtraJARs
public boolean isResolveExtraJARs()
- Returns:
- true if extra JARs version should be resolved when missing, see
UITest.resolveExtraJARs()
- Since:
- 12.5RC1
-
setResolveExtraJARs
public void setResolveExtraJARs(boolean resolveExtraJARs)
- Parameters:
resolveExtraJARs
- seeisResolveExtraJARs()
-
getExtensionOverrides
public List<org.xwiki.tool.extension.ExtensionOverride> getExtensionOverrides()
- Returns:
- the overrides of the extensions descriptors
- Since:
- 11.6RC1
-
setExtensionOverrides
public void setExtensionOverrides(List<org.xwiki.tool.extension.ExtensionOverride> extensionOverrides)
- Parameters:
extensionOverrides
- seegetExtensionOverrides()
-
getSSHPorts
public List<Integer> getSSHPorts()
- Returns:
- the list of ports that should be SSH-forwarded when connecting from a Docker container to the host (i.e.
when using the
host.testcontainers.internal
host name). This is in addition to port8080
which is always added. For example if you need XWiki to send a mail to a SMTP server running on port 3025 on the host, you should add port 3025 to the list. - Since:
- 10.11RC1
-
setSSHPorts
public void setSSHPorts(List<Integer> sshPorts)
- Parameters:
sshPorts
- seegetSSHPorts()
-
getProfiles
public List<String> getProfiles()
- Returns:
- the list of Maven profiles to activate when resolving dependencies for the current POM.
- Since:
- 10.11RC1
-
setProfiles
public void setProfiles(List<String> profiles)
- Parameters:
profiles
- seegetProfiles()
-
getName
public String getName()
- Returns:
- the String representation of the configuration (used for example as a directory name where to save the generated XWiki configuration - XWiki WAR file, etc)
- Since:
- 10.10RC1
-
getOutputDirectory
public String getOutputDirectory()
- Returns:
- the output directory where to output files required for running the tests. If the
maven.build.dir
system property is not defined then construct an output directory name based on the defined configuration so that we can run different configurations one after another without them overriding each other. Themaven.build.dir
system property is there to allow controlling where the Maven output directory is located when running from Maven.
-
isOffice
public boolean isOffice()
- Returns:
- true if an office container must be provided to run the tests.
- Since:
- 10.11RC1
-
setOffice
public void setOffice(boolean office)
- Parameters:
office
- seeisOffice()
-
getForbiddenServletEngines
public List<ServletEngine> getForbiddenServletEngines()
- Returns:
- the list of Servlet Engines on which this test must not be executed. If the Servlet Engine is selected then the test will be skipped
- Since:
- 10.11RC1
-
setForbiddenServletEngines
public void setForbiddenServletEngines(List<ServletEngine> forbiddenServletEngines)
- Parameters:
forbiddenServletEngines
- seegetForbiddenServletEngines()
-
isDatabaseDataSaved
public boolean isDatabaseDataSaved()
- Returns:
- true true if the database data should be mapped to a local directory on the host computer so that it can be saved and reused for another run
- Since:
- 10.10RC1
-
setSaveDatabaseData
public void setSaveDatabaseData(boolean saveDatabaseData)
- Parameters:
saveDatabaseData
- seeisDatabaseDataSaved()
-
isPermanentDirectoryDataSaved
public boolean isPermanentDirectoryDataSaved()
- Returns:
- true if the XWiki permanent directory should be mapped to a local directory on the host computer so that it can be accessed once the test is finished, for debugging purposes
- Since:
- 14.5
-
setSavePermanentDirectoryData
public void setSavePermanentDirectoryData(boolean savePermanentDirectoryData)
- Parameters:
savePermanentDirectoryData
- seeisPermanentDirectoryDataSaved()
- Since:
- 14.5
-
-