From 62ec1ada6f9c17f4e20fc1905a1c98d67461be78 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Wed, 3 Oct 2012 11:41:25 +0200 Subject: [PATCH] SONAR-2804 fixes --- .../org/sonar/plugins/jacoco/JaCoCoAllTestsSensor.java | 10 ++++------ .../WEB-INF/app/controllers/resource_controller.rb | 10 +++++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/plugins/sonar-jacoco-plugin/src/main/java/org/sonar/plugins/jacoco/JaCoCoAllTestsSensor.java b/plugins/sonar-jacoco-plugin/src/main/java/org/sonar/plugins/jacoco/JaCoCoAllTestsSensor.java index d37b7357380..4a9b53fdf8f 100644 --- a/plugins/sonar-jacoco-plugin/src/main/java/org/sonar/plugins/jacoco/JaCoCoAllTestsSensor.java +++ b/plugins/sonar-jacoco-plugin/src/main/java/org/sonar/plugins/jacoco/JaCoCoAllTestsSensor.java @@ -63,11 +63,9 @@ public class JaCoCoAllTestsSensor implements Sensor { } private void mergeReports(Project project) { - File baseDir = project.getFileSystem().getBasedir(); - - File reportUTs = new File(baseDir, configuration.getReportPath()); - File reportITs = new File(baseDir, configuration.getItReportPath()); - File reportAllTests = new File(baseDir, MERGED_EXEC); + File reportUTs = project.getFileSystem().resolvePath(configuration.getReportPath()); + File reportITs = project.getFileSystem().resolvePath(configuration.getItReportPath()); + File reportAllTests = project.getFileSystem().resolvePath(MERGED_EXEC); SessionInfoStore infoStore = new SessionInfoStore(); ExecutionDataStore dataStore = new ExecutionDataStore(); @@ -97,7 +95,7 @@ public class JaCoCoAllTestsSensor implements Sensor { reader.setSessionInfoVisitor(infoStore); reader.setExecutionDataVisitor(dataStore); reader.read(); - } catch (final IOException e) { + } catch (IOException e) { throw new SonarException(String.format("Unable to read %s", file.getAbsolutePath()), e); } finally { Closeables.closeQuietly(resourceStream); diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb index 69f3fe56700..a539cd819b5 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb @@ -216,14 +216,14 @@ class ResourceController < ApplicationController if ('lines_to_cover'==@coverage_filter || 'coverage'==@coverage_filter || 'line_coverage'==@coverage_filter || 'new_lines_to_cover'==@coverage_filter || 'new_coverage'==@coverage_filter || 'new_line_coverage'==@coverage_filter || 'it_lines_to_cover'==@coverage_filter || 'it_coverage'==@coverage_filter || 'it_line_coverage'==@coverage_filter || - 'new_it_lines_to_cover'==@coverage_filter || 'new_it_coverage'==@coverage_filter || 'new_it_line_coverage'==@coverage_filter + 'new_it_lines_to_cover'==@coverage_filter || 'new_it_coverage'==@coverage_filter || 'new_it_line_coverage'==@coverage_filter || 'merged_lines_to_cover'==@coverage_filter || 'merged_coverage'==@coverage_filter || 'merged_line_coverage'==@coverage_filter || 'new_merged_lines_to_cover'==@coverage_filter || 'new_merged_coverage'==@coverage_filter || 'new_merged_line_coverage'==@coverage_filter) @coverage_filter = "#{it_prefix}lines_to_cover" filter_lines { |line| line.hits && line.after(to) } elsif ('uncovered_lines'==@coverage_filter || 'new_uncovered_lines'==@coverage_filter || - 'it_uncovered_lines'==@coverage_filter || 'new_it_uncovered_lines'==@coverage_filter + 'it_uncovered_lines'==@coverage_filter || 'new_it_uncovered_lines'==@coverage_filter || 'merged_uncovered_lines'==@coverage_filter || 'new_merged_uncovered_lines'==@coverage_filter) @coverage_filter = "#{it_prefix}uncovered_lines" filter_lines { |line| line.hits && line.hits==0 && line.after(to) } @@ -231,23 +231,23 @@ class ResourceController < ApplicationController elsif ('conditions_to_cover'==@coverage_filter || 'branch_coverage'==@coverage_filter || 'new_conditions_to_cover'==@coverage_filter || 'new_branch_coverage'==@coverage_filter || 'it_conditions_to_cover'==@coverage_filter || 'it_branch_coverage'==@coverage_filter || - 'new_it_conditions_to_cover' == @coverage_filter || 'new_it_branch_coverage'==@coverage_filter + 'new_it_conditions_to_cover' == @coverage_filter || 'new_it_branch_coverage'==@coverage_filter || 'merged_conditions_to_cover'==@coverage_filter || 'merged_branch_coverage'==@coverage_filter || 'new_merged_conditions_to_cover' == @coverage_filter || 'new_merged_branch_coverage'==@coverage_filter) @coverage_filter="#{it_prefix}conditions_to_cover" filter_lines { |line| line.conditions && line.conditions>0 && line.after(to) } elsif ('uncovered_conditions' == @coverage_filter || 'new_uncovered_conditions' == @coverage_filter || - 'it_uncovered_conditions'==@coverage_filter || 'new_it_uncovered_conditions' == @coverage_filter + 'it_uncovered_conditions'==@coverage_filter || 'new_it_uncovered_conditions' == @coverage_filter || 'merged_uncovered_conditions'==@coverage_filter || 'new_merged_uncovered_conditions' == @coverage_filter) @coverage_filter="#{it_prefix}uncovered_conditions" filter_lines { |line| line.conditions && line.covered_conditions && line.covered_conditions 'index', :layout => !request.xhr? end - def render_duplications duplications_data = @snapshot.measure('duplications_data') -- 2.39.5