private void collectForParametrizedTest(String testMethodName) { final CoverageBuilder coverageBuilder = new CoverageBuilder(); final Analyzer analyzer = new Analyzer(this.internalCoverage.getExecutionData(), coverageBuilder); try { analyzer.analyzeAll(new File(this.internalCoverage.getClassesDirectory())); } catch (IOException e) { throw new RuntimeException(e); } if (!this.coveragesPerMethodName.containsKey(testMethodName)) { this.coveragesPerMethodName.put(testMethodName, new ArrayList<>()); } coverageBuilder.getClasses() .forEach(classCoverage -> this.coveragesPerMethodName.get(testMethodName) .add(classCoverage) ); }
coverageBuilder.getClasses().forEach(coverage -> { final List<Integer> listOfCountForCounterFunction = CoverageImpl.getListOfCountForCounterFunction(coverage, ICounter::getCoveredCount);
private AnalyzedNodes analyzeExternal(final IPackageFragmentRoot root) throws CoreException { IPath location = null; try { location = root.getPath(); AnalyzedNodes nodes = cache.get(location); if (nodes != null) { return nodes; } final CoverageBuilder builder = new CoverageBuilder(); final Analyzer analyzer = new Analyzer(executiondata, builder); new ResourceTreeWalker(analyzer).walk(location); nodes = new AnalyzedNodes(builder.getClasses(), builder.getSourceFiles()); cache.put(location, nodes); return nodes; } catch (Exception e) { throw new CoreException(EclEmmaStatus.BUNDLE_ANALYSIS_ERROR.getStatus( root.getElementName(), location, e)); } }
private AnalyzedNodes analyzeInternal(final IPackageFragmentRoot root) throws CoreException { IResource location = null; try { location = getClassfilesLocation(root); if (location == null) { TRACER.trace("No class files found for package fragment root {0}", //$NON-NLS-1$ root.getPath()); return AnalyzedNodes.EMPTY; } AnalyzedNodes nodes = cache.get(location); if (nodes != null) { return nodes; } final CoverageBuilder builder = new CoverageBuilder(); final Analyzer analyzer = new Analyzer(executiondata, builder); new ResourceTreeWalker(analyzer).walk(location); nodes = new AnalyzedNodes(builder.getClasses(), builder.getSourceFiles()); cache.put(location, nodes); return nodes; } catch (Exception e) { throw new CoreException(EclEmmaStatus.BUNDLE_ANALYSIS_ERROR.getStatus( root.getElementName(), location, e)); } }
analyzer.analyzeClass(getTargetClass(targetName), targetName); for (final IClassCoverage cc : coverageBuilder.getClasses())