@API(status=STABLE, since="1.0") public interface ConfigurationParameters
TestEngines
may use to
influence test discovery and execution.
For example, the JUnit Jupiter engine uses a configuration parameter to enable IDEs and build tools to deactivate conditional test execution.
TestEngine
,
EngineDiscoveryRequest
,
ExecutionRequest
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
CONFIG_FILE_NAME |
Name of the JUnit Platform configuration file: "junit-platform.properties".
|
Modifier and Type | Method | Description |
---|---|---|
java.util.Optional<java.lang.String> |
get(java.lang.String key) |
Get the configuration parameter stored under the specified
key . |
java.util.Optional<java.lang.Boolean> |
getBoolean(java.lang.String key) |
Get the boolean configuration parameter stored under the specified
key . |
int |
size() |
Get the number of configuration parameters stored directly in this
ConfigurationParameters . |
static final java.lang.String CONFIG_FILE_NAME
If a properties file with this name is present in the root of the classpath, it will be used as a source for configuration parameters. If multiple files are present, only the first one detected in the classpath will be used.
Properties
,
Constant Field Valuesjava.util.Optional<java.lang.String> get(java.lang.String key)
key
.
If no such key is present in this ConfigurationParameters
,
an attempt will be made to look up the value as a JVM system property.
If no such system property exists, an attempt will be made to look up
the value in the JUnit Platform properties
file.
key
- the key to look up; never null
or blankOptional
containing the value; never null
but potentially emptygetBoolean(String)
,
System.getProperty(String)
,
CONFIG_FILE_NAME
java.util.Optional<java.lang.Boolean> getBoolean(java.lang.String key)
key
.
If no such key is present in this ConfigurationParameters
,
an attempt will be made to look up the value as a JVM system property.
If no such system property exists, an attempt will be made to look up
the value in the JUnit Platform properties
file.
key
- the key to look up; never null
or blankOptional
containing the value; never null
but potentially emptyget(String)
,
Boolean.parseBoolean(String)
,
System.getProperty(String)
,
CONFIG_FILE_NAME
int size()
ConfigurationParameters
.