public class CoveredClassVisitor extends java.lang.Object implements ExecutionVisitor
ExecutionVisitor that polls a set of coverage instrumented classes and adds each
covered class to an ExecutableSequence after it is executed.| Modifier and Type | Field and Description |
|---|---|
private java.util.Set<java.lang.Class<?>> |
classes
The classes to be polled.
|
| Constructor and Description |
|---|
CoveredClassVisitor(java.util.Set<java.lang.Class<?>> classes)
Creates a visitor to poll the given classes for coverage by sequence executions.
|
| Modifier and Type | Method and Description |
|---|---|
private boolean |
checkAndReset(java.lang.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.
|
public CoveredClassVisitor(java.util.Set<java.lang.Class<?>> classes)
classes - the set of classes to poll for coverage by a sequencepublic void visitAfterSequence(ExecutableSequence eseq)
Registers each class covered with the sequence execution results.
visitAfterSequence in interface ExecutionVisitoreseq - the visited code sequenceprivate boolean checkAndReset(java.lang.Class<?> c)
c - the class for which method is to be calledpublic void visitBeforeStatement(ExecutableSequence eseq, int i)
ExecutionVisitorPrecondition: statements 0..i-1 have been executed.
visitBeforeStatement in interface ExecutionVisitoreseq - the code sequence to be visitedi - the position of statement to visitpublic void visitAfterStatement(ExecutableSequence eseq, int i)
ExecutionVisitorPrecondition: statements 0..i have been executed.
visitAfterStatement in interface ExecutionVisitoreseq - the code sequence to be visitedi - the position of statement to visitpublic void initialize(ExecutableSequence eseq)
ExecutionVisitorinitialize in interface ExecutionVisitoreseq - the code sequence to be visited