Search in sources :

Example 1 with ICoverageVisitor

use of org.jacoco.core.analysis.ICoverageVisitor in project jacoco by jacoco.

the class AnalysisTimeScenario method getInstrumentedCallable.

@Override
protected Callable<Void> getInstrumentedCallable() throws Exception {
    final byte[] bytes = TargetLoader.getClassDataAsBytes(target);
    final ExecutionDataStore executionData = new ExecutionDataStore();
    ICoverageVisitor visitor = new ICoverageVisitor() {

        public void visitCoverage(IClassCoverage coverage) {
        }
    };
    final Analyzer analyzer = new Analyzer(executionData, visitor);
    return new Callable<Void>() {

        public Void call() throws Exception {
            for (int i = 0; i < count; i++) {
                analyzer.analyzeClass(bytes, target.getName());
            }
            return null;
        }
    };
}
Also used : ExecutionDataStore(org.jacoco.core.data.ExecutionDataStore) IClassCoverage(org.jacoco.core.analysis.IClassCoverage) Analyzer(org.jacoco.core.analysis.Analyzer) ICoverageVisitor(org.jacoco.core.analysis.ICoverageVisitor) Callable(java.util.concurrent.Callable)

Aggregations

Callable (java.util.concurrent.Callable)1 Analyzer (org.jacoco.core.analysis.Analyzer)1 IClassCoverage (org.jacoco.core.analysis.IClassCoverage)1 ICoverageVisitor (org.jacoco.core.analysis.ICoverageVisitor)1 ExecutionDataStore (org.jacoco.core.data.ExecutionDataStore)1