Interface ConfigurationParameters
-
@API(status=STABLE, since="1.0") public interface ConfigurationParameters
Configuration parameters thatTestEngines
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.
- Since:
- 1.0
- See Also:
TestEngine
,EngineDiscoveryRequest
,ExecutionRequest
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIG_FILE_NAME
Name of the JUnit Platform configuration file: "junit-platform.properties".
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<String>
get(String key)
Get the configuration parameter stored under the specifiedkey
.Optional<Boolean>
getBoolean(String key)
Get the boolean configuration parameter stored under the specifiedkey
.int
size()
Get the number of configuration parameters stored directly in thisConfigurationParameters
.
-
-
-
Field Detail
-
CONFIG_FILE_NAME
static final String CONFIG_FILE_NAME
Name of the JUnit Platform configuration file: "junit-platform.properties".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.
- See Also:
Properties
, Constant Field Values
-
-
Method Detail
-
get
Optional<String> get(String key)
Get the configuration parameter stored under the specifiedkey
.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.- Parameters:
key
- the key to look up; nevernull
or blank- Returns:
- an
Optional
containing the value; nevernull
but potentially empty - See Also:
getBoolean(String)
,System.getProperty(String)
,CONFIG_FILE_NAME
-
getBoolean
Optional<Boolean> getBoolean(String key)
Get the boolean configuration parameter stored under the specifiedkey
.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.- Parameters:
key
- the key to look up; nevernull
or blank- Returns:
- an
Optional
containing the value; nevernull
but potentially empty - See Also:
get(String)
,Boolean.parseBoolean(String)
,System.getProperty(String)
,CONFIG_FILE_NAME
-
size
int size()
Get the number of configuration parameters stored directly in thisConfigurationParameters
.
-
-