Package net.officefloor.test.system
Class AbstractExternalOverride<I extends AbstractExternalOverride<I>>
- java.lang.Object
-
- net.officefloor.test.system.AbstractExternalOverride<I>
-
- Direct Known Subclasses:
AbstractEnvironmentOverride
,AbstractSystemPropertiesOverride
public abstract class AbstractExternalOverride<I extends AbstractExternalOverride<I>> extends java.lang.Object
Abstract functionality for modifyingSystem
for tests.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AbstractExternalOverride.ContextRunnable<T extends java.lang.Throwable>
ContextRunnable
.protected class
AbstractExternalOverride.OverrideReset
Contains state for reseting the overrides.
-
Constructor Summary
Constructors Constructor Description AbstractExternalOverride(java.lang.String... nameValuePairs)
Instantiate.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
clear(java.lang.String name)
Clears the value.protected abstract java.lang.String
get(java.lang.String name)
Obtains the value.protected AbstractExternalOverride.OverrideReset
override()
Overrides the external values.I
property(java.lang.String name, java.lang.String value)
Allow builder pattern for loading properties.<T extends java.lang.Throwable>
voidrun(AbstractExternalOverride.ContextRunnable<T> runnable)
RunsAbstractExternalOverride.ContextRunnable
with configuredSystem
properties.protected abstract void
set(java.lang.String name, java.lang.String value)
Specifies the value.
-
-
-
Method Detail
-
property
public I property(java.lang.String name, java.lang.String value)
Allow builder pattern for loading properties.- Parameters:
name
- Name.value
- Value.- Returns:
this
.
-
run
public <T extends java.lang.Throwable> void run(AbstractExternalOverride.ContextRunnable<T> runnable) throws T extends java.lang.Throwable
RunsAbstractExternalOverride.ContextRunnable
with configuredSystem
properties.- Type Parameters:
T
- PossibleThrowable
from logic.- Parameters:
runnable
-AbstractExternalOverride.ContextRunnable
.- Throws:
T
- PossibleThrowable
.T extends java.lang.Throwable
-
override
protected AbstractExternalOverride.OverrideReset override()
Overrides the external values.- Returns:
AbstractExternalOverride.OverrideReset
to reset the overrides.
-
get
protected abstract java.lang.String get(java.lang.String name)
Obtains the value.- Parameters:
name
- Name of value.- Returns:
- Value.
-
set
protected abstract void set(java.lang.String name, java.lang.String value)
Specifies the value.- Parameters:
name
- Name for value.value
- Value.
-
clear
protected abstract void clear(java.lang.String name)
Clears the value.- Parameters:
name
- Name of value.
-
-