Class LoggingSequentialExecutionReporter
- java.lang.Object
-
- de.rwth.swc.coffee4j.engine.process.report.sequential.LoggingSequentialExecutionReporter
-
- All Implemented Interfaces:
ExecutionReporter
,SequentialExecutionReporter
- Direct Known Subclasses:
LoggingSequentialExecutionReporterForGeneration
public class LoggingSequentialExecutionReporter extends Object implements SequentialExecutionReporter
ASequentialExecutionReporter
that reports the occurring events using aLogger
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description LoggingSequentialExecutionReporter()
Creates a newLoggingSequentialExecutionReporter
using a logger corresponding to this classLoggingSequentialExecutionReporter(org.slf4j.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
faultCharacterizationFinished(TestInputGroupContext context, Map<Combination,Class<? extends Throwable>> exceptionInducingCombinations, Collection<Combination> failureInducingCombinations)
Called if fault characterization for aTestInputGroup
is completely finished.void
faultCharacterizationStarted(TestInputGroupContext context, FaultCharacterizationAlgorithm algorithm)
Called if a fault characterization started for aTestInputGroup
.void
faultCharacterizationTestInputsGenerated(TestInputGroupContext context, List<Combination> testInputs)
Called if additional test inputs for the fault characterization process of oneTestInputGroup
have been generated by the algorithm given toSequentialExecutionReporter.faultCharacterizationStarted(TestInputGroupContext, FaultCharacterizationAlgorithm)
.protected void
printExceptionInducingCombinations(Map<Combination,Class<? extends Throwable>> exceptionInducingCombinations)
template method implemented by sub-classes reporting found exception-inducing combinationsprotected void
printWarning(Collection<Combination> failureInducingCombinations)
template method implemented by sub-classes reporting found exception-inducing combinationsvoid
report(ReportLevel level, Report report)
Called if any algorithm made a report for and event not covered by any of the life cycle callback methods.void
testInputExecutionFinished(Combination testInput, TestResult result)
Indicates the end of a test input execution.void
testInputExecutionStarted(Combination testInput)
Indicates the start of a test input execution.void
testInputGroupFinished(TestInputGroupContext context)
Called if aTestInputGroup
has completely finished.void
testInputGroupGenerated(TestInputGroupContext context, List<Combination> testInputs)
Called if a newTestInputGroup
has been generated by aTestInputGroupGenerator
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.rwth.swc.coffee4j.engine.report.ExecutionReporter
getReportLevel, modelModified
-
-
-
-
Constructor Detail
-
LoggingSequentialExecutionReporter
public LoggingSequentialExecutionReporter()
Creates a newLoggingSequentialExecutionReporter
using a logger corresponding to this class
-
LoggingSequentialExecutionReporter
public LoggingSequentialExecutionReporter(org.slf4j.Logger logger)
-
-
Method Detail
-
testInputGroupGenerated
public void testInputGroupGenerated(TestInputGroupContext context, List<Combination> testInputs)
Description copied from interface:SequentialExecutionReporter
Called if a newTestInputGroup
has been generated by aTestInputGroupGenerator
. The generator is given inside theTestInputGroupContext
.- Specified by:
testInputGroupGenerated
in interfaceSequentialExecutionReporter
- Parameters:
context
- all important information about one grouptestInputs
- the initially generated test inputs
-
testInputGroupFinished
public void testInputGroupFinished(TestInputGroupContext context)
Description copied from interface:SequentialExecutionReporter
Called if aTestInputGroup
has completely finished. This means fault characterization is finished (if it was enabled), and no more methods in this class will be called in reference to this context.- Specified by:
testInputGroupFinished
in interfaceSequentialExecutionReporter
- Parameters:
context
- the context of the group which was finished
-
faultCharacterizationStarted
public void faultCharacterizationStarted(TestInputGroupContext context, FaultCharacterizationAlgorithm algorithm)
Description copied from interface:SequentialExecutionReporter
Called if a fault characterization started for aTestInputGroup
. The process will end again whenSequentialExecutionReporter.faultCharacterizationFinished(TestInputGroupContext, Map, Collection)
is called.- Specified by:
faultCharacterizationStarted
in interfaceSequentialExecutionReporter
- Parameters:
context
- the context of the group for which fault characterization startedalgorithm
- the algorithm which will be used to characterize faults. This is a reference to the real algorithm. Do not modify as this will most likely have unintended side effects
-
faultCharacterizationFinished
public void faultCharacterizationFinished(TestInputGroupContext context, Map<Combination,Class<? extends Throwable>> exceptionInducingCombinations, Collection<Combination> failureInducingCombinations)
Description copied from interface:SequentialExecutionReporter
Called if fault characterization for aTestInputGroup
is completely finished. This meansSequentialExecutionReporter.faultCharacterizationTestInputsGenerated(TestInputGroupContext, List)
will never be called again for this context, and soon after this methodSequentialExecutionReporter.testInputGroupFinished(TestInputGroupContext)
is called.- Specified by:
faultCharacterizationFinished
in interfaceSequentialExecutionReporter
- Parameters:
context
- the context of the group for which fault characterization finishedexceptionInducingCombinations
- all found exception-inducing combinationsfailureInducingCombinations
- all possibly failure-inducing combinations found. The order may or may not be based on an algorithm internal probability metric of the combinations being failure-inducing
-
printWarning
protected void printWarning(Collection<Combination> failureInducingCombinations)
template method implemented by sub-classes reporting found exception-inducing combinations- Parameters:
failureInducingCombinations
- found failure-inducing combinations.
-
printExceptionInducingCombinations
protected void printExceptionInducingCombinations(Map<Combination,Class<? extends Throwable>> exceptionInducingCombinations)
template method implemented by sub-classes reporting found exception-inducing combinations- Parameters:
exceptionInducingCombinations
- exception-inducing combinations to print together with exceptions.
-
faultCharacterizationTestInputsGenerated
public void faultCharacterizationTestInputsGenerated(TestInputGroupContext context, List<Combination> testInputs)
Description copied from interface:SequentialExecutionReporter
Called if additional test inputs for the fault characterization process of oneTestInputGroup
have been generated by the algorithm given toSequentialExecutionReporter.faultCharacterizationStarted(TestInputGroupContext, FaultCharacterizationAlgorithm)
. This method can only be called (multiple times) between calls toSequentialExecutionReporter.faultCharacterizationStarted(TestInputGroupContext, FaultCharacterizationAlgorithm)
andSequentialExecutionReporter.faultCharacterizationFinished(TestInputGroupContext, Map, Collection)
.- Specified by:
faultCharacterizationTestInputsGenerated
in interfaceSequentialExecutionReporter
- Parameters:
context
- the context of the group for which additional test inputs were generatedtestInputs
- all additionally generated test inputs
-
testInputExecutionStarted
public void testInputExecutionStarted(Combination testInput)
Description copied from interface:ExecutionReporter
Indicates the start of a test input execution.- Specified by:
testInputExecutionStarted
in interfaceExecutionReporter
- Parameters:
testInput
- the started test input
-
testInputExecutionFinished
public void testInputExecutionFinished(Combination testInput, TestResult result)
Description copied from interface:ExecutionReporter
Indicates the end of a test input execution.- Specified by:
testInputExecutionFinished
in interfaceExecutionReporter
- Parameters:
testInput
- the finished test inputresult
- the result of the test input
-
report
public void report(ReportLevel level, Report report)
Description copied from interface:ExecutionReporter
Called if any algorithm made a report for and event not covered by any of the life cycle callback methods.- Specified by:
report
in interfaceExecutionReporter
- Parameters:
level
- the level of the report. Always higher than or equal toExecutionReporter.getReportLevel()
report
- the actual report with resolved arguments
-
-