Package com.intellij.rt.coverage.data

Examples of com.intellij.rt.coverage.data.ProjectData


    return ApplicationManager.getApplication().runReadAction(new Computable<VirtualFile>() {
      @Override
      public VirtualFile compute() {
        CoverageDataManager coverageDataManager = CoverageDataManager.getInstance(project);
        for (CoverageSuite suite : suitesBundle.getSuites()) {
          ProjectData data = suite.getCoverageData(coverageDataManager);
          if (data != null) {
            for (Object key : data.getClasses().keySet()) {
              if (key instanceof String) {
                String path = (String) key;
                VirtualFile file = VfsUtil.findFileByIoFile(new File(path), false);
                if (file != null && file.isValid()) {
                  ProjectFileIndex projectFileIndex = ProjectFileIndex.SERVICE.getInstance(project);
View Full Code Here


    myKarmaServer = karmaServer;
  }

  @NotNull
  private static ProjectData readProjectData(@NotNull File dataFile, @NotNull File basePath) throws IOException {
    ProjectData projectData = new ProjectData();
    LcovCoverageReport report = CoverageSerializationUtils.readLCOV(basePath, dataFile);
    for (Map.Entry<String, List<LcovCoverageReport.LineHits>> entry : report.getInfo().entrySet()) {
      String filePath = SimpleCoverageAnnotator.getFilePath(entry.getKey());
      ClassData classData = projectData.getOrCreateClassData(filePath);
      int max = 0;
      List<LcovCoverageReport.LineHits> lineHitsList = entry.getValue();
      if (lineHitsList.size() > 0) {
        LcovCoverageReport.LineHits lastLineHits = lineHitsList.get(lineHitsList.size() - 1);
        max = lastLineHits.getLineNumber();
View Full Code Here

  public void generateReport(@NotNull Project project,
                             @NotNull DataContext dataContext,
                             @NotNull CoverageSuitesBundle currentSuiteBundle) {
    CoverageReport coverageReport = new CoverageReport();
    for (CoverageSuite suite : currentSuiteBundle.getSuites()) {
      ProjectData projectData = suite.getCoverageData(CoverageDataManager.getInstance(project));
      if (projectData != null) {
        @SuppressWarnings("unchecked")
        Map<String, ClassData> classDataMap = projectData.getClasses();
        for (Map.Entry<String, ClassData> classDataEntry : classDataMap.entrySet()) {
          String fileName = classDataEntry.getKey();
          ClassData classData = classDataEntry.getValue();
          List<CoverageReport.LineHits> lineHitsList = convertClassDataToLineHits(classData);
          coverageReport.mergeFileReport(fileName, lineHitsList);
View Full Code Here

    try {
      return readProjectData(sessionDataFile);
    }
    catch (Exception e) {
      LOG.warn("Can't read coverage data", e);
      return new ProjectData();
    }
  }
View Full Code Here

  }

  @NotNull
  private static ProjectData readProjectData(@NotNull File dataFile) throws IOException {
    CoverageReport report = CoverageSerializationUtils.readLCOV(dataFile);
    ProjectData projectData = new ProjectData();
    for (Map.Entry<String, List<CoverageReport.LineHits>> entry : report.getInfo().entrySet()) {
      String filePath = SimpleCoverageAnnotator.getFilePath(entry.getKey());
      ClassData classData = projectData.getOrCreateClassData(filePath);
      int max = 0;
      List<CoverageReport.LineHits> lineHitsList = entry.getValue();
      if (lineHitsList.size() > 0) {
        CoverageReport.LineHits lastLineHits = lineHitsList.get(lineHitsList.size() - 1);
        max = lastLineHits.getLineNumber();
View Full Code Here

TOP

Related Classes of com.intellij.rt.coverage.data.ProjectData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.