]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2804 fixes
authorDavid Gageot <david@gageot.net>
Wed, 3 Oct 2012 09:41:25 +0000 (11:41 +0200)
committerDavid Gageot <david@gageot.net>
Wed, 3 Oct 2012 09:41:41 +0000 (11:41 +0200)
plugins/sonar-jacoco-plugin/src/main/java/org/sonar/plugins/jacoco/JaCoCoAllTestsSensor.java
sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb

index d37b7357380e9a70a050dec3657cf5ac80e48f51..4a9b53fdf8fde1b75669515475d424a2cefab6a5 100644 (file)
@@ -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);
index 69f3fe56700231574bf1c1c6757da1e61a70bb4f..a539cd819b5dea941b364291c0be93bc820b1980 100644 (file)
@@ -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<line.conditions && line.after(to) }
       end
     end
+
     render :action => 'index', :layout => !request.xhr?
   end
 
-
   def render_duplications
     duplications_data = @snapshot.measure('duplications_data')