Class DefaultExtensionExecutor
- java.lang.Object
-
- de.rwth.swc.coffee4j.engine.process.extension.DefaultExtensionExecutor
-
- All Implemented Interfaces:
ExtensionExecutor
public class DefaultExtensionExecutor extends Object implements ExtensionExecutor
The defaultExtensionExecutor
, that manages the execution of all known Extensions.Ensures wrapping behavior for extensions. I.e., assume callback A and callback B both implement the callback before and after an entity. If callback A gets registered before callback B, wrapping behavior would ensure, that its behavior before the entity is always executed before the corresponding behavior of callback B and its behavior after the entity is always executed after the corresponding behavior of callback B.
-
-
Constructor Summary
Constructors Constructor Description DefaultExtensionExecutor(Collection<? extends Extension> extensions)
Creates a new executor with the given extensions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<Combination,TestResult>
executeAfterExecution(Map<Combination,TestResult> executionResultMap)
Executes the callback after the execution phasevoid
executeAfterFaultCharacterization(List<Combination> combinations)
Executes the callback after the fault characterization phaseList<Combination>
executeAfterGeneration(List<Combination> combinations)
Executes the callback after the generation phasevoid
executeBeforeExecution(List<Combination> combinations)
Executes the callback before the execution phasevoid
executeBeforeFaultCharacterization(Map<Combination,TestResult> combinationTestResultMap)
Executes the callback before the fault characterization phasevoid
executeBeforeGeneration()
Executes the callback before the initial generationInputParameterModel
executeModelModifiers(InputParameterModel original, ExecutionReporter reporter)
Executes all registeredModelModifier
exactly in the order they were registered in.
-
-
-
Constructor Detail
-
DefaultExtensionExecutor
public DefaultExtensionExecutor(Collection<? extends Extension> extensions)
Creates a new executor with the given extensions.- Parameters:
extensions
- the list of Extensions to be managed- Throws:
Coffee4JException
- if not all Extensions types are known by this Executor
-
-
Method Detail
-
executeModelModifiers
public InputParameterModel executeModelModifiers(InputParameterModel original, ExecutionReporter reporter)
Description copied from interface:ExtensionExecutor
Executes all registeredModelModifier
exactly in the order they were registered in.- Specified by:
executeModelModifiers
in interfaceExtensionExecutor
- Parameters:
original
- the originalInputParameterModel
as given by the userreporter
- for reporting any changes to the original model- Returns:
- an
InputParameterModel
modified by all registered processors
-
executeBeforeGeneration
public void executeBeforeGeneration()
Description copied from interface:ExtensionExecutor
Executes the callback before the initial generation- Specified by:
executeBeforeGeneration
in interfaceExtensionExecutor
-
executeAfterGeneration
public List<Combination> executeAfterGeneration(List<Combination> combinations)
Executes the callback after the generation phase- Specified by:
executeAfterGeneration
in interfaceExtensionExecutor
- Parameters:
combinations
- the list of combinations generated in the generation phase- Returns:
- the possibly sorted combinations
- Throws:
Coffee4JException
- if the items of the input and output list do not match
-
executeBeforeExecution
public void executeBeforeExecution(List<Combination> combinations)
Description copied from interface:ExtensionExecutor
Executes the callback before the execution phase- Specified by:
executeBeforeExecution
in interfaceExtensionExecutor
- Parameters:
combinations
- the sorted combinations from the generation phase
-
executeAfterExecution
public Map<Combination,TestResult> executeAfterExecution(Map<Combination,TestResult> executionResultMap)
Executes the callback after the execution phase- Specified by:
executeAfterExecution
in interfaceExtensionExecutor
- Parameters:
executionResultMap
- the preliminary test results from the execution phase- Returns:
- the possibly altered execution results
- Throws:
Coffee4JException
- if a callback returned null or a callback modified the combinations or executors
-
executeBeforeFaultCharacterization
public void executeBeforeFaultCharacterization(Map<Combination,TestResult> combinationTestResultMap)
Description copied from interface:ExtensionExecutor
Executes the callback before the fault characterization phase- Specified by:
executeBeforeFaultCharacterization
in interfaceExtensionExecutor
- Parameters:
combinationTestResultMap
- the summarized test results of the combinations
-
executeAfterFaultCharacterization
public void executeAfterFaultCharacterization(List<Combination> combinations)
Description copied from interface:ExtensionExecutor
Executes the callback after the fault characterization phase- Specified by:
executeAfterFaultCharacterization
in interfaceExtensionExecutor
- Parameters:
combinations
- the combinations generated in the fault characterization phase
-
-