Skip to main content
Version: 5.1.0 (Unmaintained)

Configuration

The Configuration interface provides typed access to Paramixel configuration properties. Configuration is resolved in layers: classpath properties, JVM system properties, and framework defaults.

import org.paramixel.api.Configuration;

Factory methods​

MethodDescription
Configuration.defaultConfiguration()Classpath + system properties + defaults
Configuration.defaultConfiguration(ClassLoader)Same, with a preferred classloader
Configuration.classpathConfiguration()Classpath properties only
Configuration.classpathConfiguration(ClassLoader)Classpath properties with a preferred classloader
Configuration.systemConfiguration()JVM system properties + defaults
Configuration.of(Map<String, String>)From a supplied map; defensively copied

Typed getters​

All typed getters return Optional. Absent keys produce empty optionals. Invalid values throw ConfigurationException.

MethodReturnDescription
getString(String key)Optional<String>The raw string value
getBoolean(String key)Optional<Boolean>Parsed as a Paramixel boolean (only trimmed case-insensitive "true" is true)
getInteger(String key)Optional<Integer>Parsed as an integer
getLong(String key)Optional<Long>Parsed as a long
getFloat(String key)Optional<Float>Parsed as a float
getDouble(String key)Optional<Double>Parsed as a double
get(String key, Function<String, T> transformer)Optional<T>Transformed by a custom function

Other methods​

MethodDescription
keySet()All configuration keys present in this configuration
parseBoolean(String value)Static; only trimmed case-insensitive "true" returns true

Configuration keys​

ConstantKeyTypeDefault
RUNNER_PARALLELISMparamixel.parallelismintAvailable processors
SCHEDULER_QUEUE_CAPACITYparamixel.scheduler.queue.capacityint1024
ANSIparamixel.ansistring"auto"
FAILURE_ON_SKIPparamixel.failureOnSkipbooleanfalse
FAILURE_ON_ABORTparamixel.failureOnAbortbooleantrue
FAIL_IF_NO_TESTSparamixel.failIfNoTestsbooleanfalse
LISTENER_EXCLUDEparamixel.listener.excludestring (comma-separated tokens)(none)
REPORT_FILEparamixel.report.filestring(none)
MATCH_PACKAGE_REGEXparamixel.match.package.regexregex(none)
MATCH_CLASS_REGEXparamixel.match.class.regexregex(none)
MATCH_TAG_REGEXparamixel.match.tag.regexregex(none)
CONFIGURATION_FILE_NAME(constant)string"paramixel.properties"

The classpath resource name searched for Paramixel configuration. When this resource is absent, classpath properties are empty.

Programmatic configuration​

Configuration config = Configuration.of(Map.of(
Configuration.RUNNER_PARALLELISM, "4",
Configuration.REPORT_FILE, "target/reports/run.json"));

Runner runner = Runner.builder()
.configuration(config)
.build();

See Properties and System Properties for full configuration details.