Package randoop.instrument
Class CoveredClassVisitor
- java.lang.Object
-
- randoop.instrument.CoveredClassVisitor
-
- All Implemented Interfaces:
ExecutionVisitor
public class CoveredClassVisitor extends Object implements ExecutionVisitor
AExecutionVisitor
that polls a set of coverage instrumented classes and adds each covered class to anExecutableSequence
after it is executed.
-
-
Constructor Summary
Constructors Constructor Description CoveredClassVisitor(Set<Class<?>> classes)
Creates a visitor to poll the given classes for coverage by sequence executions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
checkAndReset(Class<?> c)
Calls the coverage instrumentation method.void
initialize(ExecutableSequence eseq)
Called before execution of a sequence, to allow the visitor to perform any initialization steps required before execution.void
visitAfterSequence(ExecutableSequence eseq)
Called after execution of a sequence.void
visitAfterStatement(ExecutableSequence eseq, int i)
Invoked by ExecutableSequence.execute after the i-th statement executes.void
visitBeforeStatement(ExecutableSequence eseq, int i)
Invoked by ExecutableSequence.execute before the i-th statement executes.
-
-
-
Method Detail
-
visitAfterSequence
public void visitAfterSequence(ExecutableSequence eseq)
Called after execution of a sequence.Registers each class covered with the sequence execution results.
- Specified by:
visitAfterSequence
in interfaceExecutionVisitor
- Parameters:
eseq
- the visited code sequence
-
checkAndReset
private boolean checkAndReset(Class<?> c)
Calls the coverage instrumentation method.- Parameters:
c
- the class for which method is to be called- Returns:
- true if the instrumentation method is true, false otherwise
-
visitBeforeStatement
public void visitBeforeStatement(ExecutableSequence eseq, int i)
Description copied from interface:ExecutionVisitor
Invoked by ExecutableSequence.execute before the i-th statement executes.Precondition: statements 0..i-1 have been executed.
- Specified by:
visitBeforeStatement
in interfaceExecutionVisitor
- Parameters:
eseq
- the code sequence to be visitedi
- the position of statement to visit
-
visitAfterStatement
public void visitAfterStatement(ExecutableSequence eseq, int i)
Description copied from interface:ExecutionVisitor
Invoked by ExecutableSequence.execute after the i-th statement executes.Precondition: statements 0..i have been executed.
- Specified by:
visitAfterStatement
in interfaceExecutionVisitor
- Parameters:
eseq
- the code sequence to be visitedi
- the position of statement to visit
-
initialize
public void initialize(ExecutableSequence eseq)
Description copied from interface:ExecutionVisitor
Called before execution of a sequence, to allow the visitor to perform any initialization steps required before execution.- Specified by:
initialize
in interfaceExecutionVisitor
- Parameters:
eseq
- the code sequence to be visited
-
-