From a83774108ce39d7e3823fa4bbfec380b1628d0d3 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 6 Feb 2013 08:39:47 +0100 Subject: [PATCH] SONAR-4093 Add test information --- .../plugins/core/web/tests_viewer.html.erb | 9 ++- .../app/views/test/_testable_working_view.erb | 61 ++++++++++++------- 2 files changed, 44 insertions(+), 26 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/web/tests_viewer.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/web/tests_viewer.html.erb index 47f5aac6a91..1daa013ee80 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/web/tests_viewer.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/web/tests_viewer.html.erb @@ -89,7 +89,7 @@ <% test_cases.each_with_index do |test_case, index| %> - " id="testdata_<%= index -%>" display="table-row"> + testdata_<%= index -%>" display="table-row"> <% status = test_case[:status] case status @@ -104,14 +104,13 @@ else icon_url = ApplicationController.root_context + "/images/levels/" + status + ".png" end - %> - + - <%= test_case[:time] -%> ms + <%= test_case[:time] -%> ms <% if has_covered_lines %> - + <%= number_with_precision(test_case[:covered_lines], :precision => 0) -%> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testable_working_view.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testable_working_view.erb index 6ddf7d2bda4..e202cdd2093 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testable_working_view.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testable_working_view.erb @@ -5,27 +5,46 @@
<% @test_case_by_test_plan.sort_by{|test_plan, test_cases| test_plan.component.longName}.each do |test_plan, test_cases| %> - - - - - - - - <% test_cases.sort_by{|test_case| test_case.name}.each do |test_case| %> - "> - - - <% end %> - -
- <% resource_key = test_plan.component.key %> - <%= test_plan.component.longName %> - -
- <%= test_case.name -%> -
+ <% resource_key = test_plan.component.key %> + + + + + + + + <% test_cases.sort_by{|test_case| test_case.name}.each do |test_case| %> + "> + <% + status = test_case.status + case status + when 'ok' + icon_url = ApplicationController.root_context + "/images/levels/ok.png" + when 'failure' + icon_url = ApplicationController.root_context + "/images/warning.png" + when 'error' + icon_url = ApplicationController.root_context + "/images/levels/error.png" + when 'skipped' + icon_url = ApplicationController.root_context + "/images/levels/none.png" + else + icon_url = ApplicationController.root_context + "/images/levels/" + status + ".png" + end + %> + + + + + <% end %> + +
+ <%= test_plan.component.longName %> + +
+ + <%= test_case.durationInMs -%> ms + <%= test_case.name -%> +

<% end %>
-- 2.39.5