From 5e9dbc6a6ed84b84407e55e1a4f3cd99084939f8 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 2 Dec 2014 15:01:41 +0100 Subject: [PATCH] SONAR-5884 Remove usages of the component viewer --- server/sonar-web/Gruntfile.coffee | 22 +- .../main/coffee/component-viewer/app.coffee | 120 - .../src/main/coffee/dashboard/file-app.coffee | 79 - .../src/main/coffee/drilldown/app.coffee | 102 - .../src/main/coffee/issue/issue-view.coffee | 1 + .../coffee/issue/manual-issue-view.coffee | 2 + .../issues/component-viewer/main.coffee | 16 +- .../source-viewer/source-viewer-header.hbs | 81 + .../source-viewer/source-viewer-measures.hbs | 546 +++ .../source-viewer-more-actions.hbs | 8 + .../main/hbs/source-viewer/source-viewer.hbs | 4 +- server/sonar-web/src/main/js/drilldown/app.js | 54 + .../src/main/js/graphics/pie-chart.js | 52 + .../src/main/js/source-viewer/app.js | 53 + .../src/main/js/source-viewer/header.js | 73 + .../main/js/source-viewer/measures-overlay.js | 190 + .../src/main/js/source-viewer/more-actions.js | 39 + .../popups/line-actions-popup.js | 2 +- .../src/main/js/source-viewer/viewer.js | 115 +- server/sonar-web/src/main/js/tests/e2e/lib.js | 17 +- .../tests/component-viewer-coverage-spec.js | 116 - .../component-viewer-duplications-spec.js | 109 - .../e2e/tests/component-viewer-issues-spec.js | 170 - .../component-viewer-lines-filters-spec.js | 69 - .../component-viewer-link-to-raw-spec.js | 37 - ...ponent-viewer-select-tab-by-metric-spec.js | 141 - .../tests/e2e/tests/component-viewer-spec.js | 459 -- .../tests/component-viewer-spec/issues.json | 646 --- .../component-viewer-spec/tests/app.json | 4 - .../tests/covered-files.json | 7 - .../tests/resources.json | 25 - .../component-viewer-spec/tests/source.json | 24 - .../component-viewer-spec/tests/tests.json | 14 - .../main/js/tests/e2e/tests/issues-spec.js | 95 + .../file-level/components-app.json | 124 + .../tests/issues-spec/file-level/lines.json | 11 + .../tests/issues-spec/file-level/search.json | 494 +++ .../tests/issues-spec/search-reopened.json | 485 +++ ...spec.js => source-viewer-favorite-spec.js} | 20 +- .../tests/source-viewer-link-to-raw-spec.js | 40 + ...ewer-should-show-measures-for-test-file.js | 58 + .../api-components-app.json | 56 + .../api-issues-search.json | 66 + .../api-resources.json | 45 + .../api-sources-lines.json | 130 + .../api-tests-show.json | 27 + .../source-viewer-should-show-measures.js | 102 + .../api-components-app.json | 95 + .../api-issues-search.json | 234 + .../api-resources.json | 256 ++ .../api-sources-lines.json | 130 + .../js/tests/e2e/tests/source-viewer-spec.js | 213 + .../app-not-logged-in.json | 24 +- .../app.json | 24 +- .../coverage.json | 0 .../source-viewer-spec/create-issue.json | 17 + .../cross-project-duplications.json | 0 .../duplications-in-deleted-files.json | 0 .../duplications.json | 0 .../e2e/tests/source-viewer-spec/issues.json | 200 + .../e2e/tests/source-viewer-spec/lines.json | 3868 +++++++++++++++++ .../resources-without-ncloc-data.json | 0 .../resources.json | 0 .../scm.json | 0 .../source.json | 0 .../test-cases.json | 0 .../tests/source-viewer-spec/tests/app.json | 49 + .../tests/source-viewer-spec/tests/lines.json | 1808 ++++++++ .../tests/source-viewer-spec/tests/tests.json | 38 + .../js/tests/e2e/views/component-viewer.jade | 9 - .../js/tests/e2e/views/source-viewer.jade | 13 + .../src/main/js/widgets/pie-chart.js | 1 + .../sonar-web/src/main/less/components.less | 1 + .../src/main/less/components/measures.less | 80 + .../src/main/less/components/source.less | 175 +- .../app/controllers/component_controller.rb | 18 + .../app/views/component/index.html.erb | 13 +- .../app/views/dashboard/no_dashboard.html.erb | 14 +- .../app/views/drilldown/measures.html.erb | 4 +- .../resources/org/sonar/l10n/core.properties | 5 + 80 files changed, 10209 insertions(+), 2230 deletions(-) delete mode 100644 server/sonar-web/src/main/coffee/component-viewer/app.coffee delete mode 100644 server/sonar-web/src/main/coffee/dashboard/file-app.coffee delete mode 100644 server/sonar-web/src/main/coffee/drilldown/app.coffee create mode 100644 server/sonar-web/src/main/hbs/source-viewer/source-viewer-header.hbs create mode 100644 server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs create mode 100644 server/sonar-web/src/main/hbs/source-viewer/source-viewer-more-actions.hbs create mode 100644 server/sonar-web/src/main/js/drilldown/app.js create mode 100644 server/sonar-web/src/main/js/graphics/pie-chart.js create mode 100644 server/sonar-web/src/main/js/source-viewer/app.js create mode 100644 server/sonar-web/src/main/js/source-viewer/header.js create mode 100644 server/sonar-web/src/main/js/source-viewer/measures-overlay.js create mode 100644 server/sonar-web/src/main/js/source-viewer/more-actions.js delete mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-coverage-spec.js delete mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-duplications-spec.js delete mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-issues-spec.js delete mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-lines-filters-spec.js delete mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-link-to-raw-spec.js delete mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-select-tab-by-metric-spec.js delete mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec.js delete mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/issues.json delete mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/app.json delete mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/covered-files.json delete mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/resources.json delete mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/source.json delete mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/tests.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/file-level/components-app.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/file-level/lines.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/file-level/search.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/search-reopened.json rename server/sonar-web/src/main/js/tests/e2e/tests/{component-viewer-favorite-spec.js => source-viewer-favorite-spec.js} (72%) create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-link-to-raw-spec.js create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file.js create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-components-app.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-issues-search.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-resources.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-sources-lines.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-tests-show.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures.js create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-components-app.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-issues-search.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-resources.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-sources-lines.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec.js rename server/sonar-web/src/main/js/tests/e2e/tests/{component-viewer-spec => source-viewer-spec}/app-not-logged-in.json (71%) rename server/sonar-web/src/main/js/tests/e2e/tests/{component-viewer-spec => source-viewer-spec}/app.json (71%) rename server/sonar-web/src/main/js/tests/e2e/tests/{component-viewer-spec => source-viewer-spec}/coverage.json (100%) create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/create-issue.json rename server/sonar-web/src/main/js/tests/e2e/tests/{component-viewer-spec => source-viewer-spec}/cross-project-duplications.json (100%) rename server/sonar-web/src/main/js/tests/e2e/tests/{component-viewer-spec => source-viewer-spec}/duplications-in-deleted-files.json (100%) rename server/sonar-web/src/main/js/tests/e2e/tests/{component-viewer-spec => source-viewer-spec}/duplications.json (100%) create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/issues.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/lines.json rename server/sonar-web/src/main/js/tests/e2e/tests/{component-viewer-spec => source-viewer-spec}/resources-without-ncloc-data.json (100%) rename server/sonar-web/src/main/js/tests/e2e/tests/{component-viewer-spec => source-viewer-spec}/resources.json (100%) rename server/sonar-web/src/main/js/tests/e2e/tests/{component-viewer-spec => source-viewer-spec}/scm.json (100%) rename server/sonar-web/src/main/js/tests/e2e/tests/{component-viewer-spec => source-viewer-spec}/source.json (100%) rename server/sonar-web/src/main/js/tests/e2e/tests/{component-viewer-spec => source-viewer-spec}/test-cases.json (100%) create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/tests/app.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/tests/lines.json create mode 100644 server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/tests/tests.json delete mode 100644 server/sonar-web/src/main/js/tests/e2e/views/component-viewer.jade create mode 100644 server/sonar-web/src/main/js/tests/e2e/views/source-viewer.jade create mode 100644 server/sonar-web/src/main/less/components/measures.less diff --git a/server/sonar-web/Gruntfile.coffee b/server/sonar-web/Gruntfile.coffee index 75826ff14c0..e4caebb3605 100644 --- a/server/sonar-web/Gruntfile.coffee +++ b/server/sonar-web/Gruntfile.coffee @@ -93,6 +93,7 @@ module.exports = (grunt) -> '<%= pkg.assets %>js/widgets/histogram.js' '<%= pkg.assets %>js/widgets/word-cloud.js' '<%= pkg.assets %>js/widgets/treemap.js' + '<%= pkg.assets %>js/graphics/pie-chart.js' '<%= pkg.assets %>js/top-search.js' '<%= pkg.assets %>js/sortable.js' '<%= pkg.assets %>js/common/inputs.js' @@ -127,6 +128,7 @@ module.exports = (grunt) -> '<%= pkg.assets %>js/widgets/histogram.js' '<%= pkg.assets %>js/widgets/word-cloud.js' '<%= pkg.assets %>js/widgets/treemap.js' + '<%= pkg.assets %>js/graphics/pie-chart.js' '<%= pkg.assets %>js/top-search.js' '<%= pkg.assets %>js/sortable.js' '<%= pkg.assets %>js/common/inputs.js' @@ -192,17 +194,13 @@ module.exports = (grunt) -> name: 'drilldown/app' out: '<%= pkg.assets %>build/js/drilldown/app.js' - dashboardFile: options: - name: 'dashboard/file-app' - out: '<%= pkg.assets %>build/js/dashboard/file-app.js' - dashboard: options: name: 'dashboard/app' out: '<%= pkg.assets %>build/js/dashboard/app.js' - componentViewer: options: - name: 'component-viewer/app' - out: '<%= pkg.assets %>build/js/component-viewer/app.js' + sourceViewer: options: + name: 'source-viewer/app' + out: '<%= pkg.assets %>build/js/source-viewer/app.js' design: options: name: 'design/app' @@ -315,6 +313,13 @@ module.exports = (grunt) -> 'fail-fast': true port: '<%= grunt.option("port") %>' src: ['<%= pkg.sources %>js/tests/e2e/tests/<%= grunt.option("spec") %>-spec.js'] + testfile: + options: + test: true + verbose: true + 'fail-fast': true + port: '<%= grunt.option("port") %>' + src: ['<%= grunt.option("file") %>'] uglify: @@ -396,6 +401,9 @@ module.exports = (grunt) -> grunt.registerTask 'single', ['dev', 'express:test', 'casper:single'] + grunt.registerTask 'testfile', + ['dev', 'express:test', 'casper:testfile'] + # tasks used by Maven build (see pom.xml) grunt.registerTask 'maven-build-skip-tests-true', ['build'] diff --git a/server/sonar-web/src/main/coffee/component-viewer/app.coffee b/server/sonar-web/src/main/coffee/component-viewer/app.coffee deleted file mode 100644 index 30d4c76ffc5..00000000000 --- a/server/sonar-web/src/main/coffee/component-viewer/app.coffee +++ /dev/null @@ -1,120 +0,0 @@ -requirejs.config - baseUrl: "#{baseUrl}/js" - - paths: - 'backbone': 'third-party/backbone' - 'backbone.marionette': 'third-party/backbone.marionette' - 'handlebars': 'third-party/handlebars' - - shim: - 'backbone.marionette': - deps: ['backbone'] - exports: 'Marionette' - 'backbone': - exports: 'Backbone' - 'handlebars': - exports: 'Handlebars' - - -requirejs [ - 'backbone.marionette' - 'component-viewer/main' -], ( - Marionette - ComponentViewer -) -> - - $ = jQuery - API_ISSUE = "#{baseUrl}/api/issues/show" - App = new Marionette.Application() - el = $('#body') - - - App.addRegions - viewerRegion: '#component-viewer' - - - App.resizeContainer = -> - width = $(window).width() - height = $(window).height() - el.innerWidth(width).innerHeight(height) - - - App.requestComponentViewer = (s, currentIssue) -> - if s? - settings = issues: false, coverage: false, duplications: false, scm: false, workspace: false - s.split(',').forEach (d) -> settings[d] = true - settings.issues = false if currentIssue? - else settings = null - unless App.componentViewer? - @resizeContainer() - $(window).on 'resize', => @resizeContainer() - App.componentViewer = new ComponentViewer - settings: settings - elementToFit: el - App.viewerRegion.show App.componentViewer - App.componentViewer - - - App.addInitializer -> - # Define parameters - paramsHash = location.hash.substr(1) - params = {} - paramsHash.split('&').forEach (d) -> - t = d.split '=' - params[t[0]] = decodeURIComponent t[1] - - viewer = App.requestComponentViewer params.settings, params.currentIssue - if params.component? - loadIssue = (key) -> - $.get API_ISSUE, key: key, (r) => - viewer.showIssues false, r.issue - - if params.line? - viewer.sourceView.highlightedLine = params.line - viewer.on 'sized', -> - viewer.off 'sized' - viewer.scrollToLine params.line - - if params.blocks? - blocks = params.blocks.split(';').map (b) -> - t = b.split ',' - from: +t[0], to: +t[1] - viewer.on 'resetShowBlocks', -> - viewer.off 'resetShowBlocks' - viewer.sourceView.showBlocks = blocks - - viewer.open params.component - - viewer.on 'loaded', -> - viewer.off 'loaded' - if params.tab? && params.item? && params.period? - viewer.headerView.enableBar(params.tab).done -> - viewer.enablePeriod +params.period, params.item - else if params.tab? && params.item? - viewer.state.set activeHeaderTab: params.tab, activeHeaderItem: params.item - viewer.headerView.render() - else if params.tab? && params.period? - viewer.headerView.enableBar(params.tab).done -> - viewer.enablePeriod params.period - else if params.tab? && params.currentIssue? - loadIssue(params.currentIssue).done -> - viewer.state.set activeHeaderTab: params.tab - viewer.headerView.render() - else if params.tab? - viewer.state.set activeHeaderTab: params.tab - viewer.headerView.render() - viewer.showAllLines() - else if params.currentIssue? - loadIssue params.currentIssue - else viewer.showAllLines() - - - - # Message bundles - l10nXHR = window.requestMessages() - - - $.when(l10nXHR).done -> - # Start the application - App.start() diff --git a/server/sonar-web/src/main/coffee/dashboard/file-app.coffee b/server/sonar-web/src/main/coffee/dashboard/file-app.coffee deleted file mode 100644 index 0e35c084710..00000000000 --- a/server/sonar-web/src/main/coffee/dashboard/file-app.coffee +++ /dev/null @@ -1,79 +0,0 @@ -requirejs.config - baseUrl: "#{baseUrl}/js" - - paths: - 'backbone': 'third-party/backbone' - 'backbone.marionette': 'third-party/backbone.marionette' - 'handlebars': 'third-party/handlebars' - - shim: - 'backbone.marionette': - deps: ['backbone'] - exports: 'Marionette' - 'backbone': - exports: 'Backbone' - 'handlebars': - exports: 'Handlebars' - - -requirejs [ - 'backbone.marionette' - 'component-viewer/main' - 'drilldown/conf' -], ( - Marionette - ComponentViewer - MetricConf -) -> - - $ = jQuery - - App = new Marionette.Application() - el = $('#accordion-panel') - - - App.addRegions - viewerRegion: '#accordion-panel' - - - App.resizeContainer = -> - width = $(window).width() - height = $(window).height() - el.offset().top - $('#footer').height() - 10 - el.innerWidth(width).innerHeight(height) - - - App.requestComponentViewer = -> - unless App.componentViewer? - @resizeContainer() - $(window).on 'resize', => @resizeContainer() - App.componentViewer = new ComponentViewer - elementToFit: el - App.viewerRegion.show App.componentViewer - App.componentViewer - - - - App.addInitializer -> - viewer = App.requestComponentViewer() - if window.metric? - metricConf = MetricConf[window.metric] - if metricConf? - activeHeaderTab = metricConf.tab - activeHeaderItem = metricConf.item - viewer.open window.fileKey - viewer.on 'loaded', -> - viewer.off 'loaded' - if activeHeaderTab? && activeHeaderItem? - viewer.state.set activeHeaderTab: activeHeaderTab, activeHeaderItem: activeHeaderItem - viewer.headerView.render() - else - viewer.showAllLines() - - - # Message bundles - l10nXHR = window.requestMessages() - - - $.when(l10nXHR).done -> - # Start the application - App.start() diff --git a/server/sonar-web/src/main/coffee/drilldown/app.coffee b/server/sonar-web/src/main/coffee/drilldown/app.coffee deleted file mode 100644 index 860b9b3d985..00000000000 --- a/server/sonar-web/src/main/coffee/drilldown/app.coffee +++ /dev/null @@ -1,102 +0,0 @@ -requirejs.config - baseUrl: "#{baseUrl}/js" - - paths: - 'backbone': 'third-party/backbone' - 'backbone.marionette': 'third-party/backbone.marionette' - 'handlebars': 'third-party/handlebars' - - shim: - 'backbone.marionette': - deps: ['backbone'] - exports: 'Marionette' - 'backbone': - exports: 'Backbone' - 'handlebars': - exports: 'Handlebars' - - -requirejs [ - 'backbone.marionette' - 'component-viewer/main' - 'drilldown/conf' -], ( - Marionette - ComponentViewer - MetricConf -) -> - - $ = jQuery - App = new Marionette.Application() - el = $('#accordion-panel') - - - App.addRegions - viewerRegion: '#accordion-panel' - - - App.resizeContainer = -> - height = Math.min 780, ($(window).height() - 20) - el.innerHeight(height) - - - App.requestComponentViewer = -> - unless App.componentViewer? - @resizeContainer() - $(window).on 'resize', => @resizeContainer() - App.componentViewer = new ComponentViewer - elementToFit: el - App.viewerRegion.show App.componentViewer - App.componentViewer - - - App.addInitializer -> - # Define parameters - drilldown = window.drilldown || {} - activeHeaderTab = 'issues' - activeHeaderItem = '.js-filter-unresolved-issues' - if drilldown.metric? - metricConf = MetricConf[drilldown.metric] - if metricConf? - activeHeaderTab = metricConf.tab - activeHeaderItem = metricConf.item - else - activeHeaderTab = 'basic' - activeHeaderItem = null - else if drilldown.rule? - activeHeaderTab = 'issues' - activeHeaderItem = ".js-filter-rule[data-rule='#{drilldown.rule}']" - else if drilldown.severity? - activeHeaderTab = 'issues' - activeHeaderItem = ".js-filter-#{drilldown.severity}-issues" - - # Add event listeners - $('.js-drilldown-link').on 'click', (e) -> - e.preventDefault() - key = $(e.currentTarget).data 'key' - viewer = App.requestComponentViewer() - - f = -> - if drilldown.period? - viewer.enablePeriod drilldown.period, activeHeaderItem - else if activeHeaderItem? - viewer.state.set activeHeaderTab: activeHeaderTab, activeHeaderItem: activeHeaderItem - viewer.render() - else viewer.showAllLines() - - viewer.open key - viewer.on 'loaded', -> - viewer.off 'loaded' - if activeHeaderTab? - viewer.headerView.enableBar(activeHeaderTab).done -> f() - else f() - - - - # Message bundles - l10nXHR = window.requestMessages() - - - $.when(l10nXHR).done -> - # Start the application - App.start() diff --git a/server/sonar-web/src/main/coffee/issue/issue-view.coffee b/server/sonar-web/src/main/coffee/issue/issue-view.coffee index a747345efd2..852996908f0 100644 --- a/server/sonar-web/src/main/coffee/issue/issue-view.coffee +++ b/server/sonar-web/src/main/coffee/issue/issue-view.coffee @@ -64,6 +64,7 @@ define [ onRender: -> + @$el.attr 'data-key', @model.get('key') resetIssue: (options, p) -> diff --git a/server/sonar-web/src/main/coffee/issue/manual-issue-view.coffee b/server/sonar-web/src/main/coffee/issue/manual-issue-view.coffee index cf570fefc42..f1945994a15 100644 --- a/server/sonar-web/src/main/coffee/issue/manual-issue-view.coffee +++ b/server/sonar-web/src/main/coffee/issue/manual-issue-view.coffee @@ -60,6 +60,8 @@ define [ data = $(e.currentTarget).serialize() $.post API_ADD_MANUAL_ISSUE, data .done (r) => + r = JSON.parse(r) if typeof r == 'string' + console.log r @addIssue r.issue.key .fail (r) => @hideSpinner() diff --git a/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee b/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee index 098e878aa45..8101cbd5a93 100644 --- a/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee +++ b/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee @@ -25,18 +25,16 @@ define [ events: -> _.extend super, 'click .js-close-component-viewer': 'closeComponentViewer' - 'click .sym': 'highlightUsages' 'click .code-issue': 'selectIssue' initialize: (options) -> super - @listenTo @, 'loaded', @onLoaded @listenTo options.app.state, 'change:selectedIndex', @select onLoaded: -> - @bindScrollEvents() + super @bindShortcuts() if @baseIssue? @scrollToLine @baseIssue.get 'line' @@ -166,6 +164,10 @@ define [ @addIssuesPerLineMeta @issues + renderIssues: -> + @issues.forEach @renderIssue, @ + + renderIssue: (issue) -> issueView = new IssueView el: '#issue-' + issue.get('key') @@ -189,11 +191,3 @@ define [ closeComponentViewer: -> @options.app.controller.closeComponentViewer() - - - highlightUsages: (e) -> - highlighted = $(e.currentTarget).is '.highlighted' - key = e.currentTarget.className.split(/\s+/)[0] - @$('.sym.highlighted').removeClass 'highlighted' - @$(".sym.#{key}").addClass 'highlighted' unless highlighted - diff --git a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-header.hbs b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-header.hbs new file mode 100644 index 00000000000..a010166978d --- /dev/null +++ b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-header.hbs @@ -0,0 +1,81 @@ +
+ {{#unless removed}} + {{#if projectName}} +
+ {{qualifierIcon 'TRK'}} {{projectName}} + {{#if subProjectName}} +     + {{qualifierIcon 'TRK'}} {{subProjectName}} + {{/if}} +
+ {{/if}} + +
+ {{qualifierIcon q}} {{default path longName}} + + {{#if canMarkAsFavourite}} + + + + {{/if}} +
+ {{else}} +
{{removedMessage}}
+ {{/unless}} +
+ +{{#unless removed}} + + +
+ {{#if isUnitTest}} +
+ {{measures.fTests}} + {{t 'metric.tests.name'}} +
+ {{/if}} + + {{#unless isUnitTest}} +
+ {{default measures.fLines '–'}} + {{t 'metric.lines.name'}} +
+ {{/unless}} + + {{#if measures.fSqaleRating}} +
+ + {{measures.fSqaleRating}} + +
+ {{/if}} + +
+ {{default measures.fDebt '0'}} + {{t 'component_viewer.header.debt'}} +
+ {{#if measures.fIssues}} +
+ {{measures.fIssues}} + {{t 'metric.violations.name'}} +
+ {{/if}} + + {{#inArray tabs 'coverage'}} +
+ {{default measures.fCoverage '–'}} + {{t 'metric.coverage.name'}} +
+ {{/inArray}} + + {{#inArray tabs 'duplications'}} +
+ {{default measures.fDuplicationDensity '–'}} + {{t 'duplications'}} +
+ {{/inArray}} + +
+{{/unless}} diff --git a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs new file mode 100644 index 00000000000..6e90cd396c6 --- /dev/null +++ b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs @@ -0,0 +1,546 @@ + + +{{#unless isUnitTest}} + +{{/unless}} + + + +{{#unless isUnitTest}} + +{{/unless}} + +{{#if isUnitTest}} + + + +{{/if}} + +{{#unless isUnitTest}} + +{{/unless}} + +
+
+
+ +
+
+
+ {{t 'metric.ncloc.name'}} + {{measures.ncloc}} +
+
+ {{t 'metric.lines.name'}} + {{measures.lines}} +
+
+
+ + {{#any measures.generated_ncloc measures.generated_lines}} +
+
+ {{#if measures.generated_ncloc}} +
+ {{t 'metric.generated_ncloc.name'}} + {{measures.generated_ncloc}} +
+ {{/if}} + {{#if measures.generated_lines}} +
+ {{t 'metric.generated_lines.name'}} + {{measures.generated_lines}} +
+ {{/if}} +
+
+ {{/any}} + +
+
+
+ {{t 'metric.classes.name'}} + {{measures.classes}} +
+
+ {{t 'metric.functions.name'}} + {{measures.functions}} +
+
+
+
+ {{t 'metric.accessors.name'}} + {{measures.accessors}} +
+
+ {{t 'metric.statements.name'}} + {{measures.statements}} +
+
+
+ +
+
+ +
+
+
+
+ Comments + {{measures.comment_lines_density}} +
+
+ {{t 'metric.comment_lines.name'}} + {{measures.comment_lines}} +
+
+
+
+ +
+
+
+ {{t 'metric.public_api.name'}} + {{measures.public_api}} +
+
+ {{t 'metric.public_documented_api_density.name'}} + {{measures.public_documented_api_density}} +
+
+ {{t 'metric.public_undocumented_api.name'}} + {{measures.public_undocumented_api}} +
+
+
+ +
+
+
+ {{t 'metric.complexity.name'}} + {{measures.complexity}} +
+
+ {{t 'metric.function_complexity.name'}} + {{measures.function_complexity}} +
+
+
+
+ {{#notNull measures.fDebt}} +
+ {{#notNull measures.fSqaleRating}} +
+ {{measures.sqale_rating}} +
+ {{/notNull}} +
+
+ {{t 'metric.sqale_index.short_name'}} + {{measures.sqale_index}} +
+
+
+ {{/notNull}} +
+
+
+ Issues + {{measures.violations}} +
+
+ {{#notNull measures.fSqaleDebtRatio}} +
+
+ {{t 'metric.sqale_debt_ratio.short_name'}} + {{measures.sqale_debt_ratio}} +
+
+ {{/notNull}} +
+ {{#gt measures.fIssues 0}} +
+
+
+ {{severityIcon 'BLOCKER'}} {{t 'severity.BLOCKER'}} + {{default measures.blocker_violations 0}} +
+
+ {{severityIcon 'CRITICAL'}} {{t 'severity.CRITICAL'}} + {{default measures.critical_violations 0}} +
+
+ {{severityIcon 'MAJOR'}} {{t 'severity.MAJOR'}} + {{default measures.major_violations 0}} +
+
+
+
+ {{severityIcon 'MINOR'}} {{t 'severity.MINOR'}} + {{default measures.minor_violations 0}} +
+
+ {{severityIcon 'INFO'}} {{t 'severity.INFO'}} + {{default measures.info_violations 0}} +
+
+
+ {{/gt}} +
+ {{#all measures.coverage measures.it_coverage}} +
+
+ +
+
+
+ {{t 'metric.coverage.name'}} + {{measures.coverage}} +
+
+
+ +
+
+ +
+
+
+ {{t 'metric.line_coverage.name'}} + {{measures.line_coverage}} +
+
+ {{t 'metric.lines_to_cover.name'}} + {{measures.lines_to_cover}} +
+
+ {{t 'metric.uncovered_lines.name'}} + {{measures.uncovered_lines}} +
+
+
+ +
+
+ +
+
+
+ {{t 'metric.branch_coverage.name'}} + {{measures.branch_coverage}} +
+
+ {{t 'metric.conditions_to_cover.name'}} + {{measures.conditions_to_cover}} +
+
+ {{t 'metric.uncovered_conditions.name'}} + {{measures.uncovered_conditions}} +
+
+
+
+
+ +
+
+
+ {{t 'metric.coverage.name'}} + {{measures.it_coverage}} +
+
+
+ +
+
+ +
+
+
+ {{t 'metric.line_coverage.name'}} + {{measures.it_line_coverage}} +
+
+ {{t 'metric.lines_to_cover.name'}} + {{measures.it_lines_to_cover}} +
+
+ {{t 'metric.uncovered_lines.name'}} + {{measures.it_uncovered_lines}} +
+
+
+ +
+
+ +
+
+
+ {{t 'metric.branch_coverage.name'}} + {{measures.it_branch_coverage}} +
+
+ {{t 'metric.conditions_to_cover.name'}} + {{measures.it_conditions_to_cover}} +
+
+ {{t 'metric.uncovered_conditions.name'}} + {{measures.it_uncovered_conditions}} +
+
+
+ {{/all}} + + {{#if measures.overall_coverage}} +
+
+ +
+
+
+ {{t 'metric.coverage.name'}} + {{measures.overall_coverage}} +
+
+
+ +
+
+ +
+
+
+
+ {{t 'metric.line_coverage.name'}} + {{measures.overall_line_coverage}} +
+
+
+
+ +
+
+
+ {{t 'metric.lines_to_cover.name'}} + {{measures.overall_lines_to_cover}} +
+
+ {{t 'metric.uncovered_lines.name'}} + {{measures.overall_uncovered_lines}} +
+
+
+ +
+
+ +
+
+
+
+ {{t 'metric.branch_coverage.name'}} + {{measures.overall_branch_coverage}} +
+
+
+
+ +
+
+
+ {{t 'metric.conditions_to_cover.name'}} + {{measures.overall_conditions_to_cover}} +
+
+ {{t 'metric.uncovered_conditions.name'}} + {{measures.overall_uncovered_conditions}} +
+
+
+ {{/if}} +
+
+
+
+ {{t 'metric.tests.name'}} + {{measures.tests}} +
+ {{#notNull measures.test_success_density}} +
+ {{t 'metric.test_success_density.name'}} + {{measures.test_success_density}} +
+ {{/notNull}} + {{#notNull measures.test_failures}} +
+ {{t 'metric.test_failures.name'}} + {{measures.test_failures}} +
+ {{/notNull}} + {{#notNull measures.test_errors}} +
+ {{t 'metric.test_errors.name'}} + {{measures.test_errors}} +
+ {{/notNull}} + {{#notNull measures.skipped_tests}} +
+ {{t 'metric.skipped_tests.name'}} + {{measures.skipped_tests}} +
+ {{/notNull}} + {{#notNull measures.test_execution_time}} +
+ {{t 'metric.test_execution_time.name'}} + {{measures.test_execution_time}} +
+ {{/notNull}} +
+
+ +
+ + + + + + {{#each tests}} + + {{#eq status 'SKIPPED'}} + + + + + {{else}} + {{#ifTestData this}} + + + + + {{else}} + + + + {{/ifTestData}} + {{/eq}} + + {{/each}} +
+ {{t 'component_viewer.measure_section.unit_tests'}}
+ {{t 'component_viewer.tests.ordered_by'}} + + {{t 'component_viewer.tests.duration'}} + / + + {{t 'component_viewer.tests.test_name'}} + / + + {{t 'component_viewer.tests.status'}} +
{{t 'component_viewer.covered_lines'}}
{{testStatusIcon status}}{{name}}{{testStatusIcon status}}{{durationInMs}}ms{{name}}{{coveredLines}}{{testStatusIcon status}}{{durationInMs}}ms{{name}}
+
+
+ {{#if selectedTest}} + {{#notEq selectedTest.status 'ERROR'}} + {{#notEq selectedTest.status 'FAILURE'}} +
{{t 'component_viewer.transition.covers'}}
+ {{#each coveredFiles}} +
+ {{longName}} + {{tp 'component_viewer.x_lines_are_covered' coveredLines}} +
+ {{else}} + {{t 'none'}} + {{/each}} + {{/notEq}} + {{/notEq}} + + {{#notEq selectedTest.status 'OK'}} +
{{t 'component_viewer.details'}}
+ {{#if selectedTest.message}} +
{{selectedTest.message}}
+ {{/if}} +
{{selectedTest.stackTrace}}
+ {{/notEq}} + {{/if}} +
+
+
+ +
+
+
+ Duplications + {{measures.duplicated_lines_density}} +
+
+
+
+
+
+ {{t 'metric.duplicated_blocks.name'}} + {{measures.duplicated_blocks}} +
+
+ {{t 'metric.duplicated_lines.name'}} + {{measures.duplicated_lines}} +
+
+
+
+ + diff --git a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-more-actions.hbs b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-more-actions.hbs new file mode 100644 index 00000000000..0cd21d71b69 --- /dev/null +++ b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-more-actions.hbs @@ -0,0 +1,8 @@ +{{t 'component_viewer.show_measures'}} + +
+
+ +{{t 'component_viewer.new_window'}} +
+{{t 'component_viewer.show_raw_source'}} diff --git a/server/sonar-web/src/main/hbs/source-viewer/source-viewer.hbs b/server/sonar-web/src/main/hbs/source-viewer/source-viewer.hbs index 51c77b080d7..fff1780d65f 100644 --- a/server/sonar-web/src/main/hbs/source-viewer/source-viewer.hbs +++ b/server/sonar-web/src/main/hbs/source-viewer/source-viewer.hbs @@ -1,10 +1,12 @@ +
+ {{#if hasSourceBefore}} {{/if}} {{#each source}} - +
diff --git a/server/sonar-web/src/main/js/drilldown/app.js b/server/sonar-web/src/main/js/drilldown/app.js new file mode 100644 index 00000000000..f77a324caa5 --- /dev/null +++ b/server/sonar-web/src/main/js/drilldown/app.js @@ -0,0 +1,54 @@ +requirejs.config({ + baseUrl: baseUrl + '/js', + paths: { + 'backbone': 'third-party/backbone', + 'backbone.marionette': 'third-party/backbone.marionette', + 'handlebars': 'third-party/handlebars' + }, + shim: { + 'backbone.marionette': { + deps: ['backbone'], + exports: 'Marionette' + }, + 'backbone': { + exports: 'Backbone' + }, + 'handlebars': { + exports: 'Handlebars' + } + } +}); + +requirejs([ + 'backbone.marionette', + 'source-viewer/viewer', +], function (Marionette, SourceViewer) { + + var $ = jQuery, + App = new Marionette.Application(); + + App.addRegions({ + viewerRegion: '#source-viewer' + }); + + App.addInitializer(function () { + $('.js-drilldown-link').on('click', function (e) { + e.preventDefault(); + var key = $(e.currentTarget).data('key'), + uuid = $(e.currentTarget).data('uuid'), + viewer = new SourceViewer(); + App.viewerRegion.show(viewer); + viewer.open(uuid, key); + if (typeof window.drilldown.period === 'number') { + viewer.on('loaded', function () { + viewer.filterLinesByPeriod(window.drilldown.period); + }); + } + }); + }); + + var l10nXHR = window.requestMessages(); + l10nXHR.done(function () { + App.start(); + }); +}); diff --git a/server/sonar-web/src/main/js/graphics/pie-chart.js b/server/sonar-web/src/main/js/graphics/pie-chart.js new file mode 100644 index 00000000000..241ed8764f4 --- /dev/null +++ b/server/sonar-web/src/main/js/graphics/pie-chart.js @@ -0,0 +1,52 @@ +(function ($) { + + function trans (left, top) { + return 'translate(' + left + ', ' + top + ')'; + } + + var defaults = { + size: 40, + thickness: 8, + color: '#1f77b4', + baseColor: '#e6e6e6' + }; + + $.fn.pieChart = function () { + $(this).each(function () { + var data = [ + $(this).data('value'), + $(this).data('max') - $(this).data('value') + ], + options = _.defaults($(this).data(), defaults), + radius = options.size / 2; + + var container = d3.select(this), + svg = container.append('svg') + .attr('width', options.size) + .attr('height', options.size), + plot = svg.append('g') + .attr('transform', trans(radius, radius)), + arc = d3.svg.arc() + .innerRadius(radius - options.thickness) + .outerRadius(radius), + pie = d3.layout.pie() + .sort(null) + .value(function (d) { + return d; + }), + colors = function (i) { + return i === 0 ? options.color : options.baseColor; + }, + sectors = plot.selectAll('path') + .data(pie(data)); + + sectors.enter() + .append('path') + .style('fill', function (d, i) { + return colors(i); + }) + .attr('d', arc); + }); + }; + +})(window.jQuery); diff --git a/server/sonar-web/src/main/js/source-viewer/app.js b/server/sonar-web/src/main/js/source-viewer/app.js new file mode 100644 index 00000000000..44cd085f914 --- /dev/null +++ b/server/sonar-web/src/main/js/source-viewer/app.js @@ -0,0 +1,53 @@ +requirejs.config({ + baseUrl: baseUrl + '/js', + paths: { + 'backbone': 'third-party/backbone', + 'backbone.marionette': 'third-party/backbone.marionette', + 'handlebars': 'third-party/handlebars' + }, + shim: { + 'backbone.marionette': { + deps: ['backbone'], + exports: 'Marionette' + }, + 'backbone': { + exports: 'Backbone' + }, + 'handlebars': { + exports: 'Handlebars' + } + } +}); + +requirejs([ + 'backbone.marionette', + 'source-viewer/viewer' + +], function (Marionette, SourceViewer) { + + var App = new Marionette.Application(); + + App.addRegions({ + viewerRegion: '#source-viewer' + }); + + App.addInitializer(function () { + var viewer = new SourceViewer(); + App.viewerRegion.show(viewer); + viewer.open(window.file.uuid, window.file.key); + if (typeof window.file.line === 'number') { + viewer.on('loaded', function () { + viewer + .highlightLine(window.file.line) + .scrollToLine(window.file.line); + }); + } + }); + + var l10nXHR = window.requestMessages(); + + l10nXHR.done(function () { + App.start(); + }); + +}); diff --git a/server/sonar-web/src/main/js/source-viewer/header.js b/server/sonar-web/src/main/js/source-viewer/header.js new file mode 100644 index 00000000000..8c6a29d1a9b --- /dev/null +++ b/server/sonar-web/src/main/js/source-viewer/header.js @@ -0,0 +1,73 @@ +define([ + 'backbone.marionette', + 'templates/source-viewer', + 'source-viewer/more-actions', + 'source-viewer/measures-overlay' +], function (Marionette, Templates, MoreActionsView, MeasuresOverlay) { + + var $ = jQuery, + API_FAVORITE = baseUrl + '/api/favourites'; + + return Marionette.ItemView.extend({ + template: Templates['source-viewer-header'], + + events: function () { + return { + 'click .js-favorite': 'toggleFavorite', + 'click .js-actions': 'showMoreActions', + 'click .js-permalink': 'getPermalink' + }; + }, + + toggleFavorite: function () { + var that = this; + if (this.model.get('fav')) { + $.ajax({ + url: API_FAVORITE + '/' + this.model.get('key'), + type: 'DELETE' + }).done(function () { + that.model.set('fav', false); + that.render(); + }); + } + else { + $.ajax({ + url: API_FAVORITE, + type: 'POST', + data: { + key: this.model.get('key') + } + }).done(function () { + that.model.set('fav', true); + that.render(); + }); + } + }, + + showMoreActions: function (e) { + e.stopPropagation(); + $('body').click() + var view = new MoreActionsView({ parent: this }); + view.render().$el.appendTo(this.$el); + }, + + getPermalink: function () { + //TODO Line permalink + var query = 'id=' + encodeURIComponent(this.model.get('key')), + windowParams = 'resizable=1,scrollbars=1,status=1'; + window.open(baseUrl + '/component/index?' + query, this.model.get('name'), windowParams); + }, + + showRawSources: function () { + var url = baseUrl + '/api/sources/raw?key=' + encodeURIComponent(this.model.get('key')), + windowParams = 'resizable=1,scrollbars=1,status=1'; + window.open(url, this.model.get('name'), windowParams); + }, + + showMeasures: function () { + var overlay = new MeasuresOverlay({ model: this.model }); + overlay.show(); + } + }); + +}); diff --git a/server/sonar-web/src/main/js/source-viewer/measures-overlay.js b/server/sonar-web/src/main/js/source-viewer/measures-overlay.js new file mode 100644 index 00000000000..c29c832b0c1 --- /dev/null +++ b/server/sonar-web/src/main/js/source-viewer/measures-overlay.js @@ -0,0 +1,190 @@ +define([ + 'common/overlay', + 'templates/source-viewer' +], function (Overlay, Templates) { + + var $ = jQuery, + SOURCE_METRIC_LIST = [ + 'accessors', + 'classes', + 'functions', + 'statements', + 'ncloc', + 'lines', + 'generated_ncloc', + 'generated_lines', + 'complexity', + 'function_complexity', + 'comment_lines', + 'comment_lines_density', + 'public_api', + 'public_undocumented_api', + 'public_documented_api_density' + ], + COVERAGE_METRIC_LIST = [ + 'coverage', + 'line_coverage', + 'lines_to_cover', + 'uncovered_lines', + 'branch_coverage', + 'conditions_to_cover', + 'uncovered_conditions', + 'it_coverage', + 'it_line_coverage', + 'it_lines_to_cover', + 'it_uncovered_lines', + 'it_branch_coverage', + 'it_conditions_to_cover', + 'it_uncovered_conditions', + 'overall_coverage', + 'overall_line_coverage', + 'overall_lines_to_cover', + 'overall_uncovered_lines', + 'overall_branch_coverage', + 'overall_conditions_to_cover', + 'overall_uncovered_conditions' + ], + ISSUES_METRIC_LIST = [ + 'violations', + 'sqale_index', + 'sqale_debt_ratio', + 'sqale_rating', + 'blocker_violations', + 'critical_violations', + 'major_violations', + 'minor_violations', + 'info_violations' + ], + DUPLICATIONS_METRIC_LIST = [ + 'duplicated_lines_density', + 'duplicated_blocks', + 'duplicated_lines' + ], + + TESTS_METRIC_LIST = [ + 'tests', + 'test_success_density', + 'test_failures', + 'test_errors', + 'skipped_tests', + 'test_execution_time' + ]; + + + return Overlay.extend({ + template: Templates['source-viewer-measures'], + + events: function () { + return _.extend(Overlay.prototype.events.apply(this, arguments), { + 'click .js-sort-tests-by-duration': 'sortTestsByDuration', + 'click .js-sort-tests-by-name': 'sortTestsByName', + 'click .js-sort-tests-by-status': 'sortTestsByStatus', + 'click .js-show-test': 'showTest' + }); + }, + + onRender: function () { + Overlay.prototype.onRender.apply(this, arguments); + this.$('.js-pie-chart').pieChart(); + }, + + show: function () { + var that = this, + requests = [this.requestMeasures()]; + if (this.model.get('isUnitTest')) { + requests.push(this.requestTests()); + } + $.when.apply($, requests).done(function () { + that.render(); + }); + }, + + requestMeasures: function () { + var that = this, + p = window.process.addBackgroundProcess(), + url = baseUrl + '/api/resources', + options = { + resource: this.model.key(), + metrics: [].concat( + SOURCE_METRIC_LIST, + COVERAGE_METRIC_LIST, + ISSUES_METRIC_LIST, + DUPLICATIONS_METRIC_LIST, + TESTS_METRIC_LIST + ).join() + }; + return $.get(url, options).done(function (data) { + var measuresList = data[0].msr || [], + measures = that.model.get('measures') || {}; + measuresList.forEach(function (m) { + measures[m.key] = m.frmt_val || m.data; + measures[m.key + '_raw'] = m.val; + }); + that.model.set({ measures: measures }); + window.process.finishBackgroundProcess(p); + }).fail(function () { + window.process.failBackgroundProcess(p); + }); + }, + + requestTests: function () { + var that = this, + url = baseUrl + '/api/tests/show', + options = { key: this.model.key() }; + return $.get(url, options).done(function (data) { + that.model.set({ tests: data.tests }); + that.sortTests('name'); + that.testSorting = 'name'; + }); + }, + + sortTests: function (condition) { + var tests = this.model.get('tests'); + if (_.isArray(tests)) { + this.model.set({ tests: _.sortBy(tests, condition) }); + } + }, + + sortTestsByDuration: function () { + this.sortTests('durationInMs'); + this.testSorting = 'duration'; + this.render(); + }, + + sortTestsByName: function () { + this.sortTests('name'); + this.testSorting = 'name'; + this.render(); + }, + + sortTestsByStatus: function () { + this.sortTests('status'); + this.testSorting = 'status'; + this.render(); + }, + + showTest: function (e) { + var that = this, + name = $(e.currentTarget).data('name'), + url = baseUrl + '/api/tests/covered_files', + options = { + key: this.model.key(), + test: name + }; + return $.get(url, options).done(function (data) { + that.coveredFiles = data.files; + that.selectedTest = _.findWhere(that.model.get('tests'), { name: name }); + that.render(); + }); + }, + + serializeData: function () { + return _.extend(Overlay.prototype.serializeData.apply(this, arguments), { + testSorting: this.testSorting, + selectedTest: this.selectedTest, + coveredFiles: this.coveredFiles || [] + }); + } + }); + +}); diff --git a/server/sonar-web/src/main/js/source-viewer/more-actions.js b/server/sonar-web/src/main/js/source-viewer/more-actions.js new file mode 100644 index 00000000000..b21bfb4c8c8 --- /dev/null +++ b/server/sonar-web/src/main/js/source-viewer/more-actions.js @@ -0,0 +1,39 @@ +define([ + 'backbone.marionette', + 'templates/source-viewer' +], function (Marionette, Templates) { + + var $ = jQuery; + + return Marionette.ItemView.extend({ + className: 'source-viewer-header-more-actions', + template: Templates['source-viewer-more-actions'], + + events: { + 'click .js-measures': 'showMeasures', + 'click .js-new-window': 'openNewWindow', + 'click .js-raw-source': 'showRawSource' + }, + + onRender: function () { + var that = this; + $('body').on('click.component-viewer-more-actions', function () { + $('body').off('click.component-viewer-more-actions'); + that.close(); + }); + }, + + showMeasures: function () { + this.options.parent.showMeasures(); + }, + + openNewWindow: function () { + this.options.parent.getPermalink(); + }, + + showRawSource: function () { + this.options.parent.showRawSources(); + } + }); + +}); diff --git a/server/sonar-web/src/main/js/source-viewer/popups/line-actions-popup.js b/server/sonar-web/src/main/js/source-viewer/popups/line-actions-popup.js index 3931272bc73..1a202329ae3 100644 --- a/server/sonar-web/src/main/js/source-viewer/popups/line-actions-popup.js +++ b/server/sonar-web/src/main/js/source-viewer/popups/line-actions-popup.js @@ -15,7 +15,7 @@ define([ getPermalink: function (e) { e.preventDefault(); - var url = baseUrl + '/component/index#component=' + + var url = baseUrl + '/component/index?id=' + (encodeURIComponent(this.model.key())) + '&line=' + this.options.line, windowParams = 'resizable=1,scrollbars=1,status=1'; window.open(url, this.model.get('name'), windowParams); diff --git a/server/sonar-web/src/main/js/source-viewer/viewer.js b/server/sonar-web/src/main/js/source-viewer/viewer.js index 7891f113545..78cee50f8a3 100644 --- a/server/sonar-web/src/main/js/source-viewer/viewer.js +++ b/server/sonar-web/src/main/js/source-viewer/viewer.js @@ -6,10 +6,12 @@ define([ 'issue/models/issue', 'issue/collections/issues', 'issue/issue-view', + 'source-viewer/header', 'source-viewer/popups/scm-popup', 'source-viewer/popups/coverage-popup', 'source-viewer/popups/duplication-popup', - 'source-viewer/popups/line-actions-popup' + 'source-viewer/popups/line-actions-popup', + 'common/handlebars-extensions' ], function (Backbone, Marionette, @@ -18,6 +20,7 @@ define([ Issue, Issues, IssueView, + HeaderView, SCMPopupView, CoveragePopupView, DuplicationPopupView, @@ -26,14 +29,18 @@ define([ var $ = jQuery, HIGHLIGHTED_ROW_CLASS = 'source-line-highlighted'; - return Marionette.ItemView.extend({ - className: 'source', + return Marionette.Layout.extend({ + className: 'source-viewer', template: Templates['source-viewer'], ISSUES_LIMIT: 100, LINES_LIMIT: 1000, LINES_AROUND: 500, + regions: { + headerRegion: '.source-viewer-header' + }, + ui: { sourceBeforeSpinner: '.js-component-viewer-source-before', sourceAfterSpinner: '.js-component-viewer-source-after' @@ -41,13 +48,14 @@ define([ events: function () { return { + 'click .sym': 'highlightUsages', 'click .source-line-scm': 'showSCMPopup', 'click .source-line-covered': 'showCoveragePopup', 'click .source-line-partially-covered': 'showCoveragePopup', 'click .source-line-uncovered': 'showCoveragePopup', 'click .source-line-duplications': 'showDuplications', 'click .source-line-duplications-extra': 'showDuplicationPopup', - 'click .source-line-number[data-line-number]': 'highlightLine' + 'click .source-line-number[data-line-number]': 'onLineNumberClick' }; }, @@ -60,10 +68,19 @@ define([ this.loadSourceBeforeThrottled = _.throttle(this.loadSourceBefore, 1000); this.loadSourceAfterThrottled = _.throttle(this.loadSourceAfter, 1000); this.scrollTimer = null; + this.listenTo(this, 'loaded', this.onLoaded); + }, + + renderHeader: function () { + this.headerRegion.show(new HeaderView({ model: this.model })); }, onRender: function () { + this.renderHeader(); this.renderIssues(); + if (this.model.has('filterLinesFunc')) { + this.filterLines(this.model.get('filterLinesFunc')); + } }, onClose: function () { @@ -73,6 +90,10 @@ define([ this.issueViews = []; }, + onLoaded: function () { + this.bindScrollEvents(); + }, + open: function (id, key) { var that = this, finalize = function () { @@ -105,6 +126,7 @@ define([ options = { key: this.model.key() }; return $.get(url, options).done(function (data) { that.model.set(data); + that.model.set({ isUnitTest: data.q === 'UTS' }); }); }, @@ -228,29 +250,26 @@ define([ }, renderIssues: function () { - this.issues.forEach(this.renderIssue, this); + this.$('.issue-list').addClass('hidden'); }, renderIssue: function (issue) { - var issueView = new IssueView({ - el: '#issue-' + issue.get('key'), - model: issue - }); - this.issueViews.push(issueView); - issueView.render(); + // do nothing }, addIssue: function (issue) { var line = issue.get('line') || 0, - code = this.$('.source-line-code[data-line-number=' + line + ']'), - issueList = code.find('.issue-list'); - if (issueList.length === 0) { - issueList = $('
'); - code.append(issueList); - code.addClass('has-issues'); + code = this.$('.source-line-code[data-line-number=' + line + ']'); + code.addClass('has-issues'); + }, + + highlightUsages: function (e) { + var highlighted = $(e.currentTarget).is('.highlighted'), + key = e.currentTarget.className.split(/\s+/)[0]; + this.$('.sym.highlighted').removeClass('highlighted'); + if (!highlighted) { + this.$('.sym.' + key).addClass('highlighted'); } - issueList.append('
'); - this.renderIssue(issue); }, showSCMPopup: function (e) { @@ -331,16 +350,29 @@ define([ popup.render(); }, - highlightLine: function (e) { + onLineNumberClick: function (e) { var row = $(e.currentTarget).closest('.source-line'), + line = row.data('line-number'), highlighted = row.is('.' + HIGHLIGHTED_ROW_CLASS); - this.$('.' + HIGHLIGHTED_ROW_CLASS).removeClass(HIGHLIGHTED_ROW_CLASS); if (!highlighted) { - row.addClass(HIGHLIGHTED_ROW_CLASS); + this.highlightLine(line); this.showLineActionsPopup(e); + } else { + this.removeHighlighting(); } }, + removeHighlighting: function () { + this.$('.' + HIGHLIGHTED_ROW_CLASS).removeClass(HIGHLIGHTED_ROW_CLASS); + }, + + highlightLine: function (line) { + var row = this.$('.source-line[data-line-number=' + line + ']'); + this.removeHighlighting(); + row.addClass(HIGHLIGHTED_ROW_CLASS); + return this; + }, + bindScrollEvents: function () { var that = this; this.$el.scrollParent().on('scroll.source-viewer', function () { @@ -376,6 +408,21 @@ define([ } }, + scrollToLine: function (line) { + var row = this.$('.source-line[data-line-number=' + line + ']'); + if (row.length > 0) { + var p = this.$el.scrollParent(); + if (p.is(document)) { + p = $(window); + } + var pTopOffset = p.offset() != null ? p.offset().top : 0, + pHeight = p.height(), + goal = row.offset().top - pHeight / 3 - pTopOffset; + p.scrollTop(goal); + } + return this; + }, + loadSourceBefore: function () { this.unbindScrollEvents(); var that = this, @@ -442,6 +489,30 @@ define([ that.bindScrollEvents(); } }); + }, + + filterLines: function (func) { + var lines = this.model.get('source'), + $lines = this.$('.source-line'); + this.model.set('filterLinesFunc', func); + lines.forEach(function (line, idx) { + var $line = $($lines[idx]); + $line.toggleClass('source-line-shadowed', !func(line)); + }); + }, + + filterLinesByPeriod: function (periodId) { + var periods = this.model.get('periods'), + period = _.find(periods, function (candidate) { + return candidate[0] === periodId; + }); + if (period) { + var sinceDate = moment(period[2]).toDate(); + this.filterLines(function (line) { + var scmDate = moment(line.scmDate).toDate(); + return scmDate >= sinceDate; + }); + } } }); diff --git a/server/sonar-web/src/main/js/tests/e2e/lib.js b/server/sonar-web/src/main/js/tests/e2e/lib.js index 0b23b65f842..2f992c14f88 100644 --- a/server/sonar-web/src/main/js/tests/e2e/lib.js +++ b/server/sonar-web/src/main/js/tests/e2e/lib.js @@ -12,19 +12,15 @@ var BASE_URL = 'http://localhost:' + getPort() + '/pages/', exports.initMessages = function () { // Dump log messages casper.removeAllListeners('remote.message'); - if (casper.cli.get('verbose')) { - casper.on('remote.message', function(message) { - this.echo('Log: '+ message, 'LOG'); - }); - } + casper.on('remote.message', function(message) { + this.echo('Log: '+ message, 'LOG'); + }); // Dump uncaught errors casper.removeAllListeners('page.error'); - if (casper.verbose) { - casper.on('page.error', function(msg) { - this.echo('Error: ' + msg, 'ERROR'); - }); - } + casper.on('page.error', function(msg) { + this.echo('Error: ' + msg, 'ERROR'); + }); }; @@ -61,7 +57,6 @@ exports.mockRequest = mockRequest; exports.mockRequestFromFile = function (url, fileName, options) { - console.log('mock request "' + url + '" from file "' + fs.workingDirectory + fs.separator + fileName + '"'); var response = fs.read(fileName); return mockRequest(url, response, options); }; diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-coverage-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-coverage-spec.js deleted file mode 100644 index bac92d8b5d1..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-coverage-spec.js +++ /dev/null @@ -1,116 +0,0 @@ -var lib = require('../lib'), - testName = lib.testName('Component Viewer'); - -lib.initMessages(); -lib.changeWorkingDirectory('component-viewer-spec'); - - -casper.test.begin(testName('Coverage Filters'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/coverage/show', 'coverage.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.click('.js-header-tab-coverage'); - casper.waitForSelector('.js-filter-lines-to-cover'); - }) - - .then(function () { - casper.click('.js-filter-lines-to-cover'); - casper.waitForSelector('.source-line-covered', function () { - test.assertElementCount('.source-line-covered', 142); - test.assertElementCount('.source-line-uncovered', 50); - test.assertElementCount('.source-line-partially-covered', 2); - test.assertElementCount('.component-viewer-source .source-line', 369); - }); - }) - - .then(function () { - casper.click('.js-filter-uncovered-lines'); - casper.waitForSelector('.source-line-covered', function () { - test.assertElementCount('.source-line-covered', 18); - test.assertElementCount('.source-line-uncovered', 50); - test.assertElementCount('.source-line-partially-covered', 0); - test.assertElementCount('.component-viewer-source .source-line', 136); - }); - }) - - .then(function () { - casper.click('.js-filter-branches-to-cover'); - casper.waitForSelector('.source-line-covered', function () { - test.assertElementCount('.source-line-covered', 19); - test.assertElementCount('.source-line-uncovered', 3); - test.assertElementCount('.source-line-partially-covered', 2); - test.assertElementCount('.component-viewer-source .source-line', 33); - }); - }) - - .then(function () { - casper.click('.js-filter-uncovered-branches'); - casper.waitForSelector('.source-line-covered', function () { - test.assertElementCount('.source-line-covered', 4); - test.assertElementCount('.source-line-uncovered', 3); - test.assertElementCount('.source-line-partially-covered', 2); - test.assertElementCount('.component-viewer-source .source-line', 13); - }); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('Go From Coverage to Test File'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/coverage/show', 'coverage.json'); - lib.mockRequestFromFile('/api/tests/test_cases', 'test-cases.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.click('.js-toggle-coverage'); - casper.waitForSelector('.source-line-covered', function () { - casper.click('.source-line-covered'); - casper.waitForSelector('.bubble-popup', function () { - test.assertSelectorContains('.bubble-popup', 'src/test/java/org/sonar/batch/issue/IssueCacheTest.java'); - test.assertSelectorContains('.bubble-popup', 'should_update_existing_issue'); - test.assertSelectorContains('.bubble-popup li[title="should_update_existing_issue"]', '293'); - - lib.clearRequestMocks(); - lib.mockRequestFromFile('/api/components/app', 'tests/app.json'); - lib.mockRequestFromFile('/api/sources/show', 'tests/source.json'); - lib.mockRequestFromFile('/api/resources', 'tests/resources.json'); - lib.mockRequest('/api/coverage/show', '{}'); - lib.mockRequestFromFile('/api/tests/show', 'tests/tests.json'); - casper.click('.component-viewer-popup-test-file[data-key]'); - - casper.waitForSelector('.js-unit-test', function () { - test.assertElementCount('.js-unit-test', 2); - }); - }); - }); - }) - - .run(function () { - test.done(); - }); -}); diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-duplications-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-duplications-spec.js deleted file mode 100644 index fbce585badd..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-duplications-spec.js +++ /dev/null @@ -1,109 +0,0 @@ -var lib = require('../lib'), - testName = lib.testName('Component Viewer', 'Duplications'); - -lib.initMessages(); -lib.changeWorkingDirectory('component-viewer-spec'); - - -casper.test.begin(testName('Filters'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/duplications/show', 'duplications.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.click('.js-header-tab-duplications'); - casper.waitForSelector('.source-line-duplicated', function () { - test.assertExists('.js-filter-duplications.active'); - test.assertElementCount('.component-viewer-source .source-line', 39); - }); - }) - - .then(function () { - casper.click('.js-filter-duplications'); - test.assertElementCount('.component-viewer-source .source-line', 520); - }) - - .run(function () { - test.done(); - }); -}); - - - - -casper.test.begin(testName('Cross-Project'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/duplications/show', 'cross-project-duplications.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.click('.js-header-tab-duplications'); - casper.waitForSelector('.js-filter-duplications', function () { - casper.click('.js-filter-duplications'); - casper.waitForSelector('.source-line-duplicated', function () { - casper.click('.source-line-duplicated'); - casper.waitForSelector('.bubble-popup', function () { - test.assertSelectorContains('.bubble-popup', 'JavaScript'); - test.assertSelectorContains('.bubble-popup', 'JavaScript :: Sonar Plugin'); - test.assertExists('a[data-key="org.codehaus.sonar-plugins.javascript:sonar-javascript-plugin:src/main/java/org/sonar/plugins/javascript/core/JavaScript.java"]'); - test.assertSelectorContains('.bubble-popup', 'src/main/java/org/sonar/plugins/javascript/core/JavaScript.java'); - test.assertSelectorContains('.bubble-popup', '455'); // Line from - test.assertSelectorContains('.bubble-popup', '470'); // Line to - }); - }); - }); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('In Deleted Files'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/duplications/show', 'duplications-in-deleted-files.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.click('.js-toggle-duplications'); - casper.waitForSelector('.source-line-duplicated', function () { - test.assertExists('.js-duplications-in-deleted-files'); - }); - }) - - .run(function () { - test.done(); - }); -}); - diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-issues-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-issues-spec.js deleted file mode 100644 index 3ea8cb5d1cd..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-issues-spec.js +++ /dev/null @@ -1,170 +0,0 @@ -var lib = require('../lib'), - testName = lib.testName('Component Viewer', 'Issues'); - -lib.initMessages(); -lib.changeWorkingDirectory('component-viewer-spec'); - - -casper.test.begin(testName('Filters'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/issues/search', 'issues.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.click('.js-header-tab-issues'); - casper.waitForSelector('.js-filter-unresolved-issues'); - }) - - .then(function () { - casper.click('.js-filter-unresolved-issues'); - casper.waitForSelector('.issue', function () { - test.assertElementCount('.issue', 6); - }); - }) - - .then(function () { - casper.click('.js-filter-open-issues'); - casper.waitForSelector('.issue', function () { - test.assertElementCount('.issue', 1); - }); - }) - - .then(function () { - casper.click('.js-filter-fixed-issues'); - casper.waitForSelector('.issue', function () { - test.assertElementCount('.issue', 11); - }); - }) - - .then(function () { - casper.click('.js-filter-false-positive-issues'); - casper.waitForSelector('.issue', function () { - test.assertElementCount('.issue', 1); - }); - }) - - .then(function () { - casper.click('.js-filter-MAJOR-issues'); - casper.waitForSelector('.issue', function () { - test.assertElementCount('.issue', 1); - }); - }) - - .then(function () { - casper.click('.js-filter-MINOR-issues'); - casper.waitForSelector('.issue', function () { - test.assertElementCount('.issue', 1); - }); - }) - - .then(function () { - casper.click('.js-filter-INFO-issues'); - casper.waitForSelector('.issue', function () { - test.assertElementCount('.issue', 4); - }); - }) - - .then(function () { - casper.click('.js-filter-rule[data-rule="common-java:DuplicatedBlocks"]'); - casper.waitForSelector('.issue', function () { - test.assertElementCount('.issue', 1); - test.assertSelectorContains('.issue', '2 duplicated blocks of code.'); - }); - }) - - .then(function () { - casper.click('.js-filter-rule[data-rule="squid:S1192"]'); - casper.waitForSelector('.issue', function () { - test.assertElementCount('.issue', 1); - test.assertSelectorContains('.issue', 'Define a constant instead of duplicating this literal'); - }); - }) - - .then(function () { - casper.click('.js-filter-rule[data-rule="squid:S1135"]'); - casper.waitForSelector('.issue', function () { - test.assertElementCount('.issue', 4); - test.assertSelectorContains('.issue', 'Complete the task associated to this TODO comment'); - }); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('On File Level'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/issues/search', 'issues.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.click('.js-header-tab-issues'); - casper.waitForSelector('.js-filter-unresolved-issues'); - }) - - .then(function () { - casper.click('.js-filter-unresolved-issues'); - casper.waitForSelector('.issue'); - }) - - .then(function () { - test.assertVisible('.component-viewer-source .source-line[data-line-number="0"]'); - test.assertExists('#issue-20002ec7-b647-44da-bdf5-4d9fbf4b7c58'); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('Bulk Change Link Exists'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/issues/search', 'issues.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.click('.js-header-tab-issues'); - casper.waitForSelector('.js-filter-unresolved-issues'); - }) - - .then(function () { - test.assertExists('.js-issues-bulk-change'); - }) - - .run(function () { - test.done(); - }); -}); diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-lines-filters-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-lines-filters-spec.js deleted file mode 100644 index 92b0e485907..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-lines-filters-spec.js +++ /dev/null @@ -1,69 +0,0 @@ -var lib = require('../lib'), - testName = lib.testName('Component Viewer'); - -lib.initMessages(); -lib.changeWorkingDirectory('component-viewer-spec'); - - -casper.test.begin(testName('Lines Filters'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.click('.js-header-tab-basic'); - casper.waitForSelector('.js-filter-ncloc'); - }) - - .then(function () { - casper.click('.js-filter-ncloc'); - test.assertElementCount('.component-viewer-source .source-line', 451); - }) - - .then(function () { - casper.click('.js-filter-ncloc'); - test.assertElementCount('.component-viewer-source .source-line', 520); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('Do Not Show Ncloc Filter If No Data'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources-without-ncloc-data.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.click('.js-header-tab-basic'); - casper.waitForSelector('[data-metric="ncloc"]'); - }) - - .then(function () { - test.assertDoesntExist('.js-filter-ncloc'); - }) - - .run(function () { - test.done(); - }); -}); diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-link-to-raw-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-link-to-raw-spec.js deleted file mode 100644 index 019cdca2879..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-link-to-raw-spec.js +++ /dev/null @@ -1,37 +0,0 @@ -var lib = require('../lib'), - testName = lib.testName('Component Viewer'); - -lib.initMessages(); -lib.changeWorkingDirectory('component-viewer-spec'); - - -casper.test.begin(testName('Link to Raw'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.waitForSelector('.js-actions', function () { - casper.click('.js-actions'); - casper.waitForSelector('.js-raw-source', function () { - casper.click('.js-raw-source'); - }); - }); - }) - - .then(function () { - test.assertUrlMatch('org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java'); - }) - - .run(function () { - test.done(); - }); -}); diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-select-tab-by-metric-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-select-tab-by-metric-spec.js deleted file mode 100644 index f47a365a41e..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-select-tab-by-metric-spec.js +++ /dev/null @@ -1,141 +0,0 @@ -var lib = require('../lib'), - testName = lib.testName('Component Viewer', 'Select Tab by Metric'); - -lib.initMessages(); -lib.changeWorkingDirectory('component-viewer-spec'); - - -casper.test.begin(testName('sqale_index'), function (test) { - casper - .start(lib.buildUrl('file-dashboard'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/issues/search', 'issues.json'); - casper.evaluate(function () { - window.fileKey = 'some-key'; - window.metric = 'sqale_index'; - }); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.waitForSelector('.issue', function () { - test.assertExists('.js-toggle-issues.active'); - test.assertExists('.component-viewer-header-expanded-bar.active'); - test.assertExists('.js-filter-unresolved-issues.active'); - test.assertElementCount('.component-viewer-source .source-line', 56); - }); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('minor_violations'), function (test) { - casper - .start(lib.buildUrl('file-dashboard'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/issues/search', 'issues.json'); - casper.evaluate(function () { - window.fileKey = 'some-key'; - window.metric = 'minor_violations'; - }); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.waitForSelector('.issue', function () { - test.assertExists('.js-toggle-issues.active'); - test.assertExists('.component-viewer-header-expanded-bar.active'); - test.assertExists('.js-filter-MINOR-issues.active'); - test.assertElementCount('.component-viewer-source .source-line', 11); - }); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('line_coverage'), function (test) { - casper - .start(lib.buildUrl('file-dashboard'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/coverage/show', 'coverage.json'); - casper.evaluate(function () { - window.fileKey = 'some-key'; - window.metric = 'line_coverage'; - }); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.waitForSelector('.source-line-covered', function () { - test.assertExists('.js-toggle-coverage.active'); - test.assertExists('.component-viewer-header-expanded-bar.active'); - test.assertExists('.js-filter-lines-to-cover.active'); - test.assertElementCount('.component-viewer-source .source-line', 369); - }); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('duplicated_lines'), function (test) { - casper - .start(lib.buildUrl('file-dashboard'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/duplications/show', 'duplications.json'); - casper.evaluate(function () { - window.fileKey = 'some-key'; - window.metric = 'duplicated_lines'; - }); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.waitForSelector('.source-line-duplicated', function () { - test.assertExists('.js-toggle-duplications.active'); - test.assertExists('.component-viewer-header-expanded-bar.active'); - test.assertExists('.js-filter-duplications.active'); - test.assertElementCount('.component-viewer-source .source-line', 39); - }); - }) - - .run(function () { - test.done(); - }); -}); diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec.js deleted file mode 100644 index 8aee5a10dce..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec.js +++ /dev/null @@ -1,459 +0,0 @@ -var lib = require('../lib'), - testName = lib.testName('Component Viewer'); - -lib.initMessages(); -lib.changeWorkingDirectory('component-viewer-spec'); - - -casper.test.begin(testName('Base'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line', function () { - // Check header elements - test.assertExists('.component-viewer-header'); - test.assertSelectorContains('.component-viewer-header-component-project', 'SonarQube'); - test.assertSelectorContains('.component-viewer-header-component-project', 'SonarQube :: Batch'); - test.assertSelectorContains('.component-viewer-header-component-name', - 'src/main/java/org/sonar/batch/index/Cache.java'); - test.assertExists('.component-viewer-header-favorite'); - test.assertExists('.component-viewer-header-actions'); - - // Check main measures - test.assertSelectorContains('.js-header-tab-basic', '379'); - test.assertSelectorContains('.js-header-tab-issues', 'A'); - test.assertSelectorContains('.js-header-tab-issues', '3h 30min'); - test.assertSelectorContains('.js-header-tab-issues', '6'); - test.assertSelectorContains('.js-header-tab-coverage', '74.3%'); - test.assertExists('.js-header-tab-scm'); - - // Check source - test.assertElementCount('.component-viewer-source .source-line', 520); - test.assertSelectorContains('.component-viewer-source', 'public class Cache'); - - // Check workspace - test.assertExists('.component-viewer-workspace'); - }); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('Decoration'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/issues/search', 'issues.json'); - lib.mockRequestFromFile('/api/coverage/show', 'coverage.json'); - lib.mockRequestFromFile('/api/duplications/show', 'duplications.json'); - lib.mockRequestFromFile('/api/sources/scm', 'scm.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - // Check issues decoration - casper.click('.js-toggle-issues'); - casper.waitForSelector('.issue', function () { - test.assertElementCount('.issue', 6); - test.assertSelectorContains('.issue', '2 duplicated blocks of code.'); - - casper.click('.js-toggle-issues'); - casper.waitWhileSelector('.issue', function () { - test.assertDoesntExist('.issue'); - }); - }); - }) - - .then(function () { - // Check coverage decoration - casper.click('.js-toggle-coverage'); - casper.waitForSelector('.source-line-covered', function () { - test.assertElementCount('.source-line-covered', 142); - test.assertElementCount('.source-line-uncovered', 50); - test.assertElementCount('.source-line-partially-covered', 2); - - casper.click('.js-toggle-coverage'); - casper.waitWhileSelector('.source-line-covered', function () { - test.assertDoesntExist('.source-line-covered'); - }); - }); - }) - - .then(function () { - // Check duplications decoration - casper.click('.js-toggle-duplications'); - casper.waitForSelector('.source-line-duplicated', function () { - test.assertElementCount('.source-line-duplicated', 32); - - casper.click('.js-toggle-duplications'); - casper.waitWhileSelector('.source-line-duplicated', function () { - test.assertDoesntExist('.source-line-duplicated'); - }); - }); - }) - - .then(function () { - // Check scm decoration - casper.click('.js-toggle-scm'); - casper.waitForSelector('.source-line-scm-inner', function () { - test.assertElementCount('.source-line-scm-inner', 182); - test.assertExists('.source-line-scm-inner[data-author="simon.brandhof@gmail.com"]'); - test.assertExists('.source-line-scm-inner[data-author="julien.henry@sonarsource.com"]'); - - casper.click('.js-toggle-scm'); - casper.waitWhileSelector('.source-line-scm-inner', function () { - test.assertDoesntExist('.source-line-scm-inner'); - }); - }); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('Header'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/issues/search', 'issues.json'); - lib.mockRequestFromFile('/api/coverage/show', 'coverage.json'); - lib.mockRequestFromFile('/api/duplications/show', 'duplications.json'); - lib.mockRequestFromFile('/api/sources/scm', 'scm.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - // Check issues header and filters - casper.click('.js-header-tab-issues'); - casper.waitForSelector('.js-filter-unresolved-issues', function () { - test.assertExists('.js-filter-open-issues'); - test.assertExists('.js-filter-fixed-issues'); - test.assertExists('.js-filter-false-positive-issues'); - test.assertSelectorContains('.js-filter-MAJOR-issues', '1'); - test.assertSelectorContains('.js-filter-MINOR-issues', '1'); - test.assertSelectorContains('.js-filter-INFO-issues', '4'); - test.assertSelectorContains('.js-filter-rule[data-rule="common-java:DuplicatedBlocks"]', '1'); - test.assertSelectorContains('.js-filter-rule[data-rule="squid:S1192"]', '1'); - test.assertSelectorContains('.js-filter-rule[data-rule="squid:S1135"]', '4'); - test.assertExists('.js-issues-time-changes'); - - casper.click('.js-header-tab-issues'); - casper.waitWhileSelector('.js-filter-unresolved-issues', function () { - test.assertDoesntExist('.js-filter-open-issues'); - test.assertDoesntExist('.js-filter-MAJOR-issues'); - test.assertDoesntExist('.js-filter-rule'); - }); - }); - }) - - .then(function () { - // Check coverage header and filters - casper.click('.js-header-tab-coverage'); - casper.waitForSelector('.js-filter-lines-to-cover', function () { - test.assertExists('.js-filter-uncovered-lines'); - test.assertExists('.js-filter-branches-to-cover'); - test.assertExists('.js-filter-uncovered-branches'); - test.assertSelectorContains('[data-metric="coverage"]', '74.3%'); - test.assertSelectorContains('[data-metric="line_coverage"]', '74.2%'); - test.assertSelectorContains('[data-metric="lines_to_cover"]', '194'); - test.assertSelectorContains('[data-metric="uncovered_lines"]', '50'); - test.assertSelectorContains('[data-metric="branch_coverage"]', '75.0%'); - test.assertSelectorContains('[data-metric="conditions_to_cover"]', '16'); - test.assertSelectorContains('[data-metric="uncovered_conditions"]', '4'); - test.assertExists('.js-coverage-time-changes'); - - casper.click('.js-header-tab-coverage'); - casper.waitWhileSelector('.js-filter-lines-to-cover', function () { - test.assertDoesntExist('.js-filter-uncovered-lines'); - test.assertDoesntExist('[data-metric="coverage"]'); - test.assertDoesntExist('[data-metric="branch_coverage"]'); - }); - }); - }) - - .then(function () { - // Check duplications header and filters - casper.click('.js-header-tab-duplications'); - casper.waitForSelector('.js-filter-duplications', function () { - test.assertSelectorContains('[data-metric="duplicated_blocks"]', '2'); - test.assertSelectorContains('[data-metric="duplicated_lines"]', '30'); - - casper.click('.js-header-tab-duplications'); - casper.waitWhileSelector('.js-filter-duplications', function () { - test.assertDoesntExist('[data-metric="duplicated_blocks"]'); - test.assertDoesntExist('[data-metric="duplicated_lines"]'); - }); - }); - }) - - .then(function () { - // Check scm header and filters - casper.click('.js-header-tab-scm'); - casper.waitForSelector('.js-filter-modified-lines', function () { - test.assertExists('.js-scm-time-changes'); - - casper.click('.js-header-tab-scm'); - casper.waitWhileSelector('.js-filter-modified-lines', function () { - test.assertDoesntExist('.js-scm-time-changes'); - }); - }); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('Test File'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'tests/app.json'); - lib.mockRequestFromFile('/api/sources/show', 'tests/source.json'); - lib.mockRequestFromFile('/api/resources', 'tests/resources.json'); - lib.mockRequestFromFile('/api/tests/show', 'tests/tests.json'); - lib.mockRequestFromFile('/api/tests/covered_files', 'tests/covered-files.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - // Check coverage header and filters - casper.click('.js-header-tab-tests'); - casper.waitForSelector('.js-unit-test', function () { - test.assertSelectorContains('[data-metric="test_execution_time"]', '12'); - test.assertElementCount('.js-unit-test', 2); - test.assertSelectorContains('.js-unit-test[data-name="should_return_i"]', 'should_return_i'); - test.assertSelectorContains('.js-unit-test[data-name="should_return_i"]', '5'); - test.assertSelectorContains('.js-unit-test[data-name="should_return_to_string"]', 'should_return_to_string'); - test.assertSelectorContains('.js-unit-test[data-name="should_return_to_string"]', '4'); - - casper.click('.js-unit-test[data-name="should_return_to_string"]'); - casper.waitForSelector('.bubble-popup', function () { - test.assertSelectorContains('.bubble-popup', 'Sample.java'); - test.assertSelectorContains('.bubble-popup', 'src/main/java/sample'); - }); - }); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('Go From Coverage to Test File'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/coverage/show', 'coverage.json'); - lib.mockRequestFromFile('/api/tests/test_cases', 'test-cases.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.click('.js-toggle-coverage'); - casper.waitForSelector('.source-line-covered', function () { - casper.click('.source-line-covered'); - casper.waitForSelector('.bubble-popup', function () { - test.assertSelectorContains('.bubble-popup', 'src/test/java/org/sonar/batch/issue/IssueCacheTest.java'); - test.assertSelectorContains('.bubble-popup', 'should_update_existing_issue'); - test.assertSelectorContains('.bubble-popup li[title="should_update_existing_issue"]', '293'); - - lib.clearRequestMocks(); - lib.mockRequestFromFile('/api/components/app', 'tests/app.json'); - lib.mockRequestFromFile('/api/sources/show', 'tests/source.json'); - lib.mockRequestFromFile('/api/resources', 'tests/resources.json'); - lib.mockRequest('/api/coverage/show', '{}'); - lib.mockRequestFromFile('/api/tests/show', 'tests/tests.json'); - casper.click('.component-viewer-popup-test-file[data-key]'); - - casper.waitForSelector('.js-unit-test', function () { - test.assertElementCount('.js-unit-test', 2); - }); - }); - }); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('Coverage Filters'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/coverage/show', 'coverage.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.click('.js-header-tab-coverage'); - casper.waitForSelector('.js-filter-lines-to-cover'); - }) - - .then(function () { - casper.click('.js-filter-lines-to-cover'); - casper.waitForSelector('.source-line-covered', function () { - test.assertElementCount('.source-line-covered', 142); - test.assertElementCount('.source-line-uncovered', 50); - test.assertElementCount('.source-line-partially-covered', 2); - test.assertElementCount('.component-viewer-source .source-line', 369); - }); - }) - - .then(function () { - casper.click('.js-filter-uncovered-lines'); - casper.waitForSelector('.source-line-covered', function () { - test.assertElementCount('.source-line-covered', 18); - test.assertElementCount('.source-line-uncovered', 50); - test.assertElementCount('.source-line-partially-covered', 0); - test.assertElementCount('.component-viewer-source .source-line', 136); - }); - }) - - .then(function () { - casper.click('.js-filter-branches-to-cover'); - casper.waitForSelector('.source-line-covered', function () { - test.assertElementCount('.source-line-covered', 19); - test.assertElementCount('.source-line-uncovered', 3); - test.assertElementCount('.source-line-partially-covered', 2); - test.assertElementCount('.component-viewer-source .source-line', 33); - }); - }) - - .then(function () { - casper.click('.js-filter-uncovered-branches'); - casper.waitForSelector('.source-line-covered', function () { - test.assertElementCount('.source-line-covered', 4); - test.assertElementCount('.source-line-uncovered', 3); - test.assertElementCount('.source-line-partially-covered', 2); - test.assertElementCount('.component-viewer-source .source-line', 13); - }); - }) - - .run(function () { - test.done(); - }); -}); - - -casper.test.begin(testName('Ability to Deselect Filters'), function (test) { - casper - .start(lib.buildUrl('component-viewer#component=component'), function () { - lib.setDefaultViewport(); - lib.mockRequest('/api/l10n/index', '{}'); - lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); - lib.mockRequestFromFile('/api/resources', 'resources.json'); - lib.mockRequestFromFile('/api/issues/search', 'issues.json'); - lib.mockRequestFromFile('/api/coverage/show', 'coverage.json'); - lib.mockRequestFromFile('/api/duplications/show', 'duplications.json'); - }) - - .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); - }) - - .then(function () { - casper.click('.js-header-tab-issues'); - var testFilter = '.js-filter-unresolved-issues'; - casper.waitForSelector(testFilter + '.active', function () { - lib.waitForElementCount('.component-viewer-source .source-line', 56, function () { - casper.click(testFilter); - lib.waitForElementCount('.component-viewer-source .source-line', 520, function () { - test.assertDoesntExist(testFilter + '.active'); - casper.click(testFilter); - lib.waitForElementCount('.component-viewer-source .source-line', 56, function () { - test.assertExists(testFilter + '.active'); - }); - }); - }) - }); - }) - - .then(function () { - casper.click('.js-header-tab-coverage'); - var testFilter = '.js-filter-lines-to-cover'; - casper.waitForSelector(testFilter + '.active', function () { - lib.waitForElementCount('.component-viewer-source .source-line', 369, function () { - casper.click(testFilter); - lib.waitForElementCount('.component-viewer-source .source-line', 520, function () { - test.assertDoesntExist(testFilter + '.active'); - casper.click(testFilter); - lib.waitForElementCount('.component-viewer-source .source-line', 369, function () { - test.assertExists(testFilter + '.active'); - }); - }); - }) - }); - }) - - .then(function () { - casper.click('.js-header-tab-duplications'); - var testFilter = '.js-filter-duplications'; - casper.waitForSelector(testFilter + '.active', function () { - lib.waitForElementCount('.component-viewer-source .source-line', 39, function () { - casper.click(testFilter); - lib.waitForElementCount('.component-viewer-source .source-line', 520, function () { - test.assertDoesntExist(testFilter + '.active'); - casper.click(testFilter); - lib.waitForElementCount('.component-viewer-source .source-line', 39, function () { - test.assertExists(testFilter + '.active'); - }); - }); - }) - }); - }) - - .run(function () { - test.done(); - }); -}); diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/issues.json b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/issues.json deleted file mode 100644 index bced9b3caab..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/issues.json +++ /dev/null @@ -1,646 +0,0 @@ -{"maxResultsReached": false, "paging": { - "pageIndex": 1, - "pageSize": 999999, - "total": 27, - "fTotal": "27", - "pages": 1 -}, "issues": [ - { - "key": "1c88fb97-4e89-4719-895d-fdf027cd9e6d", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck_1296413157", - "status": "CLOSED", - "resolution": "REMOVED", - "severity": "INFO", - "message": "Comment matches to-do format 'TODO'.", - "line": 153, - "author": "Simon Brandhof", - "creationDate": "2013-04-17T04:05:53+0200", - "updateDate": "2013-07-26T12:39:46+0200", - "fUpdateAge": "12 months", - "closeDate": "2013-07-26T12:39:46+0200" - }, - { - "key": "242b8049-33f5-4bb3-b9a8-ff86de5698d1", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1135", - "status": "CLOSED", - "resolution": "REMOVED", - "severity": "INFO", - "message": "Complete the task associated to this TODO comment.", - "line": 151, - "author": "Simon Brandhof", - "creationDate": "2013-07-26T14:28:10+0200", - "updateDate": "2013-08-03T00:02:13+0200", - "fUpdateAge": "11 months", - "closeDate": "2013-08-03T00:02:13+0200" - }, - { - "key": "9942b361-7127-4ee1-950c-bc67cdb21d19", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1135", - "status": "CLOSED", - "resolution": "REMOVED", - "severity": "INFO", - "message": "Complete the task associated to this TODO comment.", - "line": 151, - "author": "Simon Brandhof", - "creationDate": "2013-08-08T00:00:30+0200", - "updateDate": "2013-08-09T00:24:41+0200", - "fUpdateAge": "11 months", - "closeDate": "2013-08-09T00:24:41+0200" - }, - { - "key": "987a803e-2dc8-4552-a0ec-e59c7d6bba8e", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1166", - "status": "CLOSED", - "resolution": "REMOVED", - "severity": "CRITICAL", - "message": "", - "line": 322, - "author": "Simon Brandhof", - "creationDate": "2013-08-09T16:04:33+0200", - "updateDate": "2013-08-09T17:35:26+0200", - "fUpdateAge": "11 months", - "closeDate": "2013-08-09T17:35:26+0200" - }, - { - "key": "9afae6b5-3328-4867-8263-16ac58589699", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1173", - "status": "CLOSED", - "resolution": "REMOVED", - "severity": "MAJOR", - "message": "Rename 'it' to a meaningful name of at least 3 characters.", - "line": 297, - "author": "Simon Brandhof", - "creationDate": "2013-08-09T16:04:33+0200", - "updateDate": "2013-08-09T17:35:26+0200", - "fUpdateAge": "11 months", - "closeDate": "2013-08-09T17:35:26+0200" - }, - { - "key": "cb76411f-7965-4949-bfb8-a7e48b19de1c", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1166", - "status": "CLOSED", - "resolution": "REMOVED", - "severity": "CRITICAL", - "message": "", - "line": 277, - "author": "Simon Brandhof", - "creationDate": "2013-08-09T16:04:33+0200", - "updateDate": "2013-08-09T17:35:26+0200", - "fUpdateAge": "11 months", - "closeDate": "2013-08-09T17:35:26+0200" - }, - { - "key": "e4de6481-7bfb-460a-8b3c-24459f9561d3", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1135", - "status": "CONFIRMED", - "severity": "INFO", - "message": "Complete the task associated to this TODO comment.", - "line": 240, - "debt": "20min", - "author": "Simon Brandhof", - "creationDate": "2013-08-09T16:04:33+0200", - "updateDate": "2013-08-20T11:32:56+0200", - "fUpdateAge": "11 months" - }, - { - "key": "3a64321a-c031-43ff-bdd6-121cefaf332c", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1186", - "status": "CLOSED", - "resolution": "FIXED", - "severity": "MAJOR", - "message": "Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.", - "line": 406, - "debt": "5min", - "author": "Simon Brandhof", - "actionPlan": "eaf2a3b4-e06f-4e8a-92ec-444f1cf68231", - "creationDate": "2013-08-22T10:19:41+0200", - "updateDate": "2014-02-24T14:51:05+0100", - "fUpdateAge": "4 months", - "closeDate": "2014-02-24T14:51:05+0100" - }, - { - "key": "3c330410-3fb7-474b-a6f3-522fb5468c69", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1166", - "status": "CLOSED", - "resolution": "FIXED", - "severity": "MAJOR", - "message": "Either log or rethrow this exception along with some contextual information.", - "line": 277, - "assignee": "simon.brandhof", - "author": "Simon Brandhof", - "creationDate": "2013-08-22T10:19:41+0200", - "updateDate": "2013-08-28T12:19:16+0200", - "fUpdateAge": "10 months", - "closeDate": "2013-08-28T12:19:16+0200" - }, - { - "key": "517b0861-bdfd-4b01-a4fc-2fccbf4e1748", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1192", - "status": "CLOSED", - "resolution": "FIXED", - "severity": "MINOR", - "message": "Define a constant instead of duplicating this literal \"Fail to get element from cache \" 2 times.", - "line": 124, - "debt": "10min", - "author": "Simon Brandhof", - "creationDate": "2013-08-22T10:19:41+0200", - "updateDate": "2014-04-29T11:24:53+0200", - "fUpdateAge": "2 months", - "closeDate": "2014-04-29T11:24:53+0200", - "comments": [ - { - "key": "7b24f4be-bcaa-4896-a5f7-9e1c84648025", - "login": "simon.brandhof", - "userName": "Simon Brandhof", - "htmlText": "Using constants in log messages does not make sense", - "markdown": "Using constants in log messages does not make sense", - "updatable": false, - "createdAt": "2013-09-02T17:04:47+0200" - } - ] - }, - { - "key": "963c67be-0a42-4fe6-837b-755232e4c41b", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1192", - "status": "CLOSED", - "resolution": "FIXED", - "severity": "MINOR", - "message": "Define a constant instead of duplicating this literal \"Fail to get values from cache \" 3 times.", - "line": 306, - "debt": "10min", - "author": "Simon Brandhof", - "creationDate": "2013-08-22T10:19:41+0200", - "updateDate": "2014-04-29T11:24:53+0200", - "fUpdateAge": "2 months", - "closeDate": "2014-04-29T11:24:53+0200", - "comments": [ - { - "key": "948f7629-4f81-4b5b-8a44-ba9ca05553c4", - "login": "simon.brandhof", - "userName": "Simon Brandhof", - "htmlText": "Using constants in log messages does not make sense", - "markdown": "Using constants in log messages does not make sense", - "updatable": false, - "createdAt": "2013-09-02T17:04:56+0200" - } - ] - }, - { - "key": "bb6cee43-0e33-41a8-b550-6214418b50c1", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1186", - "status": "CLOSED", - "resolution": "FIXED", - "severity": "MAJOR", - "message": "Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.", - "line": 351, - "debt": "20min", - "author": "Simon Brandhof", - "actionPlan": "c3484f53-4bcf-4ae8-ad34-383480070950", - "creationDate": "2013-08-22T10:19:41+0200", - "updateDate": "2013-12-10T15:55:46+0100", - "fUpdateAge": "7 months", - "closeDate": "2013-12-10T15:55:46+0100" - }, - { - "key": "c86f19ef-cacb-43ab-bc7f-a3bfb00e954b", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1166", - "status": "CLOSED", - "resolution": "FIXED", - "severity": "MAJOR", - "message": "Either log or rethrow this exception along with some contextual information.", - "line": 322, - "assignee": "simon.brandhof", - "author": "Simon Brandhof", - "creationDate": "2013-08-22T10:19:41+0200", - "updateDate": "2013-08-28T12:19:16+0200", - "fUpdateAge": "10 months", - "closeDate": "2013-08-28T12:19:16+0200" - }, - { - "key": "26ebfb62-ce60-47e5-86b9-872d8322ddb8", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "findbugs:NP_NULL_PARAM_DEREF", - "status": "CLOSED", - "resolution": "FIXED", - "severity": "CRITICAL", - "message": "Null passed for nonnull parameter of new Cache$Entry(String, String, Serializable) in org.sonar.batch.index.Cache$EntryIterator.next()", - "line": 334, - "author": "Simon Brandhof", - "creationDate": "2013-09-16T17:20:55+0200", - "updateDate": "2013-09-17T01:55:28+0200", - "fUpdateAge": "10 months", - "closeDate": "2013-09-17T01:55:28+0200" - }, - { - "key": "01461208-6c1e-4cdf-9f27-b7afa78e76ec", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1135", - "status": "CONFIRMED", - "severity": "INFO", - "message": "Complete the task associated to this TODO comment.", - "line": 185, - "debt": "20min", - "author": "simon.brandhof@gmail.com", - "creationDate": "2013-10-10T23:51:33+0200", - "updateDate": "2013-12-10T16:22:53+0100", - "fUpdateAge": "7 months" - }, - { - "key": "71a26f48-a90d-4a76-a745-4f6e6e8b1773", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1135", - "status": "REOPENED", - "severity": "INFO", - "message": "Complete the task associated to this TODO comment.", - "line": 126, - "debt": "20min", - "author": "simon.brandhof@gmail.com", - "creationDate": "2013-10-10T23:51:33+0200", - "updateDate": "2013-12-10T16:24:57+0100", - "fUpdateAge": "7 months" - }, - { - "key": "75419c88-0e3c-4311-aa47-fe5731e67558", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1135", - "status": "CONFIRMED", - "severity": "INFO", - "message": "Complete the task associated to this TODO comment.", - "line": 156, - "debt": "20min", - "author": "simon.brandhof@gmail.com", - "creationDate": "2013-10-10T23:51:33+0200", - "updateDate": "2013-12-10T16:25:06+0100", - "fUpdateAge": "7 months" - }, - { - "key": "59fc17f7-c977-4cb6-8f04-fbe88e4b9186", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1192", - "status": "CONFIRMED", - "severity": "MINOR", - "message": "Define a constant instead of duplicating this literal \"Fail to get keys from cache \" 3 times.", - "line": 258, - "debt": "10min", - "author": "simon.brandhof@gmail.com", - "creationDate": "2014-02-20T07:48:16+0100", - "updateDate": "2014-02-24T16:57:34+0100", - "fUpdateAge": "4 months" - }, - { - "key": "e30c874a-0cd1-44db-8dd3-c7cfd5d72929", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1192", - "status": "CLOSED", - "resolution": "FALSE-POSITIVE", - "severity": "MINOR", - "message": "Define a constant instead of duplicating this literal \"Removing an item is not supported\" 2 times.", - "line": 420, - "debt": "10min", - "author": "simon.brandhof@gmail.com", - "creationDate": "2014-02-24T14:51:05+0100", - "updateDate": "2014-04-29T11:24:53+0200", - "fUpdateAge": "2 months", - "closeDate": "2014-04-29T11:24:53+0200" - }, - { - "key": "7cc2e50d-3afc-4e7e-a562-eae2fbb9b596", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1192", - "status": "CLOSED", - "resolution": "FIXED", - "severity": "MINOR", - "message": "Define a constant instead of duplicating this literal \"Fail to get values from cache \" 3 times.", - "line": 311, - "debt": "10min", - "assignee": "julien.henry", - "author": "julien.henry@sonarsource.com", - "actionPlan": "39d06f0c-98c0-4a4f-956b-38ccbc9eb5c9", - "creationDate": "2014-04-30T23:37:32+0200", - "updateDate": "2014-06-20T14:47:17+0200", - "fUpdateAge": "about a month", - "closeDate": "2014-06-20T14:47:17+0200" - }, - { - "key": "20002ec7-b647-44da-bdf5-4d9fbf4b7c58", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "common-java:DuplicatedBlocks", - "status": "CONFIRMED", - "severity": "MAJOR", - "message": "2 duplicated blocks of code.", - "debt": "2h", - "creationDate": "2014-05-01T23:38:31+0200", - "updateDate": "2014-07-01T17:48:47+0200", - "fUpdateAge": "21 days" - }, - { - "key": "5cbf3374-cd56-4e16-8434-d47ee541b347", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:HiddenFieldCheck", - "status": "CLOSED", - "resolution": "FIXED", - "severity": "MAJOR", - "message": "Rename \"exchange\" which hides the field declared at line 46.", - "line": 517, - "debt": "30min", - "creationDate": "2014-05-06T16:36:28+0200", - "updateDate": "2014-05-07T23:40:25+0200", - "fUpdateAge": "2 months", - "closeDate": "2014-05-07T23:40:25+0200" - }, - { - "key": "aac25f93-f7e5-4e75-a750-b64d4d621c67", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1166", - "status": "CLOSED", - "resolution": "FIXED", - "severity": "CRITICAL", - "message": "Either log or rethrow this exception.", - "line": 523, - "debt": "10min", - "creationDate": "2014-05-06T16:36:28+0200", - "updateDate": "2014-05-07T23:40:25+0200", - "fUpdateAge": "2 months", - "closeDate": "2014-05-07T23:40:25+0200" - }, - { - "key": "cdea44e2-a1eb-43dd-a990-662c7cf0b8b9", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "findbugs:REC_CATCH_EXCEPTION", - "status": "CLOSED", - "resolution": "FIXED", - "severity": "MAJOR", - "message": "Exception is caught when Exception is not thrown in org.sonar.batch.index.Cache.newExchange(Exchange)", - "line": 523, - "debt": "1h", - "creationDate": "2014-05-06T16:36:28+0200", - "updateDate": "2014-05-07T23:40:25+0200", - "fUpdateAge": "2 months", - "closeDate": "2014-05-07T23:40:25+0200" - }, - { - "key": "331984f1-e2ce-49a7-838f-a5e2e00bdb65", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1701", - "status": "CLOSED", - "resolution": "REMOVED", - "severity": "MAJOR", - "message": "Rename the \"value\" member.", - "line": 496, - "debt": "10min", - "author": "simon.brandhof@gmail.com", - "creationDate": "2014-06-26T23:17:10+0200", - "updateDate": "2014-06-27T23:12:06+0200", - "fUpdateAge": "25 days", - "closeDate": "2014-06-27T23:12:06+0200" - }, - { - "key": "539895b5-bca6-491a-94da-24b0105af28f", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1701", - "status": "CLOSED", - "resolution": "REMOVED", - "severity": "MAJOR", - "message": "Rename the \"key\" member.", - "line": 495, - "debt": "10min", - "author": "simon.brandhof@gmail.com", - "creationDate": "2014-06-26T23:17:10+0200", - "updateDate": "2014-06-27T23:12:06+0200", - "fUpdateAge": "25 days", - "closeDate": "2014-06-27T23:12:06+0200" - }, - { - "key": "889efbf0-b218-4be7-9ff4-84867b5bc808", - "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "componentId": 19983, - "project": "org.codehaus.sonar:sonar", - "rule": "squid:S1701", - "status": "CLOSED", - "resolution": "REMOVED", - "severity": "MAJOR", - "message": "Rename the \"iterator\" member.", - "line": 387, - "debt": "10min", - "author": "simon.brandhof@gmail.com", - "creationDate": "2014-06-26T23:17:10+0200", - "updateDate": "2014-06-27T23:12:06+0200", - "fUpdateAge": "25 days", - "closeDate": "2014-06-27T23:12:06+0200" - } -], "components": [ - { - "key": "org.codehaus.sonar:sonar", - "id": 2865, - "qualifier": "TRK", - "name": "SonarQube", - "longName": "SonarQube" - }, - { - "key": "org.codehaus.sonar:sonar-batch", - "id": 1624, - "qualifier": "BRC", - "name": "SonarQube :: Batch", - "longName": "SonarQube :: Batch", - "path": "sonar-batch", - "projectId": 2865, - "subProjectId": 2865 - }, - { - "key": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", - "id": 19983, - "qualifier": "FIL", - "name": "Cache.java", - "longName": "src/main/java/org/sonar/batch/index/Cache.java", - "path": "src/main/java/org/sonar/batch/index/Cache.java", - "projectId": 2865, - "subProjectId": 1624 - } -], "projects": [ - { - "key": "org.codehaus.sonar:sonar", - "id": 2865, - "qualifier": "TRK", - "name": "SonarQube", - "longName": "SonarQube" - } -], "rules": [ - { - "key": "squid:S1166", - "name": "Exception handlers should preserve the original exception", - "desc": "

\nWhen handling a caught exception, two mandatory informations should be logged:\n

\n\n
    \n
  • Some context to ease the reproduction of the issue.
  • \n
  • The original's exception, for its message and stack trace.\n
\n\n

Noncompliant Code Example

\n\n
\n // Noncompliant - exception is lost\ntry { /* ... */ } catch (Exception e) { LOGGER.info(\"context\"); }\n\n// Noncompliant - context is required\ntry { /* ... */ } catch (Exception e) { LOGGER.info(e); }\n\n// Noncompliant - exception is lost (only message is preserved)\ntry { /* ... */ } catch (Exception e) { LOGGER.info(e.getMessage()); }\n\n// Noncompliant - exception is lost\ntry { /* ... */ } catch (Exception e) { throw new RuntimeException(\"context\"); }\n
\n\n

Compliant Solution

\n\n
\ntry { /* ... */ } catch (Exception e) { LOGGER.info(\"context\", e); }\n\ntry { /* ... */ } catch (Exception e) { throw new RuntimeException(\"context\", e); }\n
\n\n

Exceptions

\n\n

It is allowed to let the exception propagate.

\n\n
\ntry {\n  /* ... */\n} catch (RuntimeException e) {\n  doSomething();\n  throw e;\n} catch (Exception e) {\n  // Conversion into unchecked exception is also allowed\n  throw new RuntimeException(e);\n}\n
\n\n

\nInterruptedException, NumberFormatException, ParseException and MalformedURLException exceptions are arguably used to indicate nonexceptional outcomes.\nAs they are part of Java, developers have no choice but to deal with them. This rule does not verify that those particular exceptions are correctly handled.\n

\n\n
\nint myInteger;\ntry {\n  myInteger = Integer.parseInt(myString);\n} catch (NumberFormatException e) {\n  // It is perfectly acceptable to not handle \"e\" here\n  myInteger = 0;\n}\n
", - "status": "READY" - }, - { - "key": "common-java:DuplicatedBlocks", - "name": "Duplicated blocks", - "desc": "

An issue is created on a file as soon as there is a block of duplicated code on this file. It gives the number of blocks in the file.

", - "status": "READY" - }, - { - "key": "findbugs:REC_CATCH_EXCEPTION", - "name": "Dodgy - Exception is caught when Exception is not thrown", - "desc": "

\n This method uses a try-catch block that catches Exception objects, but Exception is not\n thrown within the try block, and RuntimeException is not explicitly caught. It is a common bug pattern to\n say try { ... } catch (Exception e) { something } as a shorthand for catching a number of types of exception\n each of whose catch blocks is identical, but this construct also accidentally catches RuntimeException as well,\n masking potential bugs.\n

", - "status": "READY" - }, - { - "key": "squid:S1701", - "name": "Fields should not duplicate method names", - "desc": "

It's confusing to have a class member with the same name as a method in the class.

\n\n

Typically this situation indicates that the method is poorly named; method names should be action-oriented, and thus contain a verb, which is unlikely in the case where both a method and a member have the same name. However, renaming a public method could be disruptive to callers. Therefore renaming the member is the recommended action.

\n\n

Noncompliant Code Sample

\n
\npublic class Foo {\n\n  private string fiz;\n  public String fiz() {\n    // do something...\n  }\n\n  private void doSomething() {\n\n    String tmp = fiz; // is this what was intended? Should this have been a call to fiz()?\n\n  }\n}\n
\n\n

Compliant Solution

\n
\npublic class Foo {\n\n  private string fizbah; // member has been renamed\n  public String fiz() {\n    // do something...\n  }\n\n  private void doSomething() {\n\n    String tmp = fiz; // results in a compile error\n    String tmp2 = fiz(); // no question now what was intended\n  }\n}\n
", - "status": "REMOVED" - }, - { - "key": "squid:S1192", - "name": "String literals should not be duplicated", - "desc": "

\n Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.\n On the other hand, constants can be referenced from many places, but only need to be updated in a single place.\n

\n\n

Non Compliant Code Example

\n\n
\npublic void run() {\n  prepare(\"action1\");                              // Non-Compliant - \"action1\" is duplicated 3 times\n  execute(\"action1\");\n  release(\"action1\");\n}\n\n@SuppressWarning(\"all\")                            // Compliant - annotations are excluded\nprivate void method1() { /* ... */ }\n@SuppressWarning(\"all\")\nprivate void method2() { /* ... */ }\n\npublic String method3(String a) {\n  System.out.println(\"'\" + a + \"'\");               // Compliant - literal \"'\" has less than 5 characters and is excluded\n  return \"\";                                       // Compliant - literal \"\" has less than 5 characters and is excluded\n}\n
\n\n

Compliant Code Example

\n\n
\nprivate static final String ACTION_1 = \"action1\";  // Compliant\n\npublic void run() {\n  prepare(ACTION_1);                               // Compliant\n  execute(ACTION_1);\n  release(ACTION_1);\n}\n
\n\n

Exceptions

\n

To prevent generating some false-positives, literals having less than 5 characters are excluded.

", - "status": "READY" - }, - { - "key": "squid:HiddenFieldCheck", - "name": "Local variables should not shadow class fields", - "desc": "

\nShadowing fields with a local variable is a bad practice reducing code readability: It makes it confusing to know whether the field or the variable is and should be accessed.\n

\n\n

\nThe following code illustrates this rule:\n

\n\n
\nclass Foo {\n  public int myField;\n\n  public Foo(int myField) {                   // Compliant - method parameters are not checked\n    this.myField = myField;\n  }\n\n  @Override\n  public String toString() {\n    int myField = 0;                          // Non-Compliant - should be renamed\n    return \"Foo{MyField: \" + myField + \"}\";\n  }\n}\n
", - "status": "READY" - }, - { - "key": "squid:S1135", - "name": "TODO tags should be handled", - "desc": "

\nTODO tags are commonly used to mark places where some more code is required, but which the developer wants to implement later.\nSometimes the developer will not have the time or will simply forget to get back to that tag.\nThis rule is meant to track those tags, and ensure that they do not go unnoticed.\n

\n\n

The following code illustrates this rule:

\n\n
\nvoid doSomething() {\n  // TODO\n}\n
", - "status": "READY" - }, - { - "key": "findbugs:NP_NULL_PARAM_DEREF", - "name": "Correctness - Method call passes null for nonnull parameter", - "desc": "

\n This method call passes a null value for a nonnull method parameter.\n\tEither the parameter is annotated as a parameter that should\n\talways be nonnull, or analysis has shown that it will always be \n\tdereferenced.\n

", - "status": "READY" - }, - { - "key": "squid:S1173", - "name": "S1173", - "desc": "S1173", - "status": "REMOVED" - }, - { - "key": "squid:S1186", - "name": "Methods should not be empty", - "desc": "

There are three reasons for a method not to have a method body:

\n\n
    \n
  • It is an unintentional omission, and should be fixed.
  • \n
  • It is not yet, or never will be, supported. In this case an UnsupportedOperationException should be thrown.
  • \n
  • The method is an intentionally-blank override. In this case a nested comment should explain the reason for the blank override.
  • \n
\n\n

The following code snippet:

\n\n
\n// Non-Compliant\npublic void doSomething() {\n}\n
\n\nshould be refactored into:\n\n
\n// Compliant\n@Override\npublic void doSomethingElse() {\n  // Do nothing because of X and Y.\n}\n
\n\nor:\n\n
\n// Compliant\n@Override\npublic void doSomethingElse() {\n  throw new UnsupportedOperationException();\n}\n
\n\n

Empty methods not having any nested comments are tolerated in Abstract classes as those empty methods are usual when implementing the visitor pattern.

", - "status": "READY" - } -], "users": [ - { - "login": "julien.henry", - "name": "Julien Henry", - "active": true, - "email": "julien.henry@sonarsource.com" - }, - { - "login": "simon.brandhof", - "name": "Simon Brandhof", - "active": true, - "email": "simon.brandhof@sonarsource.com" - } -], "actionPlans": [ - { - "key": "eaf2a3b4-e06f-4e8a-92ec-444f1cf68231", - "name": "4.2", - "status": "CLOSED", - "project": "org.codehaus.sonar:sonar", - "userLogin": "fabrice.bellingard", - "deadLine": "2014-01-31T00:00:00+0100", - "fDeadLine": "Jan 31, 2014 12:00 AM", - "createdAt": "2013-12-11T08:35:23+0100", - "fCreatedAt": "Dec 11, 2013 8:35 AM", - "updatedAt": "2014-04-14T11:55:03+0200", - "fUpdatedAt": "Apr 14, 2014 11:55 AM" - }, - { - "key": "39d06f0c-98c0-4a4f-956b-38ccbc9eb5c9", - "name": "4.4", - "status": "CLOSED", - "project": "org.codehaus.sonar:sonar", - "userLogin": "fabrice.bellingard", - "deadLine": "2014-06-27T00:00:00+0200", - "fDeadLine": "Jun 27, 2014 12:00 AM", - "createdAt": "2014-04-14T10:23:34+0200", - "fCreatedAt": "Apr 14, 2014 10:23 AM", - "updatedAt": "2014-07-11T16:56:06+0200", - "fUpdatedAt": "Jul 11, 2014 4:56 PM" - }, - { - "key": "c3484f53-4bcf-4ae8-ad34-383480070950", - "name": "SonarQube 4.1", - "status": "CLOSED", - "project": "org.codehaus.sonar:sonar", - "userLogin": "freddy.mallet", - "deadLine": "2013-11-05T00:00:00+0100", - "fDeadLine": "Nov 5, 2013 12:00 AM", - "createdAt": "2013-10-22T12:39:01+0200", - "fCreatedAt": "Oct 22, 2013 12:39 PM", - "updatedAt": "2013-12-12T14:22:07+0100", - "fUpdatedAt": "Dec 12, 2013 2:22 PM" - } -]} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/app.json b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/app.json deleted file mode 100644 index d2793968cb3..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/app.json +++ /dev/null @@ -1,4 +0,0 @@ -{"key": "com.sonarsource.it.samples:sample-with-tests:src/test/java/sample/SampleTest.java", "path": "src/test/java/sample/SampleTest.java", "name": "SampleTest.java", "longName": "src/test/java/sample/SampleTest.java", "q": "UTS", "project": "com.sonarsource.it.samples:sample-with-tests", "projectName": "Sonar :: Integration Tests :: Sample with tests", "fav": false, "canMarkAsFavourite": false, "canBulkChange": false, "canCreateManualIssue": false, "periods": [], "severities": [], "rules": [], "measures": { - "fTests": "2", - "fIssues": "0" -}} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/covered-files.json b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/covered-files.json deleted file mode 100644 index 73f2e044078..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/covered-files.json +++ /dev/null @@ -1,7 +0,0 @@ -{"files": [ - { - "key": "com.sonarsource.it.samples:sample-with-tests:src/main/java/sample/Sample.java", - "longName": "src/main/java/sample/Sample.java", - "coveredLines": 5 - } -]} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/resources.json b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/resources.json deleted file mode 100644 index 3490bce6f94..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/resources.json +++ /dev/null @@ -1,25 +0,0 @@ -[ - { - "id": 5, - "key": "com.sonarsource.it.samples:sample-with-tests:src/test/java/sample/SampleTest.java", - "name": "SampleTest.java", - "scope": "FIL", - "qualifier": "UTS", - "date": "2014-07-24T10:57:16+0200", - "creationDate": "2014-07-24T10:57:17+0200", - "lname": "src/test/java/sample/SampleTest.java", - "lang": "java", - "msr": [ - { - "key": "tests", - "val": 2.0, - "frmt_val": "2" - }, - { - "key": "test_execution_time", - "val": 12.0, - "frmt_val": "12 ms" - } - ] - } -] diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/source.json b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/source.json deleted file mode 100644 index 02e9da776b2..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/source.json +++ /dev/null @@ -1,24 +0,0 @@ -{"sources": [ - [1, "package sample;"], - [2, ""], - [3, "import org.hamcrest.CoreMatchers;"], - [4, "import org.junit.Test;"], - [5, ""], - [6, "import static org.junit.Assert.assertThat;"], - [7, ""], - [8, "public class SampleTest {"], - [9, ""], - [10, " @Test"], - [11, " public void should_return_i() {"], - [12, " Sample sample = new Sample(1);"], - [13, " assertThat(sample.getI(), CoreMatchers.is(1));"], - [14, " }"], - [15, ""], - [16, " @Test"], - [17, " public void should_return_to_string() {"], - [18, " assertThat(new Sample(1).toString(), CoreMatchers.is(\"1\"));"], - [19, " }"], - [20, ""], - [21, "}"], - [22, ""] -]} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/tests.json b/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/tests.json deleted file mode 100644 index f1ef789035c..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/tests/tests.json +++ /dev/null @@ -1,14 +0,0 @@ -{"tests": [ - { - "name": "should_return_to_string", - "status": "OK", - "durationInMs": 1, - "coveredLines": 4 - }, - { - "name": "should_return_i", - "status": "OK", - "durationInMs": 11, - "coveredLines": 5 - } -]} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec.js index 771279d4781..9e764d9e66d 100644 --- a/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec.js +++ b/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec.js @@ -1,3 +1,5 @@ +/* globals casper: false */ + var lib = require('../lib'), testName = lib.testName('Issues'); @@ -161,3 +163,96 @@ casper.test.begin(testName('Issue Box', 'Transitions'), function (test) { test.done(); }); }); + + +casper.test.begin(testName('File-Level Issues'), function (test) { + var issueKey = '200d4a8b-9666-4e70-9953-7bab57933f97', + issueSelector = '.issue[data-key="' + issueKey + '"]'; + + casper + .start(lib.buildUrl('issues'), function () { + lib.setDefaultViewport(); + + lib.mockRequest('/api/l10n/index', '{}'); + lib.mockRequestFromFile('/api/issue_filters/app', 'app.json'); + lib.mockRequestFromFile('/api/issues/search', 'file-level/search.json'); + lib.mockRequestFromFile('/api/components/app', 'file-level/components-app.json'); + lib.mockRequestFromFile('/api/sources/lines', 'file-level/lines.json'); + }) + + .then(function () { + casper.waitForSelector(issueSelector, function () { + casper.click(issueSelector + ' .js-issue-navigate'); + }); + }) + + .then(function () { + casper.waitForSelector('.source-viewer ' + issueSelector, function () { + test.assertSelectorContains('.source-viewer ' + issueSelector, '1 duplicated blocks of code'); + }); + }) + + .run(function () { + test.done(); + }); +}); + + +casper.test.begin(testName('Status Facet'), function (test) { + casper + .start(lib.buildUrl('issues'), function () { + lib.setDefaultViewport(); + + lib.mockRequest('/api/l10n/index', '{}'); + lib.mockRequestFromFile('/api/issue_filters/app', 'app.json'); + lib.mockRequestFromFile('/api/issues/search', 'search-reopened.json', { data: { statuses: 'REOPENED' } }); + lib.mockRequestFromFile('/api/issues/search', 'search.json'); + }) + + .then(function () { + casper.waitForSelector('.facet[data-value=REOPENED]', function () { + casper.click('.facet[data-value=REOPENED]'); + }); + }) + + .then(function () { + lib.waitForElementCount('.issue', 4, function () { + test.assertElementCount('.issue .icon-status-reopened', 4); + }); + }) + + .run(function () { + test.done(); + }); +}); + + +casper.test.begin(testName('Bulk Change'), function (test) { + casper + .start(lib.buildUrl('issues'), function () { + lib.setDefaultViewport(); + + lib.mockRequest('/api/l10n/index', '{}'); + lib.mockRequestFromFile('/api/issue_filters/app', 'app.json'); + lib.mockRequestFromFile('/api/issues/search', 'search.json'); + lib.mockRequest('/issues/bulk_change_form?resolved=false', + '
bulk change form
', { contentType: 'text/plain' }); + }) + + .then(function () { + casper.waitForSelector('.issue', function () { + casper.waitForSelector('#issues-bulk-change'); + }); + }) + + .then(function () { + casper.click('#issues-bulk-change'); + casper.waitForSelector('#bulk-change-form', function () { + test.assertSelectorContains('#bulk-change-form', 'bulk change form'); + }); + }) + + .run(function () { + test.done(); + }); +}); diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/file-level/components-app.json b/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/file-level/components-app.json new file mode 100644 index 00000000000..537dd0787a8 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/file-level/components-app.json @@ -0,0 +1,124 @@ +{ + "key": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/measures/Measure.java", + "path": "src/main/java/org/sonar/api/measures/Measure.java", + "name": "Measure.java", + "longName": "src/main/java/org/sonar/api/measures/Measure.java", + "q": "FIL", + "subProject": "org.codehaus.sonar:sonar-plugin-api", + "subProjectName": "SonarQube :: Plugin API", + "project": "org.codehaus.sonar:sonar", + "projectName": "SonarQube", + "fav": false, + "canMarkAsFavourite": false, + "canBulkChange": false, + "canCreateManualIssue": false, + "periods": [ + [ + 1, + "since previous analysis (2014 Dec 01)", + "2014-12-01T18:51:13+0100" + ], + [ + 2, + "over 365 days (2013 Dec 01)", + "2013-12-01T00:40:31+0100" + ], + [ + 3, + "since previous version (4.5 - 2014 Sep 03)", + "2014-09-03T23:16:52+0200" + ] + ], + "severities": [ + [ + "MAJOR", + "Major", + 10 + ], + [ + "INFO", + "Info", + 3 + ] + ], + "rules": [ + [ + "common-java:DuplicatedBlocks", + "Duplicated blocks", + 1 + ], + [ + "squid:S1698", + "Objects should be compared with \"equals()\"", + 1 + ], + [ + "squid:MethodCyclomaticComplexity", + "Methods should not be too complex", + 3 + ], + [ + "squid:S1142", + "Methods should not contain too many return statements", + 2 + ], + [ + "squid:S1067", + "Expressions should not be too complex", + 1 + ], + [ + "squid:S1151", + "Switch cases should not have too many lines", + 1 + ], + [ + "common-java:InsufficientBranchCoverage", + "Insufficient branch coverage by unit tests", + 1 + ], + [ + "squid:S1133", + "Deprecated code should be removed eventually", + 3 + ] + ], + "measures": { + "fNcloc": "396", + "fCoverage": "65.0%", + "fDuplicationDensity": "2.6%", + "fDebt": "5h 42min", + "fSqaleRating": "A", + "fSqaleDebtRatio": "2.9%", + "fIssues": "13", + "fMajorIssues": "10", + "fInfoIssues": "3" + }, + "tabs": [ + "scm", + "coverage", + "duplications" + ], + "manual_rules": [ + { + "key": "manual:api", + "name": "API" + }, + { + "key": "manual:design", + "name": "Design" + }, + { + "key": "manual:error_handling", + "name": "Error handling" + }, + { + "key": "manual:performance", + "name": "Performance" + }, + { + "key": "manual:sql_pitfalls", + "name": "SQL Pitfall" + } + ] +} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/file-level/lines.json b/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/file-level/lines.json new file mode 100644 index 00000000000..18a670b8522 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/file-level/lines.json @@ -0,0 +1,11 @@ +{ + "sources": [ + { + "line": 1, + "code": "/*", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "aeadc1f9129274949daaa57738c7c4550bdfbc7b", + "scmDate": "2010-09-06T16:08:06+0200" + } + ] +} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/file-level/search.json b/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/file-level/search.json new file mode 100644 index 00000000000..5ea06f0c717 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/file-level/search.json @@ -0,0 +1,494 @@ +{ + "total": 10, + "p": 1, + "ps": 50, + "projects": [ + { + "uuid": "69e57151-be0d-4157-adff-c06741d88879", + "key": "org.codehaus.sonar:sonar", + "id": 2865, + "qualifier": "TRK", + "name": "SonarQube", + "longName": "SonarQube" + } + ], + "components": [ + { + "uuid": "7feef7c3-11b9-4175-b5a7-527ca3c75cb7", + "key": "org.codehaus.sonar:sonar-plugin-api", + "id": 16, + "enabled": true, + "qualifier": "BRC", + "name": "SonarQube :: Plugin API", + "longName": "SonarQube :: Plugin API", + "path": "sonar-plugin-api", + "projectId": 2865, + "subProjectId": 2865 + }, + { + "uuid": "e1b3c47e-e9a2-42ea-9cac-439ce2345d7e", + "key": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/measures/Metric.java", + "id": 3543, + "enabled": true, + "qualifier": "FIL", + "name": "Metric.java", + "longName": "src/main/java/org/sonar/api/measures/Metric.java", + "path": "src/main/java/org/sonar/api/measures/Metric.java", + "projectId": 2865, + "subProjectId": 16 + }, + { + "uuid": "69e57151-be0d-4157-adff-c06741d88879", + "key": "org.codehaus.sonar:sonar", + "id": 2865, + "enabled": true, + "qualifier": "TRK", + "name": "SonarQube", + "longName": "SonarQube" + }, + { + "uuid": "e2550527-3f86-4082-a9ae-e345f5a735aa", + "key": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/measures/Measure.java", + "id": 3538, + "enabled": true, + "qualifier": "FIL", + "name": "Measure.java", + "longName": "src/main/java/org/sonar/api/measures/Measure.java", + "path": "src/main/java/org/sonar/api/measures/Measure.java", + "projectId": 2865, + "subProjectId": 16 + }, + { + "uuid": "97606f40-f3ef-4922-aa37-f67485917e67", + "key": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/resources/File.java", + "id": 3592, + "enabled": true, + "qualifier": "FIL", + "name": "File.java", + "longName": "src/main/java/org/sonar/api/resources/File.java", + "path": "src/main/java/org/sonar/api/resources/File.java", + "projectId": 2865, + "subProjectId": 16 + }, + { + "uuid": "69949290-cfe6-45b6-9dd0-53f1e467b810", + "key": "org.codehaus.sonar:sonar-duplications", + "id": 20, + "enabled": true, + "qualifier": "BRC", + "name": "SonarQube :: Duplications", + "longName": "SonarQube :: Duplications", + "path": "sonar-duplications", + "projectId": 2865, + "subProjectId": 2865 + }, + { + "uuid": "90dd5fda-5fce-4d76-bebf-132922abad95", + "key": "org.codehaus.sonar:sonar-duplications:src/main/java/org/sonar/duplications/index/PackedMemoryCloneIndex.java", + "id": 3308, + "enabled": true, + "qualifier": "FIL", + "name": "PackedMemoryCloneIndex.java", + "longName": "src/main/java/org/sonar/duplications/index/PackedMemoryCloneIndex.java", + "path": "src/main/java/org/sonar/duplications/index/PackedMemoryCloneIndex.java", + "projectId": 2865, + "subProjectId": 20 + }, + { + "uuid": "1b915447-5aa8-4f59-9134-346a4e88c7b7", + "key": "org.codehaus.sonar.plugins:sonar-core-plugin", + "id": 2873, + "enabled": true, + "qualifier": "BRC", + "name": "SonarQube :: Plugins :: Core", + "longName": "SonarQube :: Plugins :: Core", + "path": "plugins/sonar-core-plugin", + "projectId": 2865, + "subProjectId": 2865 + }, + { + "uuid": "6c9c1986-59b3-4839-8dec-9499488f64d1", + "key": "org.codehaus.sonar.plugins:sonar-core-plugin:src/main/java/org/sonar/plugins/core/issue/tracking/StringTextComparator.java", + "id": 20777, + "enabled": true, + "qualifier": "FIL", + "name": "StringTextComparator.java", + "longName": "src/main/java/org/sonar/plugins/core/issue/tracking/StringTextComparator.java", + "path": "src/main/java/org/sonar/plugins/core/issue/tracking/StringTextComparator.java", + "projectId": 2865, + "subProjectId": 2873 + } + ], + "issues": [ + { + "key": "200d4a8b-9666-4e70-9953-7bab57933f97", + "component": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/measures/Measure.java", + "componentId": 3538, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-plugin-api", + "rule": "common-java:DuplicatedBlocks", + "status": "CONFIRMED", + "severity": "MAJOR", + "message": "1 duplicated blocks of code.", + "debt": "1h", + "creationDate": "2014-06-06T23:38:06+0200", + "updateDate": "2014-07-01T17:51:37+0200", + "fUpdateAge": "5 months", + "actions": [], + "transitions": [] + }, + { + "key": "23c5a022-ab5b-4892-b676-a7fd58540f79", + "component": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/measures/Measure.java", + "componentId": 3538, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-plugin-api", + "rule": "common-java:InsufficientBranchCoverage", + "status": "CONFIRMED", + "severity": "MAJOR", + "message": "1 more branches need to be covered by unit tests to reach the minimum threshold of 65.0% branch coverage.", + "debt": "10min", + "creationDate": "2014-09-02T09:25:36+0200", + "updateDate": "2014-10-09T16:21:48+0200", + "fUpdateAge": "about a month", + "actions": [], + "transitions": [] + }, + { + "key": "23d6cd5e-83ba-4e65-abef-ff8592195638", + "component": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/measures/Measure.java", + "componentId": 3538, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-plugin-api", + "rule": "squid:S1142", + "status": "CONFIRMED", + "severity": "MAJOR", + "message": "Reduce the number of returns of this method 7, down to the maximum allowed 5.", + "line": 248, + "debt": "20min", + "author": "julien.henry@sonarsource.com", + "creationDate": "2014-06-16T23:38:20+0200", + "updateDate": "2014-07-01T18:26:25+0200", + "fUpdateAge": "5 months", + "actions": [], + "transitions": [] + }, + { + "key": "8c5a4fca-57c9-44ad-89c0-6673c483e357", + "component": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/measures/Measure.java", + "componentId": 3538, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-plugin-api", + "rule": "squid:MethodCyclomaticComplexity", + "status": "CONFIRMED", + "severity": "MAJOR", + "message": "The Cyclomatic Complexity of this method \"value\" is 22 which is greater than 10 authorized.", + "line": 248, + "debt": "10min", + "author": "julien.henry@sonarsource.com", + "creationDate": "2014-06-16T23:38:20+0200", + "updateDate": "2014-07-01T16:20:08+0200", + "fUpdateAge": "5 months", + "actions": [], + "transitions": [] + }, + { + "key": "57303136-93b5-4d96-b1ca-654160aa5bdb", + "component": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/measures/Measure.java", + "componentId": 3538, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-plugin-api", + "rule": "squid:S1151", + "status": "CONFIRMED", + "severity": "MAJOR", + "message": "Reduce this switch case number of lines from 8 to at most 5, for example by extracting code into methods.", + "line": 266, + "debt": "10min", + "author": "julien.henry@sonarsource.com", + "creationDate": "2014-06-16T23:38:20+0200", + "updateDate": "2014-06-30T16:41:24+0200", + "fUpdateAge": "5 months", + "actions": [], + "transitions": [] + }, + { + "key": "dbf052eb-f991-44db-a829-029d47b7fe2d", + "component": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/measures/Measure.java", + "componentId": 3538, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-plugin-api", + "rule": "squid:MethodCyclomaticComplexity", + "status": "CONFIRMED", + "severity": "MAJOR", + "message": "The Cyclomatic Complexity of this method \"getVariation\" is 12 which is greater than 10 authorized.", + "line": 562, + "debt": "10min", + "author": "Simon Brandhof", + "creationDate": "2011-10-25T12:27:40+0200", + "updateDate": "2013-12-18T23:54:49+0100", + "fUpdateAge": "11 months", + "actions": [], + "transitions": [] + }, + { + "key": "50db1415-bd3c-4c24-ab0a-763177059770", + "component": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/measures/Measure.java", + "componentId": 3538, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-plugin-api", + "rule": "squid:S1698", + "status": "CONFIRMED", + "severity": "MAJOR", + "message": "Change this comparison to use the equals method.", + "line": 684, + "debt": "2min", + "author": "david@gageot.net", + "creationDate": "2014-06-26T23:17:10+0200", + "updateDate": "2014-07-01T16:13:48+0200", + "fUpdateAge": "5 months", + "actions": [], + "transitions": [] + }, + { + "key": "5fbdc597-0d83-4ea2-9d9d-ac192ec1eec1", + "component": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/measures/Measure.java", + "componentId": 3538, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-plugin-api", + "rule": "squid:S1067", + "status": "CONFIRMED", + "severity": "MAJOR", + "message": "Reduce the number of conditional operators (5) used in the expression (maximum allowed 3).", + "line": 684, + "debt": "10min", + "author": "david@gageot.net", + "creationDate": "2013-08-28T12:19:16+0200", + "updateDate": "2013-12-10T14:28:37+0100", + "fUpdateAge": "12 months", + "actions": [], + "transitions": [] + }, + { + "key": "186d1419-f5e9-412f-8a8e-f8cd81920359", + "component": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/measures/Measure.java", + "componentId": 3538, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-plugin-api", + "rule": "squid:MethodCyclomaticComplexity", + "status": "CONFIRMED", + "severity": "MAJOR", + "message": "The Cyclomatic Complexity of this method \"equals\" is 15 which is greater than 10 authorized.", + "line": 724, + "debt": "10min", + "author": "Simon Brandhof", + "creationDate": "2011-10-25T12:27:40+0200", + "updateDate": "2014-03-12T10:43:19+0100", + "fUpdateAge": "9 months", + "actions": [], + "transitions": [] + }, + { + "key": "225d3b74-8b61-46a1-aac2-68221d6cd933", + "component": "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/measures/Measure_2.java", + "componentId": 3538, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-plugin-api", + "rule": "squid:S1142", + "status": "CONFIRMED", + "severity": "MAJOR", + "message": "Reduce the number of returns of this method 6, down to the maximum allowed 5.", + "line": 724, + "debt": "20min", + "author": "simon.brandhof@gmail.com", + "creationDate": "2013-08-09T16:04:33+0200", + "updateDate": "2014-03-12T10:43:19+0100", + "fUpdateAge": "9 months", + "actions": [], + "transitions": [] + } + ], + "rules": [ + { + "key": "squid:S1698", + "name": "Objects should be compared with \"equals()\"", + "lang": "java", + "desc": "

Using the equality (==) and inequality (!=) operators to compare two objects does not check to see if they have the same values. Rather it checks to see if both object references point to exactly the same object in memory. The vast majority of the time, this is not what you want to do. Use the .equals() method to compare the values of two objects or to compare a string object to a string literal.

\n\n

Noncompliant Code Sample

\n
\nString str1 = \"blue\";\nString str2 = \"blue\";\nString str3 = str1;\n\nif (str1 == str2)\n{\n  System.out.println(\"they're both 'blue'\"); // this doesn't print because the objects are different\n}\n\nif (str1 == \"blue\")\n{\n  System.out.println(\"they're both 'blue'\"); // this doesn't print because the objects are different\n}\n\nif (str1 == str3)\n{\n  System.out.println(\"they're the same object\"); // this prints\n}\n
\n\n

Compliant Solution

\n
\nString str1 = \"blue\";\nString str2 = \"blue\";\nString str3 = str1;\n\nif (str1.equals(str2))\n{\n  System.out.println(\"they're both 'blue'\"); // this prints\n}\n\nif (str1.equals(\"blue\"))\n{\n  System.out.println(\"they're both 'blue'\"); // this prints\n}\n\nif (str1 == str3)\n{\n  System.out.println(\"they're the same object\"); // this still prints, but it's probably not what you meant to do\n}\n
", + "status": "READY", + "langName": "Java" + }, + { + "key": "common-java:DuplicatedBlocks", + "name": "Duplicated blocks", + "lang": "java", + "desc": "

An issue is created on a file as soon as there is a block of duplicated code on this file. It gives the number of blocks in the file.

", + "status": "READY", + "langName": "Java" + }, + { + "key": "squid:MethodCyclomaticComplexity", + "name": "Methods should not be too complex", + "lang": "java", + "desc": "

The Cyclomatic Complexity is measured by the number of\n\t(&&, ||) operators and (if, while, do, for, ?:, catch, switch,\n\tcase, return, throw) statements in the body of a class plus one for\n\teach constructor, method (but not getter/setter), static initializer,\n\tor instance initializer in the class. The last return stament in\n\tmethod, if exists, is not taken into account.

\n

\n\tEven when the Cyclomatic Complexity of a class is very high, this\n\tcomplexity might be well distributed among all methods. Nevertheless,\n\tmost of the time, a very complex class is a class which breaks the Single\n\t\tResponsibility Principle and which should be re-factored to be split\n\tin several classes.\n

", + "status": "READY", + "langName": "Java" + }, + { + "key": "squid:S1142", + "name": "Methods should not contain too many return statements", + "lang": "java", + "desc": "

\nHaving too many return statements in a method increases the method's essential complexity because the flow of execution is broken each time a return statement is encountered.\nThis makes it harder to read and understand the logic of the method.\n

\n\n

\nThe following code snippet illustrates this rule with the default threshold of 3:\n

\n\n
\npublic boolean myMethod() { // Non-Compliant as there are 4 return statements\n  if (condition1) {\n    return true;\n  } else {\n    if (condition2) {\n      return false;\n    } else {\n      return true;\n    }\n  }\n  return false;\n}\n
", + "status": "READY", + "langName": "Java" + }, + { + "key": "squid:S1067", + "name": "Expressions should not be too complex", + "lang": "java", + "desc": "

\nThe complexity of an expression is defined by the number of &&, || and condition ? ifTrue : ifFalse operators it contains.\nA single expression's complexity should not become too high to keep the code readable.\n

\n\n

The following code, with a maximum complexity of 3:

\n\n
\nif (condition1 && condition2 && condition3 && condition4) { /* ... */ }  // Non-Compliant\n
\n\n

could be refactored into something like:

\n\n
\nif (relevantMethodName1() && relevantMethodName2()) { /* ... */ }        // Compliant\n\n/* ... */\n\nprivate boolean relevantMethodName1() {\n  return condition1 && condition2;\n}\n\nprivate boolean relevantMethodName2() {\n  return condition3 && condition4;\n}\n
", + "status": "READY", + "langName": "Java" + }, + { + "key": "squid:S1151", + "name": "Switch cases should not have too many lines", + "lang": "java", + "desc": "

Switch cases should remain small to keep the overall switch compact and readable.

\n\n

The following code snippet illustrates this rule with the default threshold of 5:

\n\n
\nswitch (myVariable) {\n  case 0:                     // Compliant - 5 lines till following case\n    System.out.println(\"\");\n    System.out.println(\"\");\n    System.out.println(\"\");\n    break;\n  default:                    // Non-Compliant - 6 lines till switch end\n    System.out.println(\"\");\n    System.out.println(\"\");\n    System.out.println(\"\");\n    System.out.println(\"\");\n    break;\n}\n
", + "status": "READY", + "langName": "Java" + }, + { + "key": "common-java:InsufficientBranchCoverage", + "name": "Insufficient branch coverage by unit tests", + "lang": "java", + "desc": "

An issue is created on a file as soon as the branch coverage on this file is less than the required threshold.It gives the number of branches to be covered in order to reach the required threshold.

", + "status": "READY", + "langName": "Java" + } + ], + "users": [], + "languages": [ + { + "key": "js", + "name": "JavaScript" + }, + { + "key": "java", + "name": "Java" + } + ], + "maxResultsReached": false, + "paging": { + "pageIndex": 1, + "pageSize": 50, + "total": 10, + "fTotal": "10", + "pages": 1 + }, + "facets": [ + { + "property": "severities", + "values": [ + { + "val": "MAJOR", + "count": 10 + }, + { + "val": "INFO", + "count": 3 + }, + { + "val": "MINOR", + "count": 0 + }, + { + "val": "CRITICAL", + "count": 0 + }, + { + "val": "BLOCKER", + "count": 0 + } + ] + }, + { + "property": "statuses", + "values": [ + { + "val": "CONFIRMED", + "count": 10 + }, + { + "val": "OPEN", + "count": 0 + }, + { + "val": "REOPENED", + "count": 0 + }, + { + "val": "RESOLVED", + "count": 0 + }, + { + "val": "CLOSED", + "count": 0 + } + ] + }, + { + "property": "resolutions", + "values": [ + { + "val": "REMOVED", + "count": 43 + }, + { + "val": "FIXED", + "count": 4 + }, + { + "val": "", + "count": 10 + }, + { + "val": "FALSE-POSITIVE", + "count": 0 + } + ] + }, + { + "property": "projectUuids", + "values": [ + { + "val": "69e57151-be0d-4157-adff-c06741d88879", + "count": 10 + } + ] + }, + { + "property": "componentUuids", + "values": [ + { + "val": "90dd5fda-5fce-4d76-bebf-132922abad95", + "count": 20 + }, + { + "val": "e2550527-3f86-4082-a9ae-e345f5a735aa", + "count": 10 + }, + { + "val": "97606f40-f3ef-4922-aa37-f67485917e67", + "count": 8 + }, + { + "val": "6c9c1986-59b3-4839-8dec-9499488f64d1", + "count": 7 + }, + { + "val": "e1b3c47e-e9a2-42ea-9cac-439ce2345d7e", + "count": 6 + } + ] + } + ] +} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/search-reopened.json b/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/search-reopened.json new file mode 100644 index 00000000000..efd73bce04a --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec/search-reopened.json @@ -0,0 +1,485 @@ +{ + "total": 4, + "p": 1, + "ps": 50, + "projects": [ + { + "uuid": "06a742ea-5c55-4c7e-a2b4-8747c163cb40", + "key": "org.codehaus.sonar-plugins:sonar-issues-report-plugin", + "id": 17637, + "qualifier": "TRK", + "name": "Sonar :: Issues Report :: Plugin", + "longName": "Sonar :: Issues Report :: Plugin" + }, + { + "uuid": "69e57151-be0d-4157-adff-c06741d88879", + "key": "org.codehaus.sonar:sonar", + "id": 2865, + "qualifier": "TRK", + "name": "SonarQube", + "longName": "SonarQube" + }, + { + "uuid": "963cefe8-9128-475f-8d39-636685195e43", + "key": "com.sonarsource.rpg:rpg", + "id": 27165, + "qualifier": "TRK", + "name": "SonarSource :: RPG", + "longName": "SonarSource :: RPG" + } + ], + "components": [ + { + "uuid": "f62c3080-6e75-4940-ae95-7dae743bcac3", + "key": "org.codehaus.sonar:sonar-server:src/main/java/org/sonar/server/search/request/ProxySearchScrollRequestBuilder.java", + "id": 35659, + "enabled": true, + "qualifier": "FIL", + "name": "ProxySearchScrollRequestBuilder.java", + "longName": "src/main/java/org/sonar/server/search/request/ProxySearchScrollRequestBuilder.java", + "path": "src/main/java/org/sonar/server/search/request/ProxySearchScrollRequestBuilder.java", + "projectId": 2865, + "subProjectId": 2872 + }, + { + "uuid": "69e57151-be0d-4157-adff-c06741d88879", + "key": "org.codehaus.sonar:sonar", + "id": 2865, + "enabled": true, + "qualifier": "TRK", + "name": "SonarQube", + "longName": "SonarQube" + }, + { + "uuid": "0160edec-b7ca-49a1-93ca-a6ea2c38ed21", + "key": "org.codehaus.sonar-plugins:sonar-issues-report-plugin:src/main/java/org/sonar/issuesreport/IssuesReportPlugin.java", + "id": 17639, + "enabled": true, + "qualifier": "FIL", + "name": "IssuesReportPlugin.java", + "longName": "src/main/java/org/sonar/issuesreport/IssuesReportPlugin.java", + "path": "src/main/java/org/sonar/issuesreport/IssuesReportPlugin.java", + "projectId": 17637, + "subProjectId": 17637 + }, + { + "uuid": "6acccd14-18f8-436e-9a20-1d2d1f91295b", + "key": "com.sonarsource.rpg:rpg-analyzer:src/main/java/com/sonar/rpg/parser/Parser.java", + "id": 27173, + "enabled": true, + "qualifier": "FIL", + "name": "Parser.java", + "longName": "src/main/java/com/sonar/rpg/parser/Parser.java", + "path": "src/main/java/com/sonar/rpg/parser/Parser.java", + "projectId": 27165, + "subProjectId": 27166 + }, + { + "uuid": "06a742ea-5c55-4c7e-a2b4-8747c163cb40", + "key": "org.codehaus.sonar-plugins:sonar-issues-report-plugin", + "id": 17637, + "enabled": true, + "qualifier": "TRK", + "name": "Sonar :: Issues Report :: Plugin", + "longName": "Sonar :: Issues Report :: Plugin" + }, + { + "uuid": "98662175-0f52-4f83-b0e9-1e9444320b5b", + "key": "org.codehaus.sonar-plugins:sonar-issues-report-plugin:src/main/java/org/sonar/issuesreport/ReportJob.java", + "id": 17640, + "enabled": true, + "qualifier": "FIL", + "name": "ReportJob.java", + "longName": "src/main/java/org/sonar/issuesreport/ReportJob.java", + "path": "src/main/java/org/sonar/issuesreport/ReportJob.java", + "projectId": 17637, + "subProjectId": 17637 + }, + { + "uuid": "a6b74bc6-94b9-431f-b7fd-524553d42405", + "key": "com.sonarsource.rpg:rpg-analyzer", + "id": 27166, + "enabled": true, + "qualifier": "BRC", + "name": "SonarSource :: RPG :: Analyzer", + "longName": "SonarSource :: RPG :: Analyzer", + "path": "rpg-analyzer", + "projectId": 27165, + "subProjectId": 27165 + }, + { + "uuid": "e1f6f8bd-6b5f-4e2d-b936-4abffc9e4264", + "key": "org.codehaus.sonar:sonar-server", + "id": 2872, + "enabled": true, + "qualifier": "BRC", + "name": "SonarQube :: Server", + "longName": "SonarQube :: Server", + "path": "sonar-server", + "projectId": 2865, + "subProjectId": 2865 + }, + { + "uuid": "963cefe8-9128-475f-8d39-636685195e43", + "key": "com.sonarsource.rpg:rpg", + "id": 27165, + "enabled": true, + "qualifier": "TRK", + "name": "SonarSource :: RPG", + "longName": "SonarSource :: RPG" + } + ], + "issues": [ + { + "key": "80f1562f-9f64-48a9-a6bb-1dcd2ebf444a", + "component": "org.codehaus.sonar-plugins:sonar-issues-report-plugin:src/main/java/org/sonar/issuesreport/IssuesReportPlugin.java", + "componentId": 17639, + "project": "org.codehaus.sonar-plugins:sonar-issues-report-plugin", + "rule": "squid:S1161", + "status": "REOPENED", + "severity": "MINOR", + "message": "Add the \"@Override\" annotation above this method signature", + "line": 61, + "debt": "5min", + "assignee": "julien.henry", + "author": "julien.henry@sonarsource.com", + "creationDate": "2014-10-09T23:03:12+0200", + "updateDate": "2014-11-24T08:11:19+0100", + "fUpdateAge": "14 days", + "actions": [ + "comment", + "assign", + "assign_to_me", + "plan", + "set_severity" + ], + "transitions": [ + "confirm", + "resolve", + "falsepositive" + ], + "assigneeName": "Julien Henry" + }, + { + "key": "9eae5201-96c7-4e78-a407-8d58479c98a3", + "component": "org.codehaus.sonar-plugins:sonar-issues-report-plugin:src/main/java/org/sonar/issuesreport/ReportJob.java", + "componentId": 17640, + "project": "org.codehaus.sonar-plugins:sonar-issues-report-plugin", + "rule": "squid:S1161", + "status": "REOPENED", + "severity": "MAJOR", + "message": "Add the \"@Override\" annotation above this method signature", + "line": 39, + "debt": "5min", + "assignee": "julien.henry", + "author": "julien.henry@sonarsource.com", + "creationDate": "2014-10-09T23:03:12+0200", + "updateDate": "2014-11-18T08:25:31+0100", + "fUpdateAge": "20 days", + "actions": [ + "comment", + "assign", + "assign_to_me", + "plan", + "set_severity" + ], + "transitions": [ + "confirm", + "resolve", + "falsepositive" + ], + "assigneeName": "Julien Henry" + }, + { + "key": "50bfc04f-6137-457a-a967-f6b1b7345365", + "component": "org.codehaus.sonar:sonar-server:src/main/java/org/sonar/server/search/request/ProxySearchScrollRequestBuilder.java", + "componentId": 35659, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-server", + "rule": "common-java:InsufficientBranchCoverage", + "status": "REOPENED", + "severity": "MAJOR", + "message": "1 more branches need to be covered by unit tests to reach the minimum threshold of 65.0% branch coverage.", + "debt": "10min", + "assignee": "julien.lancelot", + "creationDate": "2014-11-04T14:51:27+0100", + "updateDate": "2014-11-10T23:29:27+0100", + "fUpdateAge": "27 days", + "actions": [ + "comment", + "assign", + "assign_to_me", + "plan", + "set_severity" + ], + "transitions": [ + "confirm", + "resolve", + "falsepositive" + ], + "assigneeName": "Julien Lancelot" + }, + { + "key": "7012d6fc-e663-4032-aba6-70c4522453b4", + "component": "com.sonarsource.rpg:rpg-analyzer:src/main/java/com/sonar/rpg/parser/Parser.java", + "componentId": 27173, + "project": "com.sonarsource.rpg:rpg", + "subProject": "com.sonarsource.rpg:rpg-analyzer", + "rule": "squid:S1994", + "status": "REOPENED", + "severity": "MAJOR", + "message": "This loop's stop condition tests \"isEndOfFile()\" but the incrementer updates \"lineNumber\".", + "line": 69, + "debt": "20min", + "assignee": "pierre-yves.nicolas", + "author": "pierre-yves.nicolas@sonarsource.com", + "creationDate": "2014-10-09T23:05:10+0200", + "updateDate": "2014-10-31T10:33:08+0100", + "fUpdateAge": "about a month", + "comments": [ + { + "key": "9d2b1d6e-9c9c-4ff2-bc55-af622922c4f0", + "login": "evgeny.mandrikov", + "userName": "Evgeny Mandrikov", + "htmlText": "Severity changed from "critical" to "major", because this is a new Java rule.
Also message looks suspicious. Nico, could you please take a look?", + "markdown": "Severity changed from \"critical\" to \"major\", because this is a new Java rule.\nAlso message looks suspicious. Nico, could you please take a look?", + "updatable": false, + "createdAt": "2014-10-10T15:49:23+0200" + }, + { + "key": "583033bd-c0be-4865-ba86-f1773c712bba", + "login": "nicolas.peru", + "userName": "Nicolas Peru", + "htmlText": "message has been improved in https://github.com/SonarSource/sonar-java/commit/d1e4fa74ada69039958dbff8a94c776fd6be6639", + "markdown": "message has been improved in https://github.com/SonarSource/sonar-java/commit/d1e4fa74ada69039958dbff8a94c776fd6be6639", + "updatable": false, + "createdAt": "2014-10-13T17:38:52+0200" + } + ], + "actions": [ + "comment", + "assign", + "assign_to_me", + "plan", + "set_severity" + ], + "transitions": [ + "confirm", + "resolve", + "falsepositive" + ], + "assigneeName": "Pierre-Yves Nicolas" + } + ], + "rules": [ + { + "key": "squid:S1994", + "name": "\"for\" loop incrementers should modify the variable being tested in the loop's stop condition", + "lang": "java", + "desc": "

It is almost always an error when a for loop's stop condition and incrementer don't act on the same variable. Even when it is not, it could confuse future maintainers of the code, and should be avoided.

\n\n

Noncompliant Code Example

\n
\nfor (i = 0; i < 10; j++) {  // Noncompliant\n  // ...\n}\n
\n\n

Compliant Solution

\n
\nfor (i = 0; i < 10; i++) {\n  // ...\n}\n
", + "status": "REMOVED", + "langName": "Java" + }, + { + "key": "common-java:InsufficientBranchCoverage", + "name": "Insufficient branch coverage by unit tests", + "lang": "java", + "desc": "

An issue is created on a file as soon as the branch coverage on this file is less than the required threshold.It gives the number of branches to be covered in order to reach the required threshold.

", + "status": "READY", + "langName": "Java" + }, + { + "key": "squid:S1161", + "name": "\"@Override\" annotation should be used on any method overriding (since Java 5) or implementing (since Java 6) another one", + "lang": "java", + "desc": "

Using the @Override annotation is useful for two reasons :

\n
    \n
  • It elicits a warning from the compiler if the annotated method doesn't actually override anything, as in the case of a misspelling.
  • \n
  • It improves the readability of the source code by making it obvious that methods are overridden.
  • \n
\n

Noncompliant Code Example

\n
\nclass ParentClass {\n  public boolean doSomething(){...}\n}\nclass FirstChildClass extends ParentClass {\n  public boolean doSomething(){...}  //Non-Compliant\n}\n
\n\n

Compliant Solution

\n
\nclass ParentClass {\n  public boolean doSomething(){...}\n}\nclass FirstChildClass extends ParentClass {\n  @Override\n  public boolean doSomething(){...}  //Compliant\n}\n
", + "status": "REMOVED", + "langName": "Java" + } + ], + "users": [ + { + "login": "julien.lancelot", + "name": "Julien Lancelot", + "active": true, + "email": "julien.lancelot@sonarsource.com" + }, + { + "login": "pierre-yves.nicolas", + "name": "Pierre-Yves Nicolas", + "active": true, + "email": "pierre-yves.nicolas@sonarsource.com" + }, + { + "login": "admin", + "name": "Admin Admin", + "active": true, + "email": "admin@sonarsource.com" + }, + { + "login": "nicolas.peru", + "name": "Nicolas Peru", + "active": true, + "email": "nicolas.peru@sonarsource.com" + }, + { + "login": "julien.henry", + "name": "Julien Henry", + "active": true, + "email": "julien.henry@sonarsource.com" + }, + { + "login": "evgeny.mandrikov", + "name": "Evgeny Mandrikov", + "active": true, + "email": "evgeny.mandrikov@sonarsource.com" + } + ], + "actionPlans": [ + { + "key": "1b9e7e52-ff58-40c1-80bf-f68429a3275e", + "name": "5.0", + "status": "OPEN", + "project": "org.codehaus.sonar:sonar", + "userLogin": "fabrice.bellingard", + "createdAt": "2014-09-01T17:14:55+0200", + "fCreatedAt": "Sep 1, 2014 5:14 PM", + "updatedAt": "2014-09-01T17:14:55+0200", + "fUpdatedAt": "Sep 1, 2014 5:14 PM" + }, + { + "key": "151b796f-c5e1-40c9-89c0-ca391e8a31c0", + "name": "CPP 3.3", + "status": "OPEN", + "project": "com.sonarsource.cpp:cpp", + "userLogin": "eric.hartmann", + "createdAt": "2014-10-27T15:15:34+0100", + "fCreatedAt": "Oct 27, 2014 3:15 PM", + "updatedAt": "2014-10-27T15:15:34+0100", + "fUpdatedAt": "Oct 27, 2014 3:15 PM" + }, + { + "key": "6f967cd5-687b-49ac-b4e3-b8d392374557", + "name": "4.5", + "status": "CLOSED", + "project": "org.codehaus.sonar:sonar", + "userLogin": "freddy.mallet", + "createdAt": "2014-07-01T21:22:52+0200", + "fCreatedAt": "Jul 1, 2014 9:22 PM", + "updatedAt": "2014-09-10T15:44:24+0200", + "fUpdatedAt": "Sep 10, 2014 3:44 PM" + } + ], + "languages": [ + { + "key": "js", + "name": "JavaScript" + }, + { + "key": "java", + "name": "Java" + } + ], + "maxResultsReached": false, + "paging": { + "pageIndex": 1, + "pageSize": 50, + "total": 4, + "fTotal": "4", + "pages": 1 + }, + "facets": [ + { + "property": "severities", + "values": [ + { + "val": "MAJOR", + "count": 3 + }, + { + "val": "MINOR", + "count": 1 + }, + { + "val": "INFO", + "count": 0 + }, + { + "val": "CRITICAL", + "count": 0 + }, + { + "val": "BLOCKER", + "count": 0 + } + ] + }, + { + "property": "statuses", + "values": [ + { + "val": "CONFIRMED", + "count": 4583 + }, + { + "val": "OPEN", + "count": 324 + }, + { + "val": "REOPENED", + "count": 4 + }, + { + "val": "RESOLVED", + "count": 0 + }, + { + "val": "CLOSED", + "count": 0 + } + ] + }, + { + "property": "resolutions", + "values": [ + { + "val": "", + "count": 4 + }, + { + "val": "FALSE-POSITIVE", + "count": 0 + }, + { + "val": "FIXED", + "count": 0 + }, + { + "val": "REMOVED", + "count": 0 + } + ] + }, + { + "property": "actionPlans", + "values": [ + { + "val": "1b9e7e52-ff58-40c1-80bf-f68429a3275e", + "count": 4 + }, + { + "val": "151b796f-c5e1-40c9-89c0-ca391e8a31c0", + "count": 2 + }, + { + "val": "6f967cd5-687b-49ac-b4e3-b8d392374557", + "count": 1 + }, + { + "val": "", + "count": 4 + } + ] + } + ] +} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-favorite-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-favorite-spec.js similarity index 72% rename from server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-favorite-spec.js rename to server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-favorite-spec.js index b3cce4f92c2..3f268dfd64a 100644 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-favorite-spec.js +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-favorite-spec.js @@ -1,23 +1,26 @@ +/* global casper:false */ + var lib = require('../lib'), - testName = lib.testName('Component Viewer'); + testName = lib.testName('Source Viewer'); lib.initMessages(); -lib.changeWorkingDirectory('component-viewer-spec'); +lib.changeWorkingDirectory('source-viewer-spec'); casper.test.begin(testName('Mark as Favorite'), function (test) { casper - .start(lib.buildUrl('component-viewer#component=component'), function () { + .start(lib.buildUrl('source-viewer'), function () { lib.setDefaultViewport(); lib.mockRequest('/api/l10n/index', '{}'); lib.mockRequest('/api/favourites', '{}', { type: 'POST' }); lib.mockRequest('/api/favourites/*', '{}', { type: 'DELETE' }); lib.mockRequestFromFile('/api/components/app', 'app.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); + lib.mockRequestFromFile('/api/sources/lines', 'lines.json'); + lib.mockRequestFromFile('/api/issues/search', 'issues.json'); }) .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); + casper.waitForSelector('.source-line'); }) .then(function () { @@ -41,15 +44,16 @@ casper.test.begin(testName('Mark as Favorite'), function (test) { casper.test.begin(testName('Don\'t Show Favorite If Not Logged In'), function (test) { casper - .start(lib.buildUrl('component-viewer#component=component'), function () { + .start(lib.buildUrl('source-viewer'), function () { lib.setDefaultViewport(); lib.mockRequest('/api/l10n/index', '{}'); lib.mockRequestFromFile('/api/components/app', 'app-not-logged-in.json'); - lib.mockRequestFromFile('/api/sources/show', 'source.json'); + lib.mockRequestFromFile('/api/sources/lines', 'lines.json'); + lib.mockRequestFromFile('/api/issues/search', 'issues.json'); }) .then(function () { - casper.waitForSelector('.component-viewer-source .source-line'); + casper.waitForSelector('.source-line'); }) .then(function () { diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-link-to-raw-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-link-to-raw-spec.js new file mode 100644 index 00000000000..d4ae21dff4f --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-link-to-raw-spec.js @@ -0,0 +1,40 @@ +/* global casper:false */ + +var lib = require('../lib'), + testName = lib.testName('Source Viewer'); + +lib.initMessages(); +lib.changeWorkingDirectory('source-viewer-spec'); + + +casper.test.begin(testName('Link to Raw'), function (test) { + casper + .start(lib.buildUrl('source-viewer'), function () { + lib.setDefaultViewport(); + lib.mockRequest('/api/l10n/index', '{}'); + lib.mockRequestFromFile('/api/components/app', 'app.json'); + lib.mockRequestFromFile('/api/sources/lines', 'lines.json'); + lib.mockRequestFromFile('/api/issues/search', 'issues.json'); + }) + + .then(function () { + casper.waitForSelector('.source-line'); + }) + + .then(function () { + casper.click('.js-actions'); + casper.waitForSelector('.js-raw-source', function () { + casper.click('.js-raw-source'); + }); + }) + + .then(function () { + casper.withPopup(/Cache\.java/, function () { + this.test.assertUrlMatch('org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java'); + }); + }) + + .run(function () { + test.done(); + }); +}); diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file.js b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file.js new file mode 100644 index 00000000000..3b64a89d106 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file.js @@ -0,0 +1,58 @@ +/* global casper:false */ + +var lib = require('../lib'), + testName = lib.testName('Source Viewer'); + +lib.initMessages(); +lib.changeWorkingDirectory('source-viewer-should-show-measures-for-test-file'); + +casper.test.begin(testName('Should Show Measures For Test File'), function (test) { + casper + .start(lib.buildUrl('source-viewer'), function () { + lib.setDefaultViewport(); + + lib.mockRequest('/api/l10n/index', '{}'); + lib.mockRequestFromFile('/api/components/app', 'api-components-app.json'); + lib.mockRequestFromFile('/api/sources/lines', 'api-sources-lines.json'); + lib.mockRequestFromFile('/api/issues/search', 'api-issues-search.json'); + lib.mockRequestFromFile('/api/resources', 'api-resources.json'); + lib.mockRequestFromFile('/api/tests/show', 'api-tests-show.json'); + }) + + .then(function () { + casper.waitForSelector('.source-line'); + }) + + .then(function () { + casper.click('.js-actions'); + casper.waitForSelector('.js-measures', function () { + casper.click('.js-measures'); + casper.waitForSelector('.source-viewer-measures'); + }); + }) + + .then(function () { + // The test data is built the specific way when the formatted value + // of a measure is equal to the measure name. + var metrics = [ + 'tests', + 'test_success_density', + 'test_failures', + 'test_errors', + 'skipped_tests', + 'test_execution_time' + ]; + metrics.forEach(function (metric) { + test.assertSelectorContains('.measure[data-metric=' + metric + ']', metric); + }); + }) + + .then(function () { + casper.click('.overlay-popup-close'); + test.assertDoesntExist('.source-viewer-measures'); + }) + + .run(function () { + test.done(); + }); +}); diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-components-app.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-components-app.json new file mode 100644 index 00000000000..a9fbf38378f --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-components-app.json @@ -0,0 +1,56 @@ +{ + "key": "test:fake-project-for-tests:src/test/java/foo/SimplestTest.java", + "path": "src/test/java/foo/SimplestTest.java", + "name": "SimplestTest.java", + "longName": "src/test/java/foo/SimplestTest.java", + "q": "UTS", + "project": "test:fake-project-for-tests", + "projectName": "Fake Project for Tests", + "fav": false, + "canMarkAsFavourite": true, + "canBulkChange": true, + "canCreateManualIssue": true, + "periods": [ + [ + 1, + "since previous analysis (2014 Dec 09)", + "2014-12-09T10:47:33+0100" + ], + [ + 2, + "over 365 days (2014 Dec 09)", + "2014-12-09T10:47:33+0100" + ] + ], + "severities": [], + "rules": [], + "measures": { + "fTests": "3", + "fIssues": "0" + }, + "tabs": [ + "scm" + ], + "manual_rules": [ + { + "key": "manual:api", + "name": "API" + }, + { + "key": "manual:design", + "name": "Design" + }, + { + "key": "manual:error_handling", + "name": "Error handling" + }, + { + "key": "manual:performance", + "name": "Performance" + }, + { + "key": "manual:sql_pitfalls", + "name": "SQL Pitfall" + } + ] +} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-issues-search.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-issues-search.json new file mode 100644 index 00000000000..24f1c1c2626 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-issues-search.json @@ -0,0 +1,66 @@ +{ + "total": 0, + "p": 1, + "ps": 100, + "projects": [ + { + "uuid": "e07e9bed-f45d-4538-a5e8-77031c1ecae7", + "key": "test:fake-project-for-tests", + "id": 36125, + "qualifier": "TRK", + "name": "Fake Project for Tests", + "longName": "Fake Project for Tests" + } + ], + "components": [ + { + "uuid": "58f53b48-f375-4e3d-9b84-1c0e5a373f62", + "key": "test:fake-project-for-tests:src/test/java/foo/SimplestTest.java", + "id": 36134, + "enabled": true, + "qualifier": "UTS", + "name": "SimplestTest.java", + "longName": "src/test/java/foo/SimplestTest.java", + "path": "src/test/java/foo/SimplestTest.java", + "projectId": 36125, + "subProjectId": 36125 + }, + { + "uuid": "e07e9bed-f45d-4538-a5e8-77031c1ecae7", + "key": "test:fake-project-for-tests", + "id": 36125, + "enabled": true, + "qualifier": "TRK", + "name": "Fake Project for Tests", + "longName": "Fake Project for Tests" + } + ], + "issues": [], + "rules": [], + "users": [ + { + "login": "admin", + "name": "Admin Admin", + "active": true, + "email": "admin@sonarsource.com" + } + ], + "languages": [ + { + "key": "js", + "name": "JavaScript" + }, + { + "key": "java", + "name": "Java" + } + ], + "maxResultsReached": false, + "paging": { + "pageIndex": 1, + "pageSize": 100, + "total": 0, + "fTotal": "0", + "pages": 0 + } +} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-resources.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-resources.json new file mode 100644 index 00000000000..42e8c106cec --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-resources.json @@ -0,0 +1,45 @@ +[ + { + "id": 36129, + "key": "test:fake-project-for-tests:src/main/java/foo/Simplest.java", + "name": "Simplest.java", + "scope": "FIL", + "qualifier": "FIL", + "date": "2014-12-09T10:58:44+0100", + "creationDate": "2014-12-09T10:47:35+0100", + "lname": "src/main/java/foo/Simplest.java", + "lang": "java", + "msr": [ + { + "key": "tests", + "val": 1, + "frmt_val": "tests" + }, + { + "key": "test_success_density", + "val": 1, + "frmt_val": "test_success_density" + }, + { + "key": "test_failures", + "val": 1, + "frmt_val": "test_failures" + }, + { + "key": "test_errors", + "val": 1, + "frmt_val": "test_errors" + }, + { + "key": "skipped_tests", + "val": 1, + "frmt_val": "skipped_tests" + }, + { + "key": "test_execution_time", + "val": 1, + "frmt_val": "test_execution_time" + } + ] + } +] diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-sources-lines.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-sources-lines.json new file mode 100644 index 00000000000..b095d82408f --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-sources-lines.json @@ -0,0 +1,130 @@ +{ + "sources": [ + { + "line": 1, + "code": "package foo;", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 2, + "code": "", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 3, + "code": "/**", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "37acee5ff6e67cdb501c08a656fbabf21160b052", + "scmDate": "2013-09-19T15:37:05+0200" + }, + { + "line": 4, + "code": " * Simple class", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "37acee5ff6e67cdb501c08a656fbabf21160b052", + "scmDate": "2013-09-19T15:37:05+0200" + }, + { + "line": 5, + "code": " */", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "37acee5ff6e67cdb501c08a656fbabf21160b052", + "scmDate": "2013-09-19T15:37:05+0200" + }, + { + "line": 6, + "code": "public class Simplest {", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 7, + "code": "", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 8, + "code": " public static int add(int a, int b) {", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 9, + "code": " \t// introduce a variable that is not needed - just to get a violation", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "322e4e8b3cb54a39651f563273745e6ee737fb3e", + "scmDate": "2013-10-15T16:14:22+0200" + }, + { + "line": 10, + "code": " \tint result = a + b;", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "322e4e8b3cb54a39651f563273745e6ee737fb3e", + "scmDate": "2013-10-15T16:14:22+0200" + }, + { + "line": 11, + "code": "", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "44e0c5b4fc18a006a405d3f3d489896245fab3d1", + "scmDate": "2014-01-09T16:48:59+0100" + }, + { + "line": 12, + "code": " \tSystem.out.println(\"\");", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "44e0c5b4fc18a006a405d3f3d489896245fab3d1", + "scmDate": "2014-01-09T16:48:59+0100" + }, + { + "line": 13, + "code": "", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "44e0c5b4fc18a006a405d3f3d489896245fab3d1", + "scmDate": "2014-01-09T16:48:59+0100" + }, + { + "line": 14, + "code": " return result;", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "322e4e8b3cb54a39651f563273745e6ee737fb3e", + "scmDate": "2013-10-15T16:14:22+0200" + }, + { + "line": 15, + "code": " }", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 16, + "code": "", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 17, + "code": "}", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 18, + "code": "", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + } + ] +} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-tests-show.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-tests-show.json new file mode 100644 index 00000000000..4a6dc47c451 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures-for-test-file/api-tests-show.json @@ -0,0 +1,27 @@ +{"tests": [ + { + "name": "testOK", + "status": "OK", + "durationInMs": 9, + "coveredLines": 3 + }, + { + "name": "testERROR", + "status": "ERROR", + "durationInMs": 8, + "coveredLines": 4, + "stackTrace": "stacktrace error" + }, + { + "name": "testFAILURE", + "status": "FAILURE", + "durationInMs": 7, + "coveredLines": 5, + "message": "message failure", + "stackTrace": "stacktrace failure" + }, + { + "name": "testSKIPPED", + "status": "SKIPPED" + } +]} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures.js b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures.js new file mode 100644 index 00000000000..71a1254cf35 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures.js @@ -0,0 +1,102 @@ +/* global casper:false */ + +var lib = require('../lib'), + testName = lib.testName('Source Viewer'); + +lib.initMessages(); +lib.changeWorkingDirectory('source-viewer-should-show-measures'); + + +casper.test.begin(testName('Should Show Measures'), function (test) { + casper + .start(lib.buildUrl('source-viewer'), function () { + lib.setDefaultViewport(); + + lib.mockRequest('/api/l10n/index', '{}'); + lib.mockRequestFromFile('/api/components/app', 'api-components-app.json'); + lib.mockRequestFromFile('/api/sources/lines', 'api-sources-lines.json'); + lib.mockRequestFromFile('/api/issues/search', 'api-issues-search.json'); + lib.mockRequestFromFile('/api/resources', 'api-resources.json'); + }) + + .then(function () { + casper.waitForSelector('.source-line'); + }) + + .then(function () { + casper.click('.js-actions'); + casper.waitForSelector('.js-measures', function () { + casper.click('.js-measures'); + casper.waitForSelector('.source-viewer-measures'); + }); + }) + + .then(function () { + // The test data is built the specific way when the formatted value + // of a measure is equal to the measure name. + var metrics = [ + 'accessors', + 'classes', + 'functions', + 'statements', + 'ncloc', + 'lines', + 'generated_ncloc', + 'generated_lines', + 'complexity', + 'function_complexity', + 'comment_lines', + 'comment_lines_density', + 'public_api', + 'public_undocumented_api', + 'public_documented_api_density', + + 'coverage', + 'line_coverage', + 'lines_to_cover', + 'uncovered_lines', + 'branch_coverage', + 'conditions_to_cover', + 'uncovered_conditions', + 'it_coverage', + 'it_line_coverage', + 'it_lines_to_cover', + 'it_uncovered_lines', + 'it_branch_coverage', + 'it_conditions_to_cover', + 'it_uncovered_conditions', + 'overall_coverage', + 'overall_line_coverage', + 'overall_lines_to_cover', + 'overall_uncovered_lines', + 'overall_branch_coverage', + 'overall_conditions_to_cover', + 'overall_uncovered_conditions', + + 'violations', + 'sqale_index', + 'sqale_debt_ratio', + 'blocker_violations', + 'critical_violations', + 'major_violations', + 'minor_violations', + 'info_violations', + + 'duplicated_lines_density', + 'duplicated_blocks', + 'duplicated_lines' + ]; + metrics.forEach(function (metric) { + test.assertSelectorContains('.measure[data-metric=' + metric + ']', metric); + }); + }) + + .then(function () { + casper.click('.overlay-popup-close'); + test.assertDoesntExist('.source-viewer-measures'); + }) + + .run(function () { + test.done(); + }); +}); diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-components-app.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-components-app.json new file mode 100644 index 00000000000..25b2e1e70f1 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-components-app.json @@ -0,0 +1,95 @@ +{ + "key": "test:fake-project-for-tests:src/main/java/foo/Simplest.java", + "path": "src/main/java/foo/Simplest.java", + "name": "Simplest.java", + "longName": "src/main/java/foo/Simplest.java", + "q": "FIL", + "project": "test:fake-project-for-tests", + "projectName": "Fake Project for Tests", + "fav": false, + "canMarkAsFavourite": true, + "canBulkChange": true, + "canCreateManualIssue": true, + "periods": [ + [ + 1, + "since previous analysis (2014 Dec 09)", + "2014-12-09T10:47:33+0100" + ], + [ + 2, + "over 365 days (2014 Dec 09)", + "2014-12-09T10:47:33+0100" + ] + ], + "severities": [ + [ + "MINOR", + "Minor", + 1 + ], + [ + "MAJOR", + "Major", + 4 + ] + ], + "rules": [ + [ + "squid:IndentationCheck", + "Source code should be correctly indented", + 2 + ], + [ + "squid:S1118", + "Utility classes should not have a public constructor", + 1 + ], + [ + "squid:S00105", + "Tabulation characters should not be used", + 1 + ], + [ + "squid:S106", + "System.out and System.err should not be used as loggers", + 1 + ] + ], + "measures": { + "fNcloc": "8", + "fCoverage": "75.0%", + "fDebt": "44min", + "fSqaleRating": "C", + "fSqaleDebtRatio": "18.3%", + "fIssues": "5", + "fMinorIssues": "1", + "fMajorIssues": "4" + }, + "tabs": [ + "scm", + "coverage" + ], + "manual_rules": [ + { + "key": "manual:api", + "name": "API" + }, + { + "key": "manual:design", + "name": "Design" + }, + { + "key": "manual:error_handling", + "name": "Error handling" + }, + { + "key": "manual:performance", + "name": "Performance" + }, + { + "key": "manual:sql_pitfalls", + "name": "SQL Pitfall" + } + ] +} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-issues-search.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-issues-search.json new file mode 100644 index 00000000000..73d6a9fcf3d --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-issues-search.json @@ -0,0 +1,234 @@ +{ + "total": 5, + "p": 1, + "ps": 100, + "projects": [ + { + "uuid": "e07e9bed-f45d-4538-a5e8-77031c1ecae7", + "key": "test:fake-project-for-tests", + "id": 36125, + "qualifier": "TRK", + "name": "Fake Project for Tests", + "longName": "Fake Project for Tests" + } + ], + "components": [ + { + "uuid": "b4248001-df0c-436a-8acd-a152809b8a23", + "key": "test:fake-project-for-tests:src/main/java/foo/Simplest.java", + "id": 36129, + "enabled": true, + "qualifier": "FIL", + "name": "Simplest.java", + "longName": "src/main/java/foo/Simplest.java", + "path": "src/main/java/foo/Simplest.java", + "projectId": 36125, + "subProjectId": 36125 + }, + { + "uuid": "e07e9bed-f45d-4538-a5e8-77031c1ecae7", + "key": "test:fake-project-for-tests", + "id": 36125, + "enabled": true, + "qualifier": "TRK", + "name": "Fake Project for Tests", + "longName": "Fake Project for Tests" + } + ], + "issues": [ + { + "key": "91b13078-6f69-4b51-ab0f-8fd0bc391532", + "component": "test:fake-project-for-tests:src/main/java/foo/Simplest.java", + "componentId": 36129, + "project": "test:fake-project-for-tests", + "rule": "squid:S00105", + "status": "OPEN", + "severity": "MINOR", + "message": "Replace all tab characters in this file by sequences of white-spaces.", + "debt": "2min", + "creationDate": "2014-12-09T10:47:33+0100", + "updateDate": "2014-12-09T10:47:33+0100", + "fUpdateAge": "3 hours", + "actions": [ + "comment", + "assign", + "assign_to_me", + "plan", + "set_severity" + ], + "transitions": [ + "confirm", + "resolve", + "falsepositive" + ] + }, + { + "key": "c18ae6fa-fac7-46b5-bd71-feef7906b05a", + "component": "test:fake-project-for-tests:src/main/java/foo/Simplest.java", + "componentId": 36129, + "project": "test:fake-project-for-tests", + "rule": "squid:S1118", + "status": "OPEN", + "severity": "MAJOR", + "message": "Add a private constructor to hide the implicit public one.", + "line": 6, + "debt": "30min", + "creationDate": "2014-12-09T10:47:33+0100", + "updateDate": "2014-12-09T10:47:33+0100", + "fUpdateAge": "3 hours", + "actions": [ + "comment", + "assign", + "assign_to_me", + "plan", + "set_severity" + ], + "transitions": [ + "confirm", + "resolve", + "falsepositive" + ] + }, + { + "key": "816282ec-0ca9-4d03-b8bc-22b515496fe4", + "component": "test:fake-project-for-tests:src/main/java/foo/Simplest.java", + "componentId": 36129, + "project": "test:fake-project-for-tests", + "rule": "squid:IndentationCheck", + "status": "OPEN", + "severity": "MAJOR", + "message": "Make this line start at column 3.", + "line": 8, + "debt": "1min", + "creationDate": "2014-12-09T10:47:33+0100", + "updateDate": "2014-12-09T10:47:33+0100", + "fUpdateAge": "3 hours", + "actions": [ + "comment", + "assign", + "assign_to_me", + "plan", + "set_severity" + ], + "transitions": [ + "confirm", + "resolve", + "falsepositive" + ] + }, + { + "key": "0229497b-a613-48f3-83ed-2b98983e5e60", + "component": "test:fake-project-for-tests:src/main/java/foo/Simplest.java", + "componentId": 36129, + "project": "test:fake-project-for-tests", + "rule": "squid:IndentationCheck", + "status": "OPEN", + "severity": "MAJOR", + "message": "Make this line start at column 5.", + "line": 10, + "debt": "1min", + "creationDate": "2014-12-09T10:47:33+0100", + "updateDate": "2014-12-09T10:47:33+0100", + "fUpdateAge": "3 hours", + "actions": [ + "comment", + "assign", + "assign_to_me", + "plan", + "set_severity" + ], + "transitions": [ + "confirm", + "resolve", + "falsepositive" + ] + }, + { + "key": "896ccfe0-bb85-4155-be1f-1aaece716539", + "component": "test:fake-project-for-tests:src/main/java/foo/Simplest.java", + "componentId": 36129, + "project": "test:fake-project-for-tests", + "rule": "squid:S106", + "status": "OPEN", + "severity": "MAJOR", + "message": "Replace this usage of System.out or System.err by a logger.", + "line": 12, + "debt": "10min", + "creationDate": "2014-12-09T10:47:33+0100", + "updateDate": "2014-12-09T10:47:33+0100", + "fUpdateAge": "3 hours", + "actions": [ + "comment", + "assign", + "assign_to_me", + "plan", + "set_severity" + ], + "transitions": [ + "confirm", + "resolve", + "falsepositive" + ] + } + ], + "rules": [ + { + "key": "squid:IndentationCheck", + "name": "Source code should be correctly indented", + "lang": "java", + "desc": "

\nProper indentation is a simple and effective way to improve the code's readability.\nConsistent indentation among developers also reduces the differences that are committed to source control systems, making code reviews easier.\n

\n\n

The following code illustrates this rule with an indentation level of 2:

\n\n
\nclass Foo {\n  public int a; // Compliant\npublic int b;   // Non-Compliant\n}\n
", + "status": "READY", + "langName": "Java" + }, + { + "key": "squid:S1118", + "name": "Utility classes should not have a public constructor", + "lang": "java", + "desc": "

\nUtility classes, which are a collection of static members, are not meant to be instantiated.\nThey should therefore not have public constructors.\n

\n\n

\nJava adds an implicit public constructor to every class which does not define at least one explicitly.\nHence, at least one non-public constructor should be defined.\n

\n\n

The following code:

\n\n
\nclass StringUtils { // Non-Compliant\n\n  public static String concatenate(String s1, String s2) {\n    return s1 + s2;\n  }\n\n}\n
\n\n

should be refactored into:

\n\n
\nclass StringUtils { // Compliant\n\n  private StringUtils() {\n  }\n\n  public static String concatenate(String s1, String s2) {\n    return s1 + s2;\n  }\n\n}\n
", + "status": "READY", + "langName": "Java" + }, + { + "key": "squid:S00105", + "name": "Tabulation characters should not be used", + "lang": "java", + "desc": "

\nDevelopers should not need to configure the tab width of their text editors in order to be able to read source code.\nSo the use of tabulation character must be banned.\n

", + "status": "READY", + "langName": "Java" + }, + { + "key": "squid:S106", + "name": "System.out and System.err should not be used as loggers", + "lang": "java", + "desc": "

Two important requirements must be fulfilled when logging messages:

\n\n
    \n
  • The user must be able to easily retrieve the logs.
  • \n
  • The format of all messages must be uniform to enable users to easily browse them.
  • \n
\n\n

\nIf a program directly writes to the standard output, there is absolutely no way to comply with these requirements.\nThat's why defining and using a dedicated logger is highly recommended.\n

\n\n

\nThe following code snippet illustrates this rule:\n

\n\n
\nSystem.out.println(\"My Message\");  // Non-Compliant\n\nlogger.log(\"My Message\");          // Compliant\n
", + "status": "READY", + "langName": "Java" + } + ], + "users": [ + { + "login": "admin", + "name": "Admin Admin", + "active": true, + "email": "admin@sonarsource.com" + } + ], + "languages": [ + { + "key": "js", + "name": "JavaScript" + }, + { + "key": "java", + "name": "Java" + } + ], + "maxResultsReached": false, + "paging": { + "pageIndex": 1, + "pageSize": 100, + "total": 5, + "fTotal": "5", + "pages": 1 + } +} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-resources.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-resources.json new file mode 100644 index 00000000000..eb47ea0c92d --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-resources.json @@ -0,0 +1,256 @@ +[ + { + "id": 36129, + "key": "test:fake-project-for-tests:src/main/java/foo/Simplest.java", + "name": "Simplest.java", + "scope": "FIL", + "qualifier": "FIL", + "date": "2014-12-09T10:58:44+0100", + "creationDate": "2014-12-09T10:47:35+0100", + "lname": "src/main/java/foo/Simplest.java", + "lang": "java", + "msr": [ + { + "key": "accessors", + "val": 1, + "frmt_val": "accessors" + }, + { + "key": "classes", + "val": 1, + "frmt_val": "classes" + }, + { + "key": "functions", + "val": 1, + "frmt_val": "functions" + }, + { + "key": "statements", + "val": 1, + "frmt_val": "statements" + }, + { + "key": "ncloc", + "val": 1, + "frmt_val": "ncloc" + }, + { + "key": "lines", + "val": 1, + "frmt_val": "lines" + }, + { + "key": "generated_ncloc", + "val": 1, + "frmt_val": "generated_ncloc" + }, + { + "key": "generated_lines", + "val": 1, + "frmt_val": "generated_lines" + }, + { + "key": "complexity", + "val": 1, + "frmt_val": "complexity" + }, + { + "key": "function_complexity", + "val": 1, + "frmt_val": "function_complexity" + }, + { + "key": "comment_lines", + "val": 1, + "frmt_val": "comment_lines" + }, + { + "key": "comment_lines_density", + "val": 1, + "frmt_val": "comment_lines_density" + }, + { + "key": "public_api", + "val": 1, + "frmt_val": "public_api" + }, + { + "key": "public_undocumented_api", + "val": 1, + "frmt_val": "public_undocumented_api" + }, + { + "key": "public_documented_api_density", + "val": 1, + "frmt_val": "public_documented_api_density" + }, + { + "key": "coverage", + "val": 1, + "frmt_val": "coverage" + }, + { + "key": "line_coverage", + "val": 1, + "frmt_val": "line_coverage" + }, + { + "key": "lines_to_cover", + "val": 1, + "frmt_val": "lines_to_cover" + }, + { + "key": "uncovered_lines", + "val": 1, + "frmt_val": "uncovered_lines" + }, + { + "key": "branch_coverage", + "val": 1, + "frmt_val": "branch_coverage" + }, + { + "key": "conditions_to_cover", + "val": 1, + "frmt_val": "conditions_to_cover" + }, + { + "key": "uncovered_conditions", + "val": 1, + "frmt_val": "uncovered_conditions" + }, + { + "key": "it_coverage", + "val": 1, + "frmt_val": "it_coverage" + }, + { + "key": "it_line_coverage", + "val": 1, + "frmt_val": "it_line_coverage" + }, + { + "key": "it_lines_to_cover", + "val": 1, + "frmt_val": "it_lines_to_cover" + }, + { + "key": "it_uncovered_lines", + "val": 1, + "frmt_val": "it_uncovered_lines" + }, + { + "key": "it_branch_coverage", + "val": 1, + "frmt_val": "it_branch_coverage" + }, + { + "key": "it_conditions_to_cover", + "val": 1, + "frmt_val": "it_conditions_to_cover" + }, + { + "key": "it_uncovered_conditions", + "val": 1, + "frmt_val": "it_uncovered_conditions" + }, + { + "key": "overall_coverage", + "val": 1, + "frmt_val": "overall_coverage" + }, + { + "key": "overall_line_coverage", + "val": 1, + "frmt_val": "overall_line_coverage" + }, + { + "key": "overall_lines_to_cover", + "val": 1, + "frmt_val": "overall_lines_to_cover" + }, + { + "key": "overall_uncovered_lines", + "val": 1, + "frmt_val": "overall_uncovered_lines" + }, + { + "key": "overall_branch_coverage", + "val": 1, + "frmt_val": "overall_branch_coverage" + }, + { + "key": "overall_conditions_to_cover", + "val": 1, + "frmt_val": "overall_conditions_to_cover" + }, + { + "key": "overall_uncovered_conditions", + "val": 1, + "frmt_val": "overall_uncovered_conditions" + }, + { + "key": "violations", + "val": 1, + "frmt_val": "violations" + }, + { + "key": "sqale_index", + "val": 1, + "frmt_val": "sqale_index" + }, + { + "key": "sqale_rating", + "val": 1, + "frmt_val": "sqale_rating" + }, + { + "key": "sqale_debt_ratio", + "val": 1, + "frmt_val": "sqale_debt_ratio" + }, + { + "key": "blocker_violations", + "val": 1, + "frmt_val": "blocker_violations" + }, + { + "key": "critical_violations", + "val": 1, + "frmt_val": "critical_violations" + }, + { + "key": "major_violations", + "val": 1, + "frmt_val": "major_violations" + }, + { + "key": "minor_violations", + "val": 1, + "frmt_val": "minor_violations" + }, + { + "key": "info_violations", + "val": 1, + "frmt_val": "info_violations" + }, + { + "key": "duplicated_lines_density", + "val": 1, + "frmt_val": "duplicated_lines_density" + }, + { + "key": "duplicated_blocks", + "val": 1, + "frmt_val": "duplicated_blocks" + }, + { + "key": "duplicated_lines", + "val": 1, + "frmt_val": "duplicated_lines" + } + + ] + } +] diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-sources-lines.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-sources-lines.json new file mode 100644 index 00000000000..b095d82408f --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-should-show-measures/api-sources-lines.json @@ -0,0 +1,130 @@ +{ + "sources": [ + { + "line": 1, + "code": "package foo;", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 2, + "code": "", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 3, + "code": "/**", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "37acee5ff6e67cdb501c08a656fbabf21160b052", + "scmDate": "2013-09-19T15:37:05+0200" + }, + { + "line": 4, + "code": " * Simple class", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "37acee5ff6e67cdb501c08a656fbabf21160b052", + "scmDate": "2013-09-19T15:37:05+0200" + }, + { + "line": 5, + "code": " */", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "37acee5ff6e67cdb501c08a656fbabf21160b052", + "scmDate": "2013-09-19T15:37:05+0200" + }, + { + "line": 6, + "code": "public class Simplest {", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 7, + "code": "", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 8, + "code": " public static int add(int a, int b) {", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 9, + "code": " \t// introduce a variable that is not needed - just to get a violation", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "322e4e8b3cb54a39651f563273745e6ee737fb3e", + "scmDate": "2013-10-15T16:14:22+0200" + }, + { + "line": 10, + "code": " \tint result = a + b;", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "322e4e8b3cb54a39651f563273745e6ee737fb3e", + "scmDate": "2013-10-15T16:14:22+0200" + }, + { + "line": 11, + "code": "", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "44e0c5b4fc18a006a405d3f3d489896245fab3d1", + "scmDate": "2014-01-09T16:48:59+0100" + }, + { + "line": 12, + "code": " \tSystem.out.println(\"\");", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "44e0c5b4fc18a006a405d3f3d489896245fab3d1", + "scmDate": "2014-01-09T16:48:59+0100" + }, + { + "line": 13, + "code": "", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "44e0c5b4fc18a006a405d3f3d489896245fab3d1", + "scmDate": "2014-01-09T16:48:59+0100" + }, + { + "line": 14, + "code": " return result;", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "322e4e8b3cb54a39651f563273745e6ee737fb3e", + "scmDate": "2013-10-15T16:14:22+0200" + }, + { + "line": 15, + "code": " }", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 16, + "code": "", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 17, + "code": "}", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + }, + { + "line": 18, + "code": "", + "scmAuthor": "fabrice.bellingard@sonarsource.com", + "scmRevision": "f467e9befd3ff15bb1dbf634b0e9b45d44110bac", + "scmDate": "2013-09-16T15:31:49+0200" + } + ] +} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec.js new file mode 100644 index 00000000000..97f3fa9c47f --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec.js @@ -0,0 +1,213 @@ +/* global casper:false */ + +var lib = require('../lib'), + testName = lib.testName('Source Viewer'); + +lib.initMessages(); +lib.changeWorkingDirectory('source-viewer-spec'); + + +casper.test.begin(testName('Base'), function (test) { + casper + .start(lib.buildUrl('source-viewer'), function () { + lib.setDefaultViewport(); + + lib.mockRequest('/api/l10n/index', '{}'); + lib.mockRequestFromFile('/api/components/app', 'app.json'); + lib.mockRequestFromFile('/api/sources/lines', 'lines.json'); + lib.mockRequestFromFile('/api/issues/search', 'issues.json'); + }) + + .then(function () { + casper.waitForSelector('.source-line', function () { + // Check header elements + test.assertExists('.source-viewer-header'); + test.assertSelectorContains('.source-viewer-header-component-project', 'SonarQube'); + test.assertSelectorContains('.source-viewer-header-component-project', 'SonarQube :: Batch'); + test.assertSelectorContains('.source-viewer-header-component-name', + 'src/main/java/org/sonar/batch/index/Cache.java'); + test.assertExists('.source-viewer-header-favorite'); + test.assertExists('.source-viewer-header-actions'); + + // Check main measures + // FIXME enable lines check + //test.assertSelectorContains('.source-viewer-header-measure', '379'); + test.assertSelectorContains('.source-viewer-header-measure', 'A'); + test.assertSelectorContains('.source-viewer-header-measure', '2h 10min'); + test.assertSelectorContains('.source-viewer-header-measure', '6'); + test.assertSelectorContains('.source-viewer-header-measure', '74.3%'); + test.assertSelectorContains('.source-viewer-header-measure', '5.8%'); + + // Check source + // FIXME enable source lines count check + //test.assertElementCount('.source-line', 518); + test.assertSelectorContains('.source-viewer', 'public class Cache'); + }); + }) + + .run(function () { + test.done(); + }); +}); + + +casper.test.begin(testName('Decoration'), function (test) { + casper + .start(lib.buildUrl('source-viewer'), function () { + lib.setDefaultViewport(); + + lib.mockRequest('/api/l10n/index', '{}'); + lib.mockRequestFromFile('/api/components/app', 'app.json'); + lib.mockRequestFromFile('/api/sources/lines', 'lines.json'); + lib.mockRequestFromFile('/api/issues/search', 'issues.json'); + }) + + .then(function () { + casper.waitForSelector('.source-line'); + }) + + .then(function () { + // Check issues decoration + test.assertElementCount('.has-issues', 6); + }) + + .then(function () { + // Check coverage decoration + test.assertElementCount('.source-line-covered', 142); + test.assertElementCount('.source-line-uncovered', 50); + test.assertElementCount('.source-line-partially-covered', 2); + }) + + .then(function () { + // Check duplications decoration + test.assertElementCount('.source-line-duplicated', 30); + }) + + .then(function () { + // Check scm decoration + test.assertElementCount('.source-line-scm-inner', 186); + test.assertExists('.source-line-scm-inner[data-author="simon.brandhof@gmail.com"]'); + test.assertExists('.source-line-scm-inner[data-author="julien.henry@sonarsource.com"]'); + }) + + .run(function () { + test.done(); + }); +}); + + +casper.test.begin(testName('Test File'), function (test) { + casper + .start(lib.buildUrl('source-viewer'), function () { + lib.setDefaultViewport(); + + lib.mockRequest('/api/l10n/index', '{}'); + lib.mockRequestFromFile('/api/components/app', 'tests/app.json'); + lib.mockRequestFromFile('/api/sources/lines', 'tests/lines.json'); + lib.mockRequestFromFile('/api/issues/search', 'issues.json'); + }) + + .then(function () { + casper.waitForSelector('.source-line'); + }) + + .then(function () { + test.assertSelectorContains('.source-viewer-header-measure', '6'); + }) + + .run(function () { + test.done(); + }); +}); + + +// FIXME enable test +//casper.test.begin(testName('Go From Coverage to Test File'), function (test) { +// casper +// .start(lib.buildUrl('source-viewer'), function () { +// lib.setDefaultViewport(); +// lib.mockRequest('/api/l10n/index', '{}'); +// lib.mockRequestFromFile('/api/components/app', 'app.json'); +// lib.mockRequestFromFile('/api/sources/lines', 'lines.json'); +// lib.mockRequestFromFile('/api/issues/search', 'issues.json'); +// lib.mockRequestFromFile('/api/tests/test_cases', 'test-cases.json'); +// }) +// +// .then(function () { +// casper.waitForSelector('.component-viewer-source .source-line'); +// }) +// +// .then(function () { +// casper.click('.js-toggle-coverage'); +// casper.waitForSelector('.source-line-covered', function () { +// casper.click('.source-line-covered'); +// casper.waitForSelector('.bubble-popup', function () { +// test.assertSelectorContains('.bubble-popup', 'src/test/java/org/sonar/batch/issue/IssueCacheTest.java'); +// test.assertSelectorContains('.bubble-popup', 'should_update_existing_issue'); +// test.assertSelectorContains('.bubble-popup li[title="should_update_existing_issue"]', '293'); +// +// lib.clearRequestMocks(); +// lib.mockRequestFromFile('/api/components/app', 'tests/app.json'); +// lib.mockRequestFromFile('/api/sources/show', 'tests/source.json'); +// lib.mockRequestFromFile('/api/resources', 'tests/resources.json'); +// lib.mockRequest('/api/coverage/show', '{}'); +// lib.mockRequestFromFile('/api/tests/show', 'tests/tests.json'); +// casper.click('.component-viewer-popup-test-file[data-key]'); +// +// casper.waitForSelector('.js-unit-test', function () { +// test.assertElementCount('.js-unit-test', 2); +// }); +// }); +// }); +// }) +// +// .run(function () { +// test.done(); +// }); +//}); + + +casper.test.begin(testName('Create Manual Issue'), function (test) { + casper + .start(lib.buildUrl('source-viewer'), function () { + lib.setDefaultViewport(); + + lib.mockRequest('/api/l10n/index', '{}'); + lib.mockRequestFromFile('/api/components/app', 'app.json'); + lib.mockRequestFromFile('/api/sources/lines', 'lines.json'); + lib.mockRequestFromFile('/api/issues/search', 'issues.json'); + lib.mockRequestFromFile('/api/issues/create', 'create-issue.json'); + lib.mockRequestFromFile('/api/issues/show', 'create-issue.json'); + }) + + .then(function () { + casper.waitForSelector('.source-line-number[data-line-number="3"]'); + }) + + .then(function () { + casper.click('.source-line-number[data-line-number="3"]'); + casper.waitForSelector('.js-add-manual-issue'); + }) + + .then(function () { + casper.click('.js-add-manual-issue'); + casper.waitForSelector('.js-manual-issue-form'); + }) + + .then(function () { + casper.fill('.js-manual-issue-form', { + rule: 'manual:api', + message: 'An issue message' + }, true); + }) + + .then(function () { + casper.waitForSelector('.source-line-code.has-issues[data-line-number="3"]', function () { + test.assertExists('.source-line-code.has-issues[data-line-number="3"]'); + }); + }) + + .run(function () { + test.done(); + }); +}); diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/app-not-logged-in.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/app-not-logged-in.json similarity index 71% rename from server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/app-not-logged-in.json rename to server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/app-not-logged-in.json index 3fc5d9091db..936eeb1b153 100644 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/app-not-logged-in.json +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/app-not-logged-in.json @@ -1,10 +1,8 @@ -{ - "key": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", +{"key": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", "path": "src/main/java/org/sonar/batch/index/Cache.java", "name": "Cache.java", "longName": "src/main/java/org/sonar/batch/index/Cache.java", - "q": "FIL", - "subProject": "org.codehaus.sonar:sonar-batch", + "q": "FIL", "subProject": "org.codehaus.sonar:sonar-batch", "subProjectName": "SonarQube :: Batch", "project": "org.codehaus.sonar:sonar", "projectName": "SonarQube", @@ -13,9 +11,9 @@ "canBulkChange": false, "canCreateManualIssue": false, "periods": [ - [1, "since previous analysis (2014 Jul 08)", "2014-07-08T23:17:21+0200"], - [2, "over 365 days (2013 Jul 10)", "2013-07-10T00:41:28+0200"], - [3, "since previous version (4.4 - 2014 Jul 02)", "2014-07-02T15:39:51+0200"] + [1, "since previous analysis (2014 Dec 01)", "2014-12-01T18:51:13+0100"], + [2, "over 365 days (2013 Dec 01)", "2013-12-01T00:40:31+0100"], + [3, "since previous version (4.5 - 2014 Sep 03)", "2014-09-03T23:16:52+0200"] ], "severities": [ ["MINOR", "Minor", 1], @@ -28,15 +26,16 @@ ["squid:S1135", "TODO tags should be handled", 4] ], "measures": { - "fNcloc": "379", + "fNcloc": "378", "fCoverage": "74.3%", "fDuplicationDensity": "5.8%", - "fDebt": "3h 30min", + "fDebt": "2h 10min", + "fSqaleRating": "A", + "fSqaleDebtRatio": "1.1%", "fIssues": "6", "fMinorIssues": "1", "fMajorIssues": "1", - "fInfoIssues": "4", - "fSqaleRating": "A" + "fInfoIssues": "4" }, "tabs": ["scm", "coverage", "duplications"], "manual_rules": [ @@ -60,5 +59,4 @@ "key": "manual:sql_pitfalls", "name": "SQL Pitfall" } - ] -} + ]} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/app.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/app.json similarity index 71% rename from server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/app.json rename to server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/app.json index 551719f645f..393598f3034 100644 --- a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/app.json +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/app.json @@ -1,10 +1,8 @@ -{ - "key": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", +{"key": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", "path": "src/main/java/org/sonar/batch/index/Cache.java", "name": "Cache.java", "longName": "src/main/java/org/sonar/batch/index/Cache.java", - "q": "FIL", - "subProject": "org.codehaus.sonar:sonar-batch", + "q": "FIL", "subProject": "org.codehaus.sonar:sonar-batch", "subProjectName": "SonarQube :: Batch", "project": "org.codehaus.sonar:sonar", "projectName": "SonarQube", @@ -13,9 +11,9 @@ "canBulkChange": true, "canCreateManualIssue": true, "periods": [ - [1, "since previous analysis (2014 Jul 08)", "2014-07-08T23:17:21+0200"], - [2, "over 365 days (2013 Jul 10)", "2013-07-10T00:41:28+0200"], - [3, "since previous version (4.4 - 2014 Jul 02)", "2014-07-02T15:39:51+0200"] + [1, "since previous analysis (2014 Dec 01)", "2014-12-01T18:51:13+0100"], + [2, "over 365 days (2013 Dec 01)", "2013-12-01T00:40:31+0100"], + [3, "since previous version (4.5 - 2014 Sep 03)", "2014-09-03T23:16:52+0200"] ], "severities": [ ["MINOR", "Minor", 1], @@ -28,15 +26,16 @@ ["squid:S1135", "TODO tags should be handled", 4] ], "measures": { - "fNcloc": "379", + "fNcloc": "378", "fCoverage": "74.3%", "fDuplicationDensity": "5.8%", - "fDebt": "3h 30min", + "fDebt": "2h 10min", + "fSqaleRating": "A", + "fSqaleDebtRatio": "1.1%", "fIssues": "6", "fMinorIssues": "1", "fMajorIssues": "1", - "fInfoIssues": "4", - "fSqaleRating": "A" + "fInfoIssues": "4" }, "tabs": ["scm", "coverage", "duplications"], "manual_rules": [ @@ -60,5 +59,4 @@ "key": "manual:sql_pitfalls", "name": "SQL Pitfall" } - ] -} + ]} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/coverage.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/coverage.json similarity index 100% rename from server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/coverage.json rename to server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/coverage.json diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/create-issue.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/create-issue.json new file mode 100644 index 00000000000..db69ef34a93 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/create-issue.json @@ -0,0 +1,17 @@ +{ + "issue": { + "key": "e69e2012-c58e-4c37-9e0e-9595576de9de", + "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", + "componentId": null, + "project": "org.codehaus.sonar:sonar", + "rule": "manual:api", + "status": "OPEN", + "severity": "MAJOR", + "message": "An issue message", + "line": 3, + "reporter": "admin", + "creationDate": "2014-12-08T14:22:49+0100", + "updateDate": "2014-12-08T14:22:49+0100", + "fUpdateAge": "less than a minute" + } +} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/cross-project-duplications.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/cross-project-duplications.json similarity index 100% rename from server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/cross-project-duplications.json rename to server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/cross-project-duplications.json diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/duplications-in-deleted-files.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/duplications-in-deleted-files.json similarity index 100% rename from server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/duplications-in-deleted-files.json rename to server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/duplications-in-deleted-files.json diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/duplications.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/duplications.json similarity index 100% rename from server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/duplications.json rename to server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/duplications.json diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/issues.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/issues.json new file mode 100644 index 00000000000..0b1601191ef --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/issues.json @@ -0,0 +1,200 @@ +{"total": 6, "p": 1, "ps": 100, "projects": [ + { + "uuid": "69e57151-be0d-4157-adff-c06741d88879", + "key": "org.codehaus.sonar:sonar", + "id": 2865, + "qualifier": "TRK", + "name": "SonarQube", + "longName": "SonarQube" + } +], "components": [ + { + "uuid": "83379565-7af3-4047-8d1a-ed42b10309b0", + "key": "org.codehaus.sonar:sonar-batch", + "id": 1624, + "enabled": true, + "qualifier": "BRC", + "name": "SonarQube :: Batch", + "longName": "SonarQube :: Batch", + "path": "sonar-batch", + "projectId": 2865, + "subProjectId": 2865 + }, + { + "uuid": "69e57151-be0d-4157-adff-c06741d88879", + "key": "org.codehaus.sonar:sonar", + "id": 2865, + "enabled": true, + "qualifier": "TRK", + "name": "SonarQube", + "longName": "SonarQube" + }, + { + "uuid": "b9615992-2458-4d54-a22f-b91ee7ba5bc5", + "key": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", + "id": 19983, + "enabled": true, + "qualifier": "FIL", + "name": "Cache.java", + "longName": "src/main/java/org/sonar/batch/index/Cache.java", + "path": "src/main/java/org/sonar/batch/index/Cache.java", + "projectId": 2865, + "subProjectId": 1624 + } +], "issues": [ + { + "key": "20002ec7-b647-44da-bdf5-4d9fbf4b7c58", + "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", + "componentId": 19983, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-batch", + "rule": "common-java:DuplicatedBlocks", + "status": "CONFIRMED", + "severity": "MAJOR", + "message": "2 duplicated blocks of code.", + "debt": "2h", + "creationDate": "2014-05-01T23:38:31+0200", + "updateDate": "2014-07-01T17:48:47+0200", + "fUpdateAge": "5 months", + "actions": ["comment", "assign", "assign_to_me", "plan", "set_severity"], + "transitions": ["unconfirm", "resolve", "falsepositive"] + }, + { + "key": "71a26f48-a90d-4a76-a745-4f6e6e8b1773", + "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", + "componentId": 19983, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-batch", + "rule": "squid:S1135", + "status": "CONFIRMED", + "severity": "INFO", + "message": "Complete the task associated to this TODO comment.", + "line": 125, + "author": "simon.brandhof@gmail.com", + "creationDate": "2013-10-10T23:51:33+0200", + "updateDate": "2014-07-29T23:15:18+0200", + "fUpdateAge": "4 months", + "actions": ["comment", "assign", "assign_to_me", "plan", "set_severity"], + "transitions": ["unconfirm", "resolve", "falsepositive"] + }, + { + "key": "75419c88-0e3c-4311-aa47-fe5731e67558", + "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", + "componentId": 19983, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-batch", + "rule": "squid:S1135", + "status": "CONFIRMED", + "severity": "INFO", + "message": "Complete the task associated to this TODO comment.", + "line": 155, + "author": "simon.brandhof@gmail.com", + "creationDate": "2013-10-10T23:51:33+0200", + "updateDate": "2014-07-29T23:15:18+0200", + "fUpdateAge": "4 months", + "actions": ["comment", "assign", "assign_to_me", "plan", "set_severity"], + "transitions": ["unconfirm", "resolve", "falsepositive"] + }, + { + "key": "01461208-6c1e-4cdf-9f27-b7afa78e76ec", + "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", + "componentId": 19983, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-batch", + "rule": "squid:S1135", + "status": "CONFIRMED", + "severity": "INFO", + "message": "Complete the task associated to this TODO comment.", + "line": 184, + "author": "simon.brandhof@gmail.com", + "creationDate": "2013-10-10T23:51:33+0200", + "updateDate": "2014-07-29T23:15:18+0200", + "fUpdateAge": "4 months", + "actions": ["comment", "assign", "assign_to_me", "plan", "set_severity"], + "transitions": ["unconfirm", "resolve", "falsepositive"] + }, + { + "key": "e4de6481-7bfb-460a-8b3c-24459f9561d3", + "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", + "componentId": 19983, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-batch", + "rule": "squid:S1135", + "status": "CONFIRMED", + "severity": "INFO", + "message": "Complete the task associated to this TODO comment.", + "line": 239, + "author": "Simon Brandhof", + "creationDate": "2013-08-09T16:04:33+0200", + "updateDate": "2014-07-29T23:15:18+0200", + "fUpdateAge": "4 months", + "actions": ["comment", "assign", "assign_to_me", "plan", "set_severity"], + "transitions": ["unconfirm", "resolve", "falsepositive"] + }, + { + "key": "59fc17f7-c977-4cb6-8f04-fbe88e4b9186", + "component": "org.codehaus.sonar:sonar-batch:src/main/java/org/sonar/batch/index/Cache.java", + "componentId": 19983, + "project": "org.codehaus.sonar:sonar", + "subProject": "org.codehaus.sonar:sonar-batch", + "rule": "squid:S1192", + "status": "CONFIRMED", + "severity": "MINOR", + "message": "Define a constant instead of duplicating this literal \"Fail to get keys from cache \" 3 times.", + "line": 257, + "debt": "10min", + "author": "simon.brandhof@gmail.com", + "creationDate": "2014-02-20T07:48:16+0100", + "updateDate": "2014-02-24T16:57:34+0100", + "fUpdateAge": "9 months", + "actions": ["comment", "assign", "assign_to_me", "plan", "set_severity"], + "transitions": ["unconfirm", "resolve", "falsepositive"] + } +], "rules": [ + { + "key": "common-java:DuplicatedBlocks", + "name": "Duplicated blocks", + "lang": "java", + "desc": "

An issue is created on a file as soon as there is a block of duplicated code on this file. It gives the number of blocks in the file.

", + "status": "READY", + "langName": "Java" + }, + { + "key": "squid:S1192", + "name": "String literals should not be duplicated", + "lang": "java", + "desc": "

\n Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.\n On the other hand, constants can be referenced from many places, but only need to be updated in a single place.\n

\n\n

Non Compliant Code Example

\n\n
\npublic void run() {\n  prepare(\"action1\");                              // Non-Compliant - \"action1\" is duplicated 3 times\n  execute(\"action1\");\n  release(\"action1\");\n}\n\n@SuppressWarning(\"all\")                            // Compliant - annotations are excluded\nprivate void method1() { /* ... */ }\n@SuppressWarning(\"all\")\nprivate void method2() { /* ... */ }\n\npublic String method3(String a) {\n  System.out.println(\"'\" + a + \"'\");               // Compliant - literal \"'\" has less than 5 characters and is excluded\n  return \"\";                                       // Compliant - literal \"\" has less than 5 characters and is excluded\n}\n
\n\n

Compliant Code Example

\n\n
\nprivate static final String ACTION_1 = \"action1\";  // Compliant\n\npublic void run() {\n  prepare(ACTION_1);                               // Compliant\n  execute(ACTION_1);\n  release(ACTION_1);\n}\n
\n\n

Exceptions

\n

To prevent generating some false-positives, literals having less than 5 characters are excluded.

", + "status": "READY", + "langName": "Java" + }, + { + "key": "squid:S1135", + "name": "TODO tags should be handled", + "lang": "java", + "desc": "

\nTODO tags are commonly used to mark places where some more code is required, but which the developer wants to implement later.\nSometimes the developer will not have the time or will simply forget to get back to that tag.\nThis rule is meant to track those tags, and ensure that they do not go unnoticed.\n

\n\n

The following code illustrates this rule:

\n\n
\nvoid doSomething() {\n  // TODO\n}\n
", + "status": "READY", + "langName": "Java" + } +], "users": [ + { + "login": "admin", + "name": "Admin Admin", + "active": true, + "email": "admin@sonarsource.com" + } +], "languages": [ + { + "key": "js", + "name": "JavaScript" + }, + { + "key": "java", + "name": "Java" + } +], "maxResultsReached": false, "paging": { + "pageIndex": 1, + "pageSize": 100, + "total": 6, + "fTotal": "6", + "pages": 1 +}} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/lines.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/lines.json new file mode 100644 index 00000000000..e33d02b2465 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/lines.json @@ -0,0 +1,3868 @@ +{"sources": [ + { + "line": 1, + "code": "/*", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 2, + "code": " * SonarQube, open source software quality management tool.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b1436788cfc71b23cc3e3c15400a6c630c914bec", + "scmDate": "2013-04-21T11:58:14+0200" + }, + { + "line": 3, + "code": " * Copyright (C) 2008-2014 SonarSource", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "57ae3026c36ae3b0b71756d6161124b1ae594c53", + "scmDate": "2014-03-11T17:52:41+0100" + }, + { + "line": 4, + "code": " * mailto:contact AT sonarsource DOT com", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 5, + "code": " *", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 6, + "code": " * SonarQube is free software; you can redistribute it and/or", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b1436788cfc71b23cc3e3c15400a6c630c914bec", + "scmDate": "2013-04-21T11:58:14+0200" + }, + { + "line": 7, + "code": " * modify it under the terms of the GNU Lesser General Public", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 8, + "code": " * License as published by the Free Software Foundation; either", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 9, + "code": " * version 3 of the License, or (at your option) any later version.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 10, + "code": " *", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 11, + "code": " * SonarQube is distributed in the hope that it will be useful,", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b1436788cfc71b23cc3e3c15400a6c630c914bec", + "scmDate": "2013-04-21T11:58:14+0200" + }, + { + "line": 12, + "code": " * but WITHOUT ANY WARRANTY; without even the implied warranty of", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 13, + "code": " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 14, + "code": " * Lesser General Public License for more details.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 15, + "code": " *", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 16, + "code": " * You should have received a copy of the GNU Lesser General Public License", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "ce63bd4c293fe7a1fa066d73860bbaf4e1f5a608", + "scmDate": "2013-04-22T09:37:03+0200" + }, + { + "line": 17, + "code": " * along with this program; if not, write to the Free Software Foundation,", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "ce63bd4c293fe7a1fa066d73860bbaf4e1f5a608", + "scmDate": "2013-04-22T09:37:03+0200" + }, + { + "line": 18, + "code": " * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "ce63bd4c293fe7a1fa066d73860bbaf4e1f5a608", + "scmDate": "2013-04-22T09:37:03+0200" + }, + { + "line": 19, + "code": " */", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 20, + "code": "package org.sonar.batch.index;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 21, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 22, + "code": "import com.google.common.collect.Sets;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 23, + "code": "import com.persistit.Exchange;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 24, + "code": "import com.persistit.Key;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 25, + "code": "import com.persistit.KeyFilter;", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 26, + "code": "import com.persistit.exception.PersistitException;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 27, + "code": "import org.apache.commons.lang.builder.ToStringBuilder;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 28, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 29, + "code": "import javax.annotation.CheckForNull;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 30, + "code": "", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "171cd79c0b5152461434951ed5d6e5e58849a7b7", + "scmDate": "2014-04-23T14:41:32+0200" + }, + { + "line": 31, + "code": "import java.util.Iterator;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 32, + "code": "import java.util.NoSuchElementException;", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 33, + "code": "import java.util.Set;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 34, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 35, + "code": "/**", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 36, + "code": " * <p>", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 37, + "code": " * This cache is not thread-safe, due to direct usage of {@link com.persistit.Exchange}", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 38, + "code": " * </p>", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 39, + "code": " */", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 40, + "code": "public class Cache<V> {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "6074164392edd3db2dfdfd21d05cd56c19e2b0e6", + "scmDate": "2014-07-25T16:31:45+0200" + }, + { + "line": 41, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 42, + "code": " private final String name;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 43, + "code": " private final Exchange exchange;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 44, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 45, + "code": " Cache(String name, Exchange exchange) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 46, + "code": " this.name = name;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 47, + "code": " this.exchange = exchange;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 48, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 49, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 50, + "code": " public Cache<V> put(Object key, V value) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 51, + "code": " resetKey(key);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 52, + "code": " return doPut(value);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 53, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 54, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 55, + "code": " public Cache<V> put(Object firstKey, Object secondKey, V value) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 56, + "code": " resetKey(firstKey, secondKey);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 57, + "code": " return doPut(value);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 58, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 59, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 60, + "code": " public Cache<V> put(Object firstKey, Object secondKey, Object thirdKey, V value) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 61, + "code": " resetKey(firstKey, secondKey, thirdKey);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 62, + "code": " return doPut(value);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 63, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 64, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 65, + "code": " public Cache<V> put(Object[] key, V value) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 66, + "code": " resetKey(key);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 67, + "code": " return doPut(value);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 68, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 69, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 70, + "code": " private Cache<V> doPut(V value) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 71, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 72, + "code": " exchange.getValue().put(value);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 73, + "code": " exchange.store();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 74, + "code": " return this;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 75, + "code": " } catch (Exception e) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 76, + "code": " throw new IllegalStateException(\"Fail to put element in the cache \" + name, e);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "lineHits": 1 + }, + { + "line": 77, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 78, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 79, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 80, + "code": " /**", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 81, + "code": " * Returns the value object associated with keys, or null if not found.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 82, + "code": " */", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 83, + "code": " public V get(Object key) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 84, + "code": " resetKey(key);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 85, + "code": " return doGet();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 86, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 87, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 88, + "code": " /**", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 89, + "code": " * Returns the value object associated with keys, or null if not found.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 90, + "code": " */", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 91, + "code": " @CheckForNull", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 92, + "code": " public V get(Object firstKey, Object secondKey) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 93, + "code": " resetKey(firstKey, secondKey);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 94, + "code": " return doGet();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 95, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 96, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 97, + "code": " /**", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 98, + "code": " * Returns the value object associated with keys, or null if not found.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 99, + "code": " */", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 100, + "code": " @CheckForNull", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 101, + "code": " public V get(Object firstKey, Object secondKey, Object thirdKey) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 102, + "code": " resetKey(firstKey, secondKey, thirdKey);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 103, + "code": " return doGet();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 104, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 105, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 106, + "code": " /**", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 107, + "code": " * Returns the value object associated with keys, or null if not found.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 108, + "code": " */", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 109, + "code": " @CheckForNull", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 110, + "code": " public V get(Object[] key) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 111, + "code": " resetKey(key);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 112, + "code": " return doGet();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 113, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 114, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 115, + "code": " @SuppressWarnings(\"unchecked\")", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 116, + "code": " @CheckForNull", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 117, + "code": " private V doGet() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 118, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 119, + "code": " exchange.fetch();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 120, + "code": " if (!exchange.getValue().isDefined()) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1, + "conditions": 2, + "coveredConditions": 2 + }, + { + "line": 121, + "code": " return null;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 122, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 123, + "code": " return (V) exchange.getValue().get();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 124, + "code": " } catch (Exception e) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 0 + }, + { + "line": 125, + "code": " // TODO add parameters to message", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e108f5de333cf36aff978aa03940590f9caca9fc", + "scmDate": "2013-10-10T12:18:02+0200" + }, + { + "line": 126, + "code": " throw new IllegalStateException(\"Fail to get element from cache \" + name, e);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "lineHits": 0 + }, + { + "line": 127, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 128, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 129, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 130, + "code": " public boolean containsKey(Object key) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 131, + "code": " resetKey(key);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 132, + "code": " return doContainsKey();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 133, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 134, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 135, + "code": " public boolean containsKey(Object firstKey, Object secondKey) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 136, + "code": " resetKey(firstKey, secondKey);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 137, + "code": " return doContainsKey();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 138, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 139, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 140, + "code": " public boolean containsKey(Object firstKey, Object secondKey, Object thirdKey) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 141, + "code": " resetKey(firstKey, secondKey, thirdKey);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 142, + "code": " return doContainsKey();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 143, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 144, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 145, + "code": " public boolean containsKey(Object[] key) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 146, + "code": " resetKey(key);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 147, + "code": " return doContainsKey();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 148, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 149, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 150, + "code": " private boolean doContainsKey() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 151, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e108f5de333cf36aff978aa03940590f9caca9fc", + "scmDate": "2013-10-10T12:18:02+0200" + }, + { + "line": 152, + "code": " exchange.fetch();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e108f5de333cf36aff978aa03940590f9caca9fc", + "scmDate": "2013-10-10T12:18:02+0200", + "lineHits": 1 + }, + { + "line": 153, + "code": " return exchange.isValueDefined();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e108f5de333cf36aff978aa03940590f9caca9fc", + "scmDate": "2013-10-10T12:18:02+0200", + "lineHits": 1 + }, + { + "line": 154, + "code": " } catch (Exception e) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e108f5de333cf36aff978aa03940590f9caca9fc", + "scmDate": "2013-10-10T12:18:02+0200", + "lineHits": 0 + }, + { + "line": 155, + "code": " // TODO add parameters to message", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e108f5de333cf36aff978aa03940590f9caca9fc", + "scmDate": "2013-10-10T12:18:02+0200" + }, + { + "line": 156, + "code": " throw new IllegalStateException(\"Fail to check if element is in cache \" + name, e);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e108f5de333cf36aff978aa03940590f9caca9fc", + "scmDate": "2013-10-10T12:18:02+0200", + "lineHits": 0 + }, + { + "line": 157, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e108f5de333cf36aff978aa03940590f9caca9fc", + "scmDate": "2013-10-10T12:18:02+0200" + }, + { + "line": 158, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e108f5de333cf36aff978aa03940590f9caca9fc", + "scmDate": "2013-10-10T12:18:02+0200" + }, + { + "line": 159, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e108f5de333cf36aff978aa03940590f9caca9fc", + "scmDate": "2013-10-10T12:18:02+0200" + }, + { + "line": 160, + "code": " public boolean remove(Object key) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 161, + "code": " resetKey(key);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 162, + "code": " return doRemove();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 163, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 164, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 165, + "code": " public boolean remove(Object firstKey, Object secondKey) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 166, + "code": " resetKey(firstKey, secondKey);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 167, + "code": " return doRemove();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 168, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 169, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 170, + "code": " public boolean remove(Object firstKey, Object secondKey, Object thirdKey) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 171, + "code": " resetKey(firstKey, secondKey, thirdKey);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 172, + "code": " return doRemove();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 173, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 174, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 175, + "code": " public boolean remove(Object[] key) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 176, + "code": " resetKey(key);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 177, + "code": " return doRemove();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 178, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 179, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 180, + "code": " private boolean doRemove() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 181, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 182, + "code": " return exchange.remove();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "6f1161efb92298ace498df544e38f6f97216ec36", + "scmDate": "2013-04-26T15:19:16+0200", + "lineHits": 1 + }, + { + "line": 183, + "code": " } catch (Exception e) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 0 + }, + { + "line": 184, + "code": " // TODO add parameters to message", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e108f5de333cf36aff978aa03940590f9caca9fc", + "scmDate": "2013-10-10T12:18:02+0200" + }, + { + "line": 185, + "code": " throw new IllegalStateException(\"Fail to get element from cache \" + name, e);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "lineHits": 0 + }, + { + "line": 186, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 187, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 188, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 189, + "code": " /**", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 190, + "code": " * Removes everything in the specified group.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 191, + "code": " *", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 192, + "code": " * @param group The group name.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 193, + "code": " */", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 194, + "code": " public Cache<V> clear(Object key) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 195, + "code": " resetKey(key);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 196, + "code": " return doClear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 197, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 198, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 199, + "code": " public Cache<V> clear(Object firstKey, Object secondKey) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 200, + "code": " resetKey(firstKey, secondKey);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 201, + "code": " return doClear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 202, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 203, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 204, + "code": " public Cache<V> clear(Object firstKey, Object secondKey, Object thirdKey) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 205, + "code": " resetKey(firstKey, secondKey, thirdKey);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 206, + "code": " return doClear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 207, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 208, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 209, + "code": " public Cache<V> clear(Object[] key) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 210, + "code": " resetKey(key);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 211, + "code": " return doClear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 212, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 213, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 214, + "code": " private Cache<V> doClear() {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 215, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 216, + "code": " Key to = new Key(exchange.getKey());", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 217, + "code": " to.append(Key.AFTER);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 218, + "code": " exchange.removeKeyRange(exchange.getKey(), to);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 219, + "code": " return this;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 220, + "code": " } catch (Exception e) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 0 + }, + { + "line": 221, + "code": " throw new IllegalStateException(\"Fail to clear values from cache \" + name, e);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 222, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 223, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 224, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 225, + "code": " /**", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 226, + "code": " * Clears the default as well as all group caches.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 227, + "code": " */", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 228, + "code": " public void clear() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 229, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 230, + "code": " exchange.clear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 231, + "code": " exchange.removeAll();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 232, + "code": " } catch (Exception e) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 0 + }, + { + "line": 233, + "code": " throw new IllegalStateException(\"Fail to clear cache\", e);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 0 + }, + { + "line": 234, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 235, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 236, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 237, + "code": " /**", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 238, + "code": " * Returns the set of cache keys associated with this group.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 239, + "code": " * TODO implement a lazy-loading equivalent with Iterator/Iterable", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 240, + "code": " *", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 241, + "code": " * @param group The group.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 242, + "code": " * @return The set of cache keys for this group.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 243, + "code": " */", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 244, + "code": " @SuppressWarnings(\"rawtypes\")", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 245, + "code": " public Set keySet(Object key) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 246, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 247, + "code": " Set<Object> keys = Sets.newLinkedHashSet();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 248, + "code": " exchange.clear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 249, + "code": " Exchange iteratorExchange = new Exchange(exchange);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 250, + "code": " iteratorExchange.append(key);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 251, + "code": " iteratorExchange.append(Key.BEFORE);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 252, + "code": " while (iteratorExchange.next(false)) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1, + "conditions": 2, + "coveredConditions": 2 + }, + { + "line": 253, + "code": " keys.add(iteratorExchange.getKey().indexTo(-1).decode());", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 254, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 255, + "code": " return keys;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 256, + "code": " } catch (Exception e) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 0 + }, + { + "line": 257, + "code": " throw new IllegalStateException(\"Fail to get keys from cache \" + name, e);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "lineHits": 0 + }, + { + "line": 258, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 259, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 260, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 261, + "code": " @SuppressWarnings(\"rawtypes\")", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 262, + "code": " public Set keySet(Object firstKey, Object secondKey) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 263, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 264, + "code": " Set<Object> keys = Sets.newLinkedHashSet();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 265, + "code": " exchange.clear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 266, + "code": " Exchange iteratorExchange = new Exchange(exchange);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 267, + "code": " iteratorExchange.append(firstKey);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 268, + "code": " iteratorExchange.append(secondKey);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 269, + "code": " iteratorExchange.append(Key.BEFORE);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 270, + "code": " while (iteratorExchange.next(false)) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1, + "conditions": 2, + "coveredConditions": 2 + }, + { + "line": 271, + "code": " keys.add(iteratorExchange.getKey().indexTo(-1).decode());", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 272, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 273, + "code": " return keys;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 274, + "code": " } catch (Exception e) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 275, + "code": " throw new IllegalStateException(\"Fail to get keys from cache \" + name, e);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 276, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 277, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 278, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 279, + "code": " /**", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 280, + "code": " * Returns the set of keys associated with this cache.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 281, + "code": " *", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 282, + "code": " * @return The set containing the keys for this cache.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 283, + "code": " */", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 284, + "code": " public Set<Object> keySet() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 285, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 286, + "code": " Set<Object> keys = Sets.newLinkedHashSet();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 287, + "code": " exchange.clear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 288, + "code": " Exchange iteratorExchange = new Exchange(exchange);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 289, + "code": " iteratorExchange.append(Key.BEFORE);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 290, + "code": " while (iteratorExchange.next(false)) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1, + "conditions": 2, + "coveredConditions": 2 + }, + { + "line": 291, + "code": " keys.add(iteratorExchange.getKey().indexTo(-1).decode());", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 292, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 293, + "code": " return keys;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 294, + "code": " } catch (Exception e) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 295, + "code": " throw new IllegalStateException(\"Fail to get keys from cache \" + name, e);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 296, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 297, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 298, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 299, + "code": " /**", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 300, + "code": " * Lazy-loading values for given keys", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "171cd79c0b5152461434951ed5d6e5e58849a7b7", + "scmDate": "2014-04-23T14:41:32+0200" + }, + { + "line": 301, + "code": " */", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "171cd79c0b5152461434951ed5d6e5e58849a7b7", + "scmDate": "2014-04-23T14:41:32+0200" + }, + { + "line": 302, + "code": " public Iterable<V> values(Object firstKey, Object secondKey) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "171cd79c0b5152461434951ed5d6e5e58849a7b7", + "scmDate": "2014-04-23T14:41:32+0200" + }, + { + "line": 303, + "code": " try {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "171cd79c0b5152461434951ed5d6e5e58849a7b7", + "scmDate": "2014-04-23T14:41:32+0200" + }, + { + "line": 304, + "code": " exchange.clear();", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "171cd79c0b5152461434951ed5d6e5e58849a7b7", + "scmDate": "2014-04-23T14:41:32+0200", + "lineHits": 1 + }, + { + "line": 305, + "code": " exchange.append(firstKey).append(secondKey).append(Key.BEFORE);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "171cd79c0b5152461434951ed5d6e5e58849a7b7", + "scmDate": "2014-04-23T14:41:32+0200", + "lineHits": 1 + }, + { + "line": 306, + "code": " Exchange iteratorExchange = new Exchange(exchange);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "171cd79c0b5152461434951ed5d6e5e58849a7b7", + "scmDate": "2014-04-23T14:41:32+0200", + "lineHits": 1 + }, + { + "line": 307, + "code": " KeyFilter filter = new KeyFilter().append(KeyFilter.simpleTerm(firstKey)).append(KeyFilter.simpleTerm(secondKey));", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 308, + "code": " return new ValueIterable<V>(iteratorExchange, filter);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 309, + "code": " } catch (Exception e) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "171cd79c0b5152461434951ed5d6e5e58849a7b7", + "scmDate": "2014-04-23T14:41:32+0200", + "lineHits": 0 + }, + { + "line": 310, + "code": " throw failToGetValues(e);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "904b462c56317b1fb5a616534bd58aa9c9097d0b", + "scmDate": "2014-06-20T14:13:01+0200", + "lineHits": 0 + }, + { + "line": 311, + "code": " }", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "171cd79c0b5152461434951ed5d6e5e58849a7b7", + "scmDate": "2014-04-23T14:41:32+0200" + }, + { + "line": 312, + "code": " }", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "904b462c56317b1fb5a616534bd58aa9c9097d0b", + "scmDate": "2014-06-20T14:13:01+0200" + }, + { + "line": 313, + "code": "", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "904b462c56317b1fb5a616534bd58aa9c9097d0b", + "scmDate": "2014-06-20T14:13:01+0200" + }, + { + "line": 314, + "code": " private IllegalStateException failToGetValues(Exception e) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "904b462c56317b1fb5a616534bd58aa9c9097d0b", + "scmDate": "2014-06-20T14:13:01+0200" + }, + { + "line": 315, + "code": " return new IllegalStateException(\"Fail to get values from cache \" + name, e);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "904b462c56317b1fb5a616534bd58aa9c9097d0b", + "scmDate": "2014-06-20T14:13:01+0200", + "lineHits": 0 + }, + { + "line": 316, + "code": " }", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "171cd79c0b5152461434951ed5d6e5e58849a7b7", + "scmDate": "2014-04-23T14:41:32+0200" + }, + { + "line": 317, + "code": "", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "171cd79c0b5152461434951ed5d6e5e58849a7b7", + "scmDate": "2014-04-23T14:41:32+0200" + }, + { + "line": 318, + "code": " /**", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "171cd79c0b5152461434951ed5d6e5e58849a7b7", + "scmDate": "2014-04-23T14:41:32+0200" + }, + { + "line": 319, + "code": " * Lazy-loading values for a given key", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 320, + "code": " */", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 321, + "code": " public Iterable<V> values(Object firstKey) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 322, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 323, + "code": " exchange.clear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 324, + "code": " exchange.append(firstKey).append(Key.BEFORE);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 325, + "code": " Exchange iteratorExchange = new Exchange(exchange);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 326, + "code": " KeyFilter filter = new KeyFilter().append(KeyFilter.simpleTerm(firstKey));", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 327, + "code": " return new ValueIterable<V>(iteratorExchange, filter);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 328, + "code": " } catch (Exception e) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "46395126b184c343df5471a147cdb48133f59f6f", + "scmDate": "2014-04-23T14:41:32+0200", + "lineHits": 0 + }, + { + "line": 329, + "code": " throw failToGetValues(e);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "904b462c56317b1fb5a616534bd58aa9c9097d0b", + "scmDate": "2014-06-20T14:13:01+0200", + "lineHits": 0 + }, + { + "line": 330, + "code": " }", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "46395126b184c343df5471a147cdb48133f59f6f", + "scmDate": "2014-04-23T14:41:32+0200" + }, + { + "line": 331, + "code": " }", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "46395126b184c343df5471a147cdb48133f59f6f", + "scmDate": "2014-04-23T14:41:32+0200" + }, + { + "line": 332, + "code": "", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "46395126b184c343df5471a147cdb48133f59f6f", + "scmDate": "2014-04-23T14:41:32+0200" + }, + { + "line": 333, + "code": " /**", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "46395126b184c343df5471a147cdb48133f59f6f", + "scmDate": "2014-04-23T14:41:32+0200" + }, + { + "line": 334, + "code": " * Lazy-loading values", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 335, + "code": " */", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 336, + "code": " public Iterable<V> values() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 337, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 338, + "code": " exchange.clear().append(Key.BEFORE);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 339, + "code": " Exchange iteratorExchange = new Exchange(exchange);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 1 + }, + { + "line": 340, + "code": " KeyFilter filter = new KeyFilter().append(KeyFilter.ALL);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 341, + "code": " return new ValueIterable<V>(iteratorExchange, filter);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 342, + "code": " } catch (Exception e) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200", + "lineHits": 0 + }, + { + "line": 343, + "code": " throw failToGetValues(e);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "904b462c56317b1fb5a616534bd58aa9c9097d0b", + "scmDate": "2014-06-20T14:13:01+0200", + "lineHits": 0 + }, + { + "line": 344, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 345, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 346, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 347, + "code": " public Iterable<Entry<V>> entries() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 348, + "code": " exchange.clear().to(Key.BEFORE);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 1 + }, + { + "line": 349, + "code": " KeyFilter filter = new KeyFilter().append(KeyFilter.ALL);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 350, + "code": " return new EntryIterable<V>(new Exchange(exchange), filter);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 351, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 352, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 353, + "code": " public Iterable<Entry<V>> entries(Object firstKey) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 354, + "code": " exchange.clear().append(firstKey).append(Key.BEFORE);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 355, + "code": " KeyFilter filter = new KeyFilter().append(KeyFilter.simpleTerm(firstKey));", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 356, + "code": " return new EntryIterable<V>(new Exchange(exchange), filter);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 357, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 358, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 359, + "code": " private void resetKey(Object key) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 360, + "code": " exchange.clear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 361, + "code": " exchange.append(key);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 362, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 363, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 364, + "code": " private void resetKey(Object first, Object second) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 365, + "code": " exchange.clear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 366, + "code": " exchange.append(first).append(second);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 367, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 368, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 369, + "code": " private void resetKey(Object first, Object second, Object third) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 370, + "code": " exchange.clear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 371, + "code": " exchange.append(first).append(second).append(third);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 372, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 373, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 374, + "code": " private void resetKey(Object[] keys) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 375, + "code": " exchange.clear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 376, + "code": " for (Object o : keys) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0, + "conditions": 2, + "coveredConditions": 0 + }, + { + "line": 377, + "code": " exchange.append(o);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 378, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 379, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 0 + }, + { + "line": 380, + "code": "", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "7b301db8c7e3000ff2a04fce5534e45e7d973a1f", + "scmDate": "2014-04-25T11:17:09+0200" + }, + { + "line": 381, + "code": " //", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 382, + "code": " // LAZY ITERATORS AND ITERABLES", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 383, + "code": " //", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 384, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 385, + "code": " private static class ValueIterable<T> implements Iterable<T> {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "6074164392edd3db2dfdfd21d05cd56c19e2b0e6", + "scmDate": "2014-07-25T16:31:45+0200" + }, + { + "line": 386, + "code": " private final Iterator<T> iterator;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 387, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 388, + "code": " private ValueIterable(Exchange exchange, KeyFilter keyFilter) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 389, + "code": " this.iterator = new ValueIterator<T>(exchange, keyFilter);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 390, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "lineHits": 1 + }, + { + "line": 391, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 392, + "code": " @Override", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 393, + "code": " public Iterator<T> iterator() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 394, + "code": " return iterator;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "lineHits": 1 + }, + { + "line": 395, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 396, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 397, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 398, + "code": " private static class ValueIterator<T> implements Iterator<T> {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "6074164392edd3db2dfdfd21d05cd56c19e2b0e6", + "scmDate": "2014-07-25T16:31:45+0200" + }, + { + "line": 399, + "code": " private final Exchange exchange;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 400, + "code": " private final KeyFilter keyFilter;", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 401, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 402, + "code": " private ValueIterator(Exchange exchange, KeyFilter keyFilter) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 403, + "code": " this.exchange = exchange;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "lineHits": 1, + "duplicated": true + }, + { + "line": 404, + "code": " this.keyFilter = keyFilter;", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1, + "duplicated": true + }, + { + "line": 405, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "lineHits": 1, + "duplicated": true + }, + { + "line": 406, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "duplicated": true + }, + { + "line": 407, + "code": " @Override", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "duplicated": true + }, + { + "line": 408, + "code": " public boolean hasNext() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "duplicated": true + }, + { + "line": 409, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "duplicated": true + }, + { + "line": 410, + "code": " return exchange.hasNext(keyFilter);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1, + "duplicated": true + }, + { + "line": 411, + "code": " } catch (PersistitException e) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "lineHits": 0, + "duplicated": true + }, + { + "line": 412, + "code": " throw new IllegalStateException(e);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "lineHits": 0, + "duplicated": true + }, + { + "line": 413, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "duplicated": true + }, + { + "line": 414, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "duplicated": true + }, + { + "line": 415, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "duplicated": true + }, + { + "line": 416, + "code": " @SuppressWarnings(\"unchecked\")", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "duplicated": true + }, + { + "line": 417, + "code": " @Override", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "duplicated": true + }, + { + "line": 418, + "code": " public T next() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 419, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 420, + "code": " exchange.next(keyFilter);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 421, + "code": " } catch (PersistitException e) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 422, + "code": " throw new IllegalStateException(e);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 0 + }, + { + "line": 423, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 424, + "code": " if (exchange.getValue().isDefined()) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200", + "lineHits": 1, + "conditions": 2, + "coveredConditions": 1 + }, + { + "line": 425, + "code": " return (T) exchange.getValue().get();", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 426, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 427, + "code": " throw new NoSuchElementException();", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 0 + }, + { + "line": 428, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 429, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 430, + "code": " @Override", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 431, + "code": " public void remove() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "babb50a4f143c312df1ba45955d3d589ecb2845f", + "scmDate": "2013-05-29T14:27:38+0200" + }, + { + "line": 432, + "code": " throw new UnsupportedOperationException(\"Removing an item is not supported\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "34cce8e330192c56a159a856ebd8072d38299087", + "scmDate": "2014-02-24T14:21:50+0100", + "lineHits": 0 + }, + { + "line": 433, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 434, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 435, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 436, + "code": " private static class EntryIterable<T> implements Iterable<Entry<T>> {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "6074164392edd3db2dfdfd21d05cd56c19e2b0e6", + "scmDate": "2014-07-25T16:31:45+0200" + }, + { + "line": 437, + "code": " private final EntryIterator<T> it;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 438, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 439, + "code": " private EntryIterable(Exchange exchange, KeyFilter keyFilter) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 440, + "code": " it = new EntryIterator<T>(exchange, keyFilter);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 441, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 1 + }, + { + "line": 442, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 443, + "code": " @Override", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 444, + "code": " public Iterator<Entry<T>> iterator() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 445, + "code": " return it;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 1 + }, + { + "line": 446, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 447, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 448, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 449, + "code": " private static class EntryIterator<T> implements Iterator<Entry<T>> {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "6074164392edd3db2dfdfd21d05cd56c19e2b0e6", + "scmDate": "2014-07-25T16:31:45+0200" + }, + { + "line": 450, + "code": " private final Exchange exchange;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 451, + "code": " private final KeyFilter keyFilter;", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 452, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 453, + "code": " private EntryIterator(Exchange exchange, KeyFilter keyFilter) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 454, + "code": " this.exchange = exchange;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 1, + "duplicated": true + }, + { + "line": 455, + "code": " this.keyFilter = keyFilter;", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1, + "duplicated": true + }, + { + "line": 456, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 1, + "duplicated": true + }, + { + "line": 457, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "duplicated": true + }, + { + "line": 458, + "code": " @Override", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "duplicated": true + }, + { + "line": 459, + "code": " public boolean hasNext() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "duplicated": true + }, + { + "line": 460, + "code": " try {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "duplicated": true + }, + { + "line": 461, + "code": " return exchange.hasNext(keyFilter);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1, + "duplicated": true + }, + { + "line": 462, + "code": " } catch (PersistitException e) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 0, + "duplicated": true + }, + { + "line": 463, + "code": " throw new IllegalStateException(e);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 0, + "duplicated": true + }, + { + "line": 464, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "duplicated": true + }, + { + "line": 465, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "duplicated": true + }, + { + "line": 466, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "duplicated": true + }, + { + "line": 467, + "code": " @SuppressWarnings(\"unchecked\")", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "duplicated": true + }, + { + "line": 468, + "code": " @Override", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "duplicated": true + }, + { + "line": 469, + "code": " public Entry<T> next() {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 470, + "code": " try {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 471, + "code": " exchange.next(keyFilter);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 472, + "code": " } catch (PersistitException e) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 0 + }, + { + "line": 473, + "code": " throw new IllegalStateException(e);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 0 + }, + { + "line": 474, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 1 + }, + { + "line": 475, + "code": " if (exchange.getValue().isDefined()) {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1, + "conditions": 2, + "coveredConditions": 1 + }, + { + "line": 476, + "code": " T value = (T) exchange.getValue().get();", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 477, + "code": " Key key = exchange.getKey();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 1 + }, + { + "line": 478, + "code": " Object[] array = new Object[key.getDepth()];", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 479, + "code": " for (int i = 0; i < key.getDepth(); i++) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1, + "conditions": 2, + "coveredConditions": 2 + }, + { + "line": 480, + "code": " array[i] = key.indexTo(i - key.getDepth()).decode();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 481, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 482, + "code": " return new Entry<T>(array, value);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 1 + }, + { + "line": 483, + "code": " }", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 484, + "code": " throw new NoSuchElementException();", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200", + "lineHits": 0 + }, + { + "line": 485, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 486, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 487, + "code": " @Override", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 488, + "code": " public void remove() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 489, + "code": " throw new UnsupportedOperationException(\"Removing an item is not supported\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "34cce8e330192c56a159a856ebd8072d38299087", + "scmDate": "2014-02-24T14:21:50+0100", + "lineHits": 0 + }, + { + "line": 490, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 491, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 492, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 493, + "code": " public static class Entry<V> {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "6074164392edd3db2dfdfd21d05cd56c19e2b0e6", + "scmDate": "2014-07-25T16:31:45+0200" + }, + { + "line": 494, + "code": " private final Object[] key;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 495, + "code": " private final V value;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 496, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 497, + "code": " Entry(Object[] key, V value) {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100", + "lineHits": 1 + }, + { + "line": 498, + "code": " this.key = key;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 1 + }, + { + "line": 499, + "code": " this.value = value;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 1 + }, + { + "line": 500, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 1 + }, + { + "line": 501, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 502, + "code": " public Object[] key() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 503, + "code": " return key;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 1 + }, + { + "line": 504, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 505, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 506, + "code": " @CheckForNull", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 507, + "code": " public V value() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 508, + "code": " return value;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 1 + }, + { + "line": 509, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 510, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 511, + "code": " @Override", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 512, + "code": " public String toString() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 513, + "code": " return ToStringBuilder.reflectionToString(this);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200", + "lineHits": 0 + }, + { + "line": 514, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 515, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 516, + "code": "", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "43fc31f75a2de06b23faefb0d2bbf1dd97290232", + "scmDate": "2014-05-05T16:43:19+0200" + }, + { + "line": 517, + "code": "}", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 518, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + } +]} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/resources-without-ncloc-data.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/resources-without-ncloc-data.json similarity index 100% rename from server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/resources-without-ncloc-data.json rename to server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/resources-without-ncloc-data.json diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/resources.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/resources.json similarity index 100% rename from server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/resources.json rename to server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/resources.json diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/scm.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/scm.json similarity index 100% rename from server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/scm.json rename to server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/scm.json diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/source.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/source.json similarity index 100% rename from server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/source.json rename to server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/source.json diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/test-cases.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/test-cases.json similarity index 100% rename from server/sonar-web/src/main/js/tests/e2e/tests/component-viewer-spec/test-cases.json rename to server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/test-cases.json diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/tests/app.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/tests/app.json new file mode 100644 index 00000000000..82d58c46a47 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/tests/app.json @@ -0,0 +1,49 @@ +{ + "key": "org.codehaus.sonar:sonar-batch:src/test/java/org/sonar/batch/index/CacheTest.java", + "path": "src/test/java/org/sonar/batch/index/CacheTest.java", + "name": "CacheTest.java", + "longName": "src/test/java/org/sonar/batch/index/CacheTest.java", + "q": "UTS", + "subProject": "org.codehaus.sonar:sonar-batch", + "subProjectName": "SonarQube :: Batch", + "project": "org.codehaus.sonar:sonar", + "projectName": "SonarQube", + "fav": false, + "canMarkAsFavourite": true, + "canBulkChange": true, + "canCreateManualIssue": true, + "periods": [ + [1, "since previous analysis (2014 Dec 01)", "2014-12-01T18:51:13+0100"], + [2, "over 365 days (2013 Dec 01)", "2013-12-01T00:40:31+0100"], + [3, "since previous version (4.5 - 2014 Sep 03)", "2014-09-03T23:16:52+0200"] + ], + "severities": [], + "rules": [], + "measures": { + "fTests": "6", + "fIssues": "0" + }, + "tabs": ["scm"], + "manual_rules": [ + { + "key": "manual:api", + "name": "API" + }, + { + "key": "manual:design", + "name": "Design" + }, + { + "key": "manual:error_handling", + "name": "Error handling" + }, + { + "key": "manual:performance", + "name": "Performance" + }, + { + "key": "manual:sql_pitfalls", + "name": "SQL Pitfall" + } + ] +} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/tests/lines.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/tests/lines.json new file mode 100644 index 00000000000..becc8c92f69 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/tests/lines.json @@ -0,0 +1,1808 @@ +{"sources": [ + { + "line": 1, + "code": "/*", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 2, + "code": " * SonarQube, open source software quality management tool.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b1436788cfc71b23cc3e3c15400a6c630c914bec", + "scmDate": "2013-04-21T11:58:14+0200" + }, + { + "line": 3, + "code": " * Copyright (C) 2008-2014 SonarSource", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "57ae3026c36ae3b0b71756d6161124b1ae594c53", + "scmDate": "2014-03-11T17:52:41+0100" + }, + { + "line": 4, + "code": " * mailto:contact AT sonarsource DOT com", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 5, + "code": " *", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 6, + "code": " * SonarQube is free software; you can redistribute it and/or", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b1436788cfc71b23cc3e3c15400a6c630c914bec", + "scmDate": "2013-04-21T11:58:14+0200" + }, + { + "line": 7, + "code": " * modify it under the terms of the GNU Lesser General Public", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 8, + "code": " * License as published by the Free Software Foundation; either", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 9, + "code": " * version 3 of the License, or (at your option) any later version.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 10, + "code": " *", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 11, + "code": " * SonarQube is distributed in the hope that it will be useful,", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b1436788cfc71b23cc3e3c15400a6c630c914bec", + "scmDate": "2013-04-21T11:58:14+0200" + }, + { + "line": 12, + "code": " * but WITHOUT ANY WARRANTY; without even the implied warranty of", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 13, + "code": " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 14, + "code": " * Lesser General Public License for more details.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 15, + "code": " *", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 16, + "code": " * You should have received a copy of the GNU Lesser General Public License", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "ce63bd4c293fe7a1fa066d73860bbaf4e1f5a608", + "scmDate": "2013-04-22T09:37:03+0200" + }, + { + "line": 17, + "code": " * along with this program; if not, write to the Free Software Foundation,", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "ce63bd4c293fe7a1fa066d73860bbaf4e1f5a608", + "scmDate": "2013-04-22T09:37:03+0200" + }, + { + "line": 18, + "code": " * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "ce63bd4c293fe7a1fa066d73860bbaf4e1f5a608", + "scmDate": "2013-04-22T09:37:03+0200" + }, + { + "line": 19, + "code": " */", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 20, + "code": "package org.sonar.batch.index;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 21, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 22, + "code": "import com.google.common.collect.Iterables;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 23, + "code": "import org.junit.After;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 24, + "code": "import org.junit.Before;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 25, + "code": "import org.junit.Rule;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 26, + "code": "import org.junit.Test;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 27, + "code": "import org.junit.rules.TemporaryFolder;", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "18a4c15b060d1b56f08826bf6006d08eaf2625ec", + "scmDate": "2013-10-15T17:14:44+0200" + }, + { + "line": 28, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 29, + "code": "import static org.fest.assertions.Assertions.assertThat;", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 30, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 31, + "code": "public class CacheTest {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 32, + "code": "", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "18a4c15b060d1b56f08826bf6006d08eaf2625ec", + "scmDate": "2013-10-15T17:14:44+0200" + }, + { + "line": 33, + "code": " @Rule", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 34, + "code": " public TemporaryFolder temp = new TemporaryFolder();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 35, + "code": "", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "18a4c15b060d1b56f08826bf6006d08eaf2625ec", + "scmDate": "2013-10-15T17:14:44+0200" + }, + { + "line": 36, + "code": " Caches caches;", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "18a4c15b060d1b56f08826bf6006d08eaf2625ec", + "scmDate": "2013-10-15T17:14:44+0200" + }, + { + "line": 37, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 38, + "code": " @Before", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 39, + "code": " public void start() throws Exception {", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "18a4c15b060d1b56f08826bf6006d08eaf2625ec", + "scmDate": "2013-10-15T17:14:44+0200" + }, + { + "line": 40, + "code": " caches = CachesTest.createCacheOnTemp(temp);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "18a4c15b060d1b56f08826bf6006d08eaf2625ec", + "scmDate": "2013-10-15T17:14:44+0200" + }, + { + "line": 41, + "code": " caches.start();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 42, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 43, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 44, + "code": " @After", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 45, + "code": " public void stop() {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 46, + "code": " caches.stop();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 47, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 48, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 49, + "code": " @Test", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 50, + "code": " public void one_part_key() throws Exception {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 51, + "code": " Cache<String> cache = caches.createCache(\"capitals\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 52, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 53, + "code": " assertThat(cache.get(\"france\")).isNull();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 54, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 55, + "code": " cache.put(\"france\", \"paris\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 56, + "code": " cache.put(\"italy\", \"rome\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 57, + "code": " assertThat(cache.get(\"france\")).isEqualTo(\"paris\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 58, + "code": " assertThat(cache.keySet()).containsOnly(\"france\", \"italy\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 59, + "code": " assertThat(cache.keySet(\"france\")).isEmpty();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 60, + "code": " assertThat(cache.values()).containsOnly(\"paris\", \"rome\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 61, + "code": " assertThat(cache.containsKey(\"france\")).isTrue();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 62, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 63, + "code": " Cache.Entry[] entries = Iterables.toArray(cache.entries(), Cache.Entry.class);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "db81d934752174207268c49658963ba98665794b", + "scmDate": "2014-02-20T07:35:27+0100" + }, + { + "line": 64, + "code": " assertThat(entries).hasSize(2);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 65, + "code": " assertThat(entries[0].key()[0]).isEqualTo(\"france\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 66, + "code": " assertThat(entries[0].value()).isEqualTo(\"paris\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 67, + "code": " assertThat(entries[1].key()[0]).isEqualTo(\"italy\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 68, + "code": " assertThat(entries[1].value()).isEqualTo(\"rome\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 69, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 70, + "code": " cache.remove(\"france\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 71, + "code": " assertThat(cache.get(\"france\")).isNull();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 72, + "code": " assertThat(cache.get(\"italy\")).isEqualTo(\"rome\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 73, + "code": " assertThat(cache.keySet()).containsOnly(\"italy\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 74, + "code": " assertThat(cache.keySet(\"france\")).isEmpty();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 75, + "code": " assertThat(cache.containsKey(\"france\")).isFalse();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 76, + "code": " assertThat(cache.containsKey(\"italy\")).isTrue();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 77, + "code": " assertThat(cache.values()).containsOnly(\"rome\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 78, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 79, + "code": " cache.clear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 80, + "code": " assertThat(cache.values()).isEmpty();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 81, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 82, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 83, + "code": " @Test", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 84, + "code": " public void test_key_being_prefix_of_another_key() throws Exception {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "2a37a23b0ff74cd69a3a4c9053f3a2331b234097", + "scmDate": "2013-05-31T12:42:59+0200" + }, + { + "line": 85, + "code": " Cache<String> cache = caches.createCache(\"components\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 86, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "2a37a23b0ff74cd69a3a4c9053f3a2331b234097", + "scmDate": "2013-05-31T12:42:59+0200" + }, + { + "line": 87, + "code": " cache.put(\"struts-el:org.apache.strutsel.taglib.html.ELButtonTag\", \"the Tag\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "2a37a23b0ff74cd69a3a4c9053f3a2331b234097", + "scmDate": "2013-05-31T12:42:59+0200" + }, + { + "line": 88, + "code": " cache.put(\"struts-el:org.apache.strutsel.taglib.html.ELButtonTagBeanInfo\", \"the BeanInfo\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "2a37a23b0ff74cd69a3a4c9053f3a2331b234097", + "scmDate": "2013-05-31T12:42:59+0200" + }, + { + "line": 89, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "2a37a23b0ff74cd69a3a4c9053f3a2331b234097", + "scmDate": "2013-05-31T12:42:59+0200" + }, + { + "line": 90, + "code": " assertThat(cache.get(\"struts-el:org.apache.strutsel.taglib.html.ELButtonTag\")).isEqualTo(\"the Tag\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "2a37a23b0ff74cd69a3a4c9053f3a2331b234097", + "scmDate": "2013-05-31T12:42:59+0200" + }, + { + "line": 91, + "code": " assertThat(cache.get(\"struts-el:org.apache.strutsel.taglib.html.ELButtonTagBeanInfo\")).isEqualTo(\"the BeanInfo\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "2a37a23b0ff74cd69a3a4c9053f3a2331b234097", + "scmDate": "2013-05-31T12:42:59+0200" + }, + { + "line": 92, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "2a37a23b0ff74cd69a3a4c9053f3a2331b234097", + "scmDate": "2013-05-31T12:42:59+0200" + }, + { + "line": 93, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "2a37a23b0ff74cd69a3a4c9053f3a2331b234097", + "scmDate": "2013-05-31T12:42:59+0200" + }, + { + "line": 94, + "code": " @Test", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "2a37a23b0ff74cd69a3a4c9053f3a2331b234097", + "scmDate": "2013-05-31T12:42:59+0200" + }, + { + "line": 95, + "code": " public void two_parts_key() throws Exception {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 96, + "code": " Cache<String> cache = caches.createCache(\"capitals\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 97, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 98, + "code": " assertThat(cache.get(\"europe\", \"france\")).isNull();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 99, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 100, + "code": " cache.put(\"europe\", \"france\", \"paris\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 101, + "code": " cache.put(\"europe\", \"italy\", \"rome\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 102, + "code": " cache.put(\"asia\", \"china\", \"pekin\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 103, + "code": " assertThat(cache.get(\"europe\")).isNull();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 104, + "code": " assertThat(cache.get(\"europe\", \"france\")).isEqualTo(\"paris\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 105, + "code": " assertThat(cache.get(\"europe\", \"italy\")).isEqualTo(\"rome\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 106, + "code": " assertThat(cache.get(\"europe\")).isNull();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 107, + "code": " assertThat(cache.keySet(\"europe\")).containsOnly(\"france\", \"italy\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 108, + "code": " assertThat(cache.keySet()).containsOnly(\"europe\", \"asia\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 109, + "code": " assertThat(cache.containsKey(\"europe\")).isFalse();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 110, + "code": " assertThat(cache.containsKey(\"europe\", \"france\")).isTrue();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 111, + "code": " assertThat(cache.containsKey(\"europe\", \"spain\")).isFalse();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 112, + "code": " assertThat(cache.values()).containsOnly(\"paris\", \"rome\", \"pekin\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 113, + "code": " assertThat(cache.values(\"america\")).isEmpty();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 114, + "code": " assertThat(cache.values(\"europe\")).containsOnly(\"paris\", \"rome\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 115, + "code": " assertThat(cache.values(\"oceania\")).isEmpty();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 116, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 117, + "code": " Cache.Entry[] allEntries = Iterables.toArray(cache.entries(), Cache.Entry.class);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "db81d934752174207268c49658963ba98665794b", + "scmDate": "2014-02-20T07:35:27+0100" + }, + { + "line": 118, + "code": " assertThat(allEntries).hasSize(3);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 119, + "code": " assertThat(allEntries[0].key()).isEqualTo(new String[] {\"asia\", \"china\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 120, + "code": " assertThat(allEntries[0].value()).isEqualTo(\"pekin\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 121, + "code": " assertThat(allEntries[1].key()).isEqualTo(new String[] {\"europe\", \"france\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 122, + "code": " assertThat(allEntries[1].value()).isEqualTo(\"paris\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 123, + "code": " assertThat(allEntries[2].key()).isEqualTo(new String[] {\"europe\", \"italy\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 124, + "code": " assertThat(allEntries[2].value()).isEqualTo(\"rome\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 125, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 126, + "code": " Cache.Entry[] subEntries = Iterables.toArray(cache.entries(\"europe\"), Cache.Entry.class);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 127, + "code": " assertThat(subEntries).hasSize(2);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 128, + "code": " assertThat(subEntries[0].key()).isEqualTo(new String[] {\"europe\", \"france\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 129, + "code": " assertThat(subEntries[0].value()).isEqualTo(\"paris\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 130, + "code": " assertThat(subEntries[1].key()).isEqualTo(new String[] {\"europe\", \"italy\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 131, + "code": " assertThat(subEntries[1].value()).isEqualTo(\"rome\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 132, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 133, + "code": " cache.remove(\"europe\", \"france\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 134, + "code": " assertThat(cache.values()).containsOnly(\"rome\", \"pekin\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 135, + "code": " assertThat(cache.get(\"europe\", \"france\")).isNull();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 136, + "code": " assertThat(cache.get(\"europe\", \"italy\")).isEqualTo(\"rome\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 137, + "code": " assertThat(cache.containsKey(\"europe\", \"france\")).isFalse();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 138, + "code": " assertThat(cache.keySet(\"europe\")).containsOnly(\"italy\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 139, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 140, + "code": " cache.clear(\"america\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 141, + "code": " assertThat(cache.keySet()).containsOnly(\"europe\", \"asia\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 142, + "code": " cache.clear();", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 143, + "code": " assertThat(cache.keySet()).isEmpty();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 144, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 145, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 146, + "code": " @Test", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 147, + "code": " public void three_parts_key() throws Exception {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 148, + "code": " Cache<String> cache = caches.createCache(\"places\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 149, + "code": " assertThat(cache.get(\"europe\", \"france\", \"paris\")).isNull();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 150, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 151, + "code": " cache.put(\"europe\", \"france\", \"paris\", \"eiffel tower\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 152, + "code": " cache.put(\"europe\", \"france\", \"annecy\", \"lake\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 153, + "code": " cache.put(\"europe\", \"france\", \"poitiers\", \"notre dame\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 154, + "code": " cache.put(\"europe\", \"italy\", \"rome\", \"colosseum\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 155, + "code": " cache.put(\"europe2\", \"ukrania\", \"kiev\", \"dunno\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 156, + "code": " cache.put(\"asia\", \"china\", \"pekin\", \"great wall\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 157, + "code": " cache.put(\"america\", \"us\", \"new york\", \"empire state building\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 158, + "code": " assertThat(cache.get(\"europe\")).isNull();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 159, + "code": " assertThat(cache.get(\"europe\", \"france\")).isNull();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 160, + "code": " assertThat(cache.get(\"europe\", \"france\", \"paris\")).isEqualTo(\"eiffel tower\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 161, + "code": " assertThat(cache.get(\"europe\", \"france\", \"annecy\")).isEqualTo(\"lake\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 162, + "code": " assertThat(cache.get(\"europe\", \"italy\", \"rome\")).isEqualTo(\"colosseum\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 163, + "code": " assertThat(cache.keySet()).containsOnly(\"europe\", \"asia\", \"america\", \"europe2\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 164, + "code": " assertThat(cache.keySet(\"europe\")).containsOnly(\"france\", \"italy\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 165, + "code": " assertThat(cache.keySet(\"europe\", \"france\")).containsOnly(\"annecy\", \"paris\", \"poitiers\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 166, + "code": " assertThat(cache.containsKey(\"europe\")).isFalse();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 167, + "code": " assertThat(cache.containsKey(\"europe\", \"france\")).isFalse();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 168, + "code": " assertThat(cache.containsKey(\"europe\", \"france\", \"annecy\")).isTrue();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 169, + "code": " assertThat(cache.containsKey(\"europe\", \"france\", \"biarritz\")).isFalse();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 170, + "code": " assertThat(cache.values()).containsOnly(\"eiffel tower\", \"lake\", \"colosseum\", \"notre dame\", \"great wall\", \"empire state building\", \"dunno\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 171, + "code": " assertThat(cache.values(\"europe\")).containsOnly(\"eiffel tower\", \"lake\", \"colosseum\", \"notre dame\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 172, + "code": " assertThat(cache.values(\"europe\", \"france\")).containsOnly(\"eiffel tower\", \"lake\", \"notre dame\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 173, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 174, + "code": " Cache.Entry[] allEntries = Iterables.toArray(cache.entries(), Cache.Entry.class);", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "db81d934752174207268c49658963ba98665794b", + "scmDate": "2014-02-20T07:35:27+0100" + }, + { + "line": 175, + "code": " assertThat(allEntries).hasSize(7);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 176, + "code": " assertThat(allEntries[0].key()).isEqualTo(new String[] {\"america\", \"us\", \"new york\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 177, + "code": " assertThat(allEntries[0].value()).isEqualTo(\"empire state building\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 178, + "code": " assertThat(allEntries[1].key()).isEqualTo(new String[] {\"asia\", \"china\", \"pekin\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 179, + "code": " assertThat(allEntries[1].value()).isEqualTo(\"great wall\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 180, + "code": " assertThat(allEntries[2].key()).isEqualTo(new String[] {\"europe\", \"france\", \"annecy\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 181, + "code": " assertThat(allEntries[2].value()).isEqualTo(\"lake\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 182, + "code": " assertThat(allEntries[3].key()).isEqualTo(new String[] {\"europe\", \"france\", \"paris\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 183, + "code": " assertThat(allEntries[3].value()).isEqualTo(\"eiffel tower\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 184, + "code": " assertThat(allEntries[4].key()).isEqualTo(new String[] {\"europe\", \"france\", \"poitiers\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 185, + "code": " assertThat(allEntries[4].value()).isEqualTo(\"notre dame\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 186, + "code": " assertThat(allEntries[5].key()).isEqualTo(new String[] {\"europe\", \"italy\", \"rome\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 187, + "code": " assertThat(allEntries[5].value()).isEqualTo(\"colosseum\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 188, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 189, + "code": " Cache.Entry[] subEntries = Iterables.toArray(cache.entries(\"europe\"), Cache.Entry.class);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 190, + "code": " assertThat(subEntries).hasSize(4);", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 191, + "code": " assertThat(subEntries[0].key()).isEqualTo(new String[] {\"europe\", \"france\", \"annecy\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 192, + "code": " assertThat(subEntries[0].value()).isEqualTo(\"lake\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 193, + "code": " assertThat(subEntries[1].key()).isEqualTo(new String[] {\"europe\", \"france\", \"paris\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 194, + "code": " assertThat(subEntries[1].value()).isEqualTo(\"eiffel tower\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 195, + "code": " assertThat(subEntries[2].key()).isEqualTo(new String[] {\"europe\", \"france\", \"poitiers\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 196, + "code": " assertThat(subEntries[2].value()).isEqualTo(\"notre dame\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 197, + "code": " assertThat(subEntries[3].key()).isEqualTo(new String[] {\"europe\", \"italy\", \"rome\"});", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 198, + "code": " assertThat(subEntries[3].value()).isEqualTo(\"colosseum\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 199, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 200, + "code": " cache.remove(\"europe\", \"france\", \"annecy\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 201, + "code": " assertThat(cache.values()).containsOnly(\"eiffel tower\", \"colosseum\", \"notre dame\", \"great wall\", \"empire state building\", \"dunno\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 202, + "code": " assertThat(cache.values(\"europe\")).containsOnly(\"eiffel tower\", \"colosseum\", \"notre dame\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 203, + "code": " assertThat(cache.values(\"europe\", \"france\")).containsOnly(\"eiffel tower\", \"notre dame\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 204, + "code": " assertThat(cache.get(\"europe\", \"france\", \"annecy\")).isNull();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 205, + "code": " assertThat(cache.get(\"europe\", \"italy\", \"rome\")).isEqualTo(\"colosseum\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 206, + "code": " assertThat(cache.containsKey(\"europe\", \"france\")).isFalse();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 207, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 208, + "code": " cache.clear(\"europe\", \"italy\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 209, + "code": " assertThat(cache.values()).containsOnly(\"eiffel tower\", \"notre dame\", \"great wall\", \"empire state building\", \"dunno\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 210, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 211, + "code": " cache.clear(\"europe\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 212, + "code": " assertThat(cache.values()).containsOnly(\"great wall\", \"empire state building\", \"dunno\");", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 213, + "code": "", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 214, + "code": " cache.clear();", + "scmAuthor": "julien.henry@sonarsource.com", + "scmRevision": "cc071cc29e8c4d4592282313a3ca2ec376fd7f71", + "scmDate": "2014-05-01T00:00:12+0200" + }, + { + "line": 215, + "code": " assertThat(cache.values()).isEmpty();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 216, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 217, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 218, + "code": " @Test", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 219, + "code": " public void remove_versus_clear() throws Exception {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 220, + "code": " Cache<String> cache = caches.createCache(\"capitals\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 221, + "code": " cache.put(\"europe\", \"france\", \"paris\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 222, + "code": " cache.put(\"europe\", \"italy\", \"rome\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 223, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 224, + "code": " // remove(\"europe\") does not remove sub-keys", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 225, + "code": " cache.remove(\"europe\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 226, + "code": " assertThat(cache.values()).containsOnly(\"paris\", \"rome\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 227, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 228, + "code": " // clear(\"europe\") removes sub-keys", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 229, + "code": " cache.clear(\"europe\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 230, + "code": " assertThat(cache.values()).isEmpty();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 231, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 232, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 233, + "code": " @Test", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 234, + "code": " public void empty_cache() throws Exception {", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 235, + "code": " Cache<String> cache = caches.createCache(\"empty\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 236, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 237, + "code": " assertThat(cache.get(\"foo\")).isNull();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 238, + "code": " assertThat(cache.get(\"foo\", \"bar\")).isNull();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 239, + "code": " assertThat(cache.get(\"foo\", \"bar\", \"baz\")).isNull();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 240, + "code": " assertThat(cache.keySet()).isEmpty();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 241, + "code": " assertThat(cache.keySet(\"foo\")).isEmpty();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 242, + "code": " assertThat(cache.containsKey(\"foo\")).isFalse();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 243, + "code": " assertThat(cache.containsKey(\"foo\", \"bar\")).isFalse();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 244, + "code": " assertThat(cache.containsKey(\"foo\", \"bar\", \"baz\")).isFalse();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 245, + "code": " assertThat(cache.values()).isEmpty();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 246, + "code": " assertThat(cache.values(\"foo\")).isEmpty();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 247, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 248, + "code": " // do not fail", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 249, + "code": " cache.remove(\"foo\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 250, + "code": " cache.remove(\"foo\", \"bar\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 251, + "code": " cache.remove(\"foo\", \"bar\", \"baz\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 252, + "code": " cache.clear(\"foo\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 253, + "code": " cache.clear(\"foo\", \"bar\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 254, + "code": " cache.clear(\"foo\", \"bar\", \"baz\");", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "e486fe02a0a38d3d9fb70690f7870c77e2265254", + "scmDate": "2014-02-20T07:23:08+0100" + }, + { + "line": 255, + "code": " cache.clear();", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "26edff10d133e29e7013f803e7ef0d69ff593aeb", + "scmDate": "2013-04-16T17:26:34+0200" + }, + { + "line": 256, + "code": " }", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "b5eb47872b34aa9d017dca62abfe49b2fd7af61b", + "scmDate": "2013-04-17T10:35:23+0200" + }, + { + "line": 257, + "code": "}", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + }, + { + "line": 258, + "code": "", + "scmAuthor": "simon.brandhof@gmail.com", + "scmRevision": "108dc916996e3075eb21c6ae1bbc7c9a24f09ab0", + "scmDate": "2013-04-16T13:24:54+0200" + } +]} diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/tests/tests.json b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/tests/tests.json new file mode 100644 index 00000000000..421cbb391b1 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/tests/source-viewer-spec/tests/tests.json @@ -0,0 +1,38 @@ +{"tests": [ + { + "name": "two_parts_key", + "status": "OK", + "durationInMs": 324, + "coveredLines": 0 + }, + { + "name": "remove_versus_clear", + "status": "OK", + "durationInMs": 81, + "coveredLines": 0 + }, + { + "name": "three_parts_key", + "status": "OK", + "durationInMs": 93, + "coveredLines": 0 + }, + { + "name": "test_key_being_prefix_of_another_key", + "status": "OK", + "durationInMs": 89, + "coveredLines": 0 + }, + { + "name": "one_part_key", + "status": "OK", + "durationInMs": 91, + "coveredLines": 0 + }, + { + "name": "empty_cache", + "status": "OK", + "durationInMs": 88, + "coveredLines": 0 + } +]} diff --git a/server/sonar-web/src/main/js/tests/e2e/views/component-viewer.jade b/server/sonar-web/src/main/js/tests/e2e/views/component-viewer.jade deleted file mode 100644 index 0636b7f58b4..00000000000 --- a/server/sonar-web/src/main/js/tests/e2e/views/component-viewer.jade +++ /dev/null @@ -1,9 +0,0 @@ -extends ./layouts/main - -block header - script. - localStorage.removeItem('componentViewerSCM'); - script(data-main='/js/component-viewer/app', src='../js/require.js') - -block body - #component-viewer diff --git a/server/sonar-web/src/main/js/tests/e2e/views/source-viewer.jade b/server/sonar-web/src/main/js/tests/e2e/views/source-viewer.jade new file mode 100644 index 00000000000..778195a1ef5 --- /dev/null +++ b/server/sonar-web/src/main/js/tests/e2e/views/source-viewer.jade @@ -0,0 +1,13 @@ +extends ./layouts/main + +block header + script(data-main='/js/source-viewer/app', src='../js/require.js') + +block body + #source-viewer + + script. + window.file = { + uuid: '', + key: '' + }; diff --git a/server/sonar-web/src/main/js/widgets/pie-chart.js b/server/sonar-web/src/main/js/widgets/pie-chart.js index fd4838d4a45..f219f85589a 100644 --- a/server/sonar-web/src/main/js/widgets/pie-chart.js +++ b/server/sonar-web/src/main/js/widgets/pie-chart.js @@ -191,6 +191,7 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; // Configure sectors this.sectors = this.plotWrap.selectAll('.arc') .data(this.pie(this.components())); + console.log(this.components()); this.sectors .enter() diff --git a/server/sonar-web/src/main/less/components.less b/server/sonar-web/src/main/less/components.less index 834d9d6912b..28333bca7a8 100644 --- a/server/sonar-web/src/main/less/components.less +++ b/server/sonar-web/src/main/less/components.less @@ -3,3 +3,4 @@ @import "components/facets"; @import "components/modals"; @import "components/issues"; +@import "components/measures"; diff --git a/server/sonar-web/src/main/less/components/measures.less b/server/sonar-web/src/main/less/components/measures.less new file mode 100644 index 00000000000..ee589d1aad5 --- /dev/null +++ b/server/sonar-web/src/main/less/components/measures.less @@ -0,0 +1,80 @@ +@import (reference) "../variables"; +@import (reference) "../mixins"; +@import (reference) "../ui"; + + +.measures { + font-size: 0; +} + +.measures + .measures { + margin-top: 15px; + padding-top: 15px; + border-top: 1px solid @barBorderColor; +} + +.measures-duplex { + .measures-list { + vertical-align: top; + width: 50%; + } +} + +.measures-chart { + display: inline-block; + vertical-align: middle; + width: 70px; + margin-right: 20px; + text-align: center; + + .rating { + font-size: 32px; + } +} + +.measures-list { + display: inline-block; + vertical-align: middle; + font-size: @baseFontSize; +} + +.measure { + line-height: 1.3333333333333; +} + +.measure + .measure { + margin-top: 6px; +} + +.measure-name { + display: block; +} + +.measure-value { + color: @darkBlue; + font-size: @bigFontSize; + font-weight: 300; +} + +.measure-big { + .measure-name { + font-size: 16px; + font-weight: 300; + } + + .measure-value { + font-size: 22px; + font-weight: 300; + } +} + +.measure-one-line { + .measure-name { + display: inline; + + &:after { + content: ":"; + } + } +} + diff --git a/server/sonar-web/src/main/less/components/source.less b/server/sonar-web/src/main/less/components/source.less index d2df60b8098..44a8ae00405 100644 --- a/server/sonar-web/src/main/less/components/source.less +++ b/server/sonar-web/src/main/less/components/source.less @@ -1,11 +1,12 @@ @import (reference) "../mixins"; @import (reference) "../variables"; +@import (reference) "../ui"; @lineHeight: 18px; @lineWithIssuesBackground: #ffeaea; @duplicationColor: #f3ca8e; -.source { +.source-viewer { width: 100%; border: 1px solid @barBorderColor; .box-sizing(border-box); @@ -50,18 +51,24 @@ } } +.source-line-shadowed { + .source-line-code { + opacity: 0.4; + } +} + .source-line-expand { .source-line-code { background: url(../images/gray-stripes.png) repeat; } } -.source pre { +.source-viewer pre { height: @lineHeight; padding: 0; } -.source pre, +.source-viewer pre, .source-meta { line-height: @lineHeight; font-family: @monoFontFamily; @@ -173,3 +180,165 @@ background-color: @duplicationColor !important; cursor: pointer; } + + +// Header + +.source-viewer-header { + .clearfix; + position: relative; + padding: 2px 10px 4px; + border-bottom: 1px solid @barBorderColor; + background-color: @barBackgroundColor; +} + +.source-viewer-header-bar + .source-viewer-header-bar { + border-top: 1px solid @barBorderColor; +} + +.source-viewer-header-component { + float: left; + line-height: 20px; +} + +.source-viewer-header-component-project { + color: #777; + font-size: @smallFontSize; +} + +.source-viewer-header-component-name { + font-weight: 500; +} + +.source-viewer-header-favorite { + position: relative; + top: -2px; + margin-left: 4px; + .link-no-underline; +} + +.source-viewer-header-measures { + float: right; +} + +.source-viewer-header-measures-scope { + position: relative; + float: left; +} + +.source-viewer-header-measure { + display: inline-block; + vertical-align: middle; + padding: 3px 0; + font-size: @baseFontSize; + + .rating { + font-size: 18px; + } +} + +.source-viewer-header-measure + .source-viewer-header-measure { + margin-left: 25px; +} + +.source-viewer-header-measure-label { + display: block; + margin-top: 4px; + line-height: @smallFontSize; + color: #777; + font-size: @smallFontSize; +} + +.source-viewer-header-measure-value { + display: block; + line-height: 18px; + color: @baseFontColor; + font-size: 18px; + font-weight: 300; +} + +.source-viewer-header-measure-issues { + width: 45px; +} + +.source-viewer-header-measure-issue { + min-width: 1px; + height: 6px; + + &.s-blocker { background-color: @severityBlockerColor; } + &.s-critical { background-color: @severityCriticalColor; } + &.s-major { background-color: @severityMajorColor; } + &.s-minor { background-color: @severityMinorColor; } + &.s-info { background-color: @severityInfoColor; } +} + +.source-viewer-header-measure-issue + .source-viewer-header-measure-issue { + margin-top: 1px; +} + +.source-viewer-header-actions { + float: right; + display: block; + margin-left: 25px; + padding: 13px 5px; +} + +.source-viewer-header-more-actions { + position: absolute; + z-index: 100; + right: -1px; + top: 100%; + padding: 10px; + border: 1px solid @barBorderColor; + background-color: @white; + line-height: 1.8; +} + +.source-viewer-measures { + width: 1080px; + margin: 0 auto; + border-collapse: collapse; + table-layout: fixed; +} + +.source-viewer-measures-section { + vertical-align: top; + width: 25%; + padding: 0 15px; +} + +//.source-viewer-measures-section + .source-viewer-measures-section { +// border-left: 1px solid @barBorderColor; +//} + +.source-viewer-tests-list { + width: 100%; + font-size: @baseFontSize; + + .subtitle { + font-size: @smallFontSize; + } +} + +.source-viewer-test-status, +.source-viewer-test-duration, +.source-viewer-test-covered-lines { + width: 1px; +} + +.source-viewer-test-status, +.source-viewer-test-duration, +.source-viewer-test-covered-lines, +.source-viewer-test-covered-name { + vertical-align: middle; + padding: 3px; +} + +.source-viewer-test-name { + padding-left: 10px; + word-break: break-all; +} + +.source-viewer-test-covered-lines { + text-align: right; +} diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/component_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/component_controller.rb index 649b351d1cf..58aab0ae838 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/component_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/component_controller.rb @@ -22,6 +22,9 @@ class ComponentController < ApplicationController SECTION=Navigation::SECTION_RESOURCE def index + load_resource() + @line = params[:line] + if request.xhr? render :action => 'index' else @@ -31,4 +34,19 @@ class ComponentController < ApplicationController end end + private + + def load_resource + if params[:id] + @resource=Project.by_key(params[:id]) + return project_not_found unless @resource + @resource=@resource.permanent_resource + + @snapshot=@resource.last_snapshot + return project_not_analyzed unless @snapshot + + access_denied unless has_role?(:user, @resource) + end + end + end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/component/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/component/index.html.erb index f6f0b264c07..b48c2601929 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/component/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/component/index.html.erb @@ -1,5 +1,14 @@ <% content_for :script do %> - + <% end %> -
\ No newline at end of file +
+ + + diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb index 8802eb19301..05cc887a166 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb @@ -1,12 +1,16 @@ <% content_for :script do %> - + <% end %> -
-
+
+
+
+ diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb index 56e4d0500d7..58f6d8cdd35 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb @@ -86,7 +86,7 @@ <%= qualifier_icon(resource) -%>  <% if resource.source_code? %> <%= h resource.name(false) %> + data-uuid="<%= resource.uuid -%>" class="js-drilldown-link"><%= h resource.name(false) %> <% else %> <%= link_to(h(resource.name), params.merge({:only_path => true, :rids => (selected ? rids-[resource.id] : rids+[resource.id])})) -%> <% end %> @@ -128,6 +128,6 @@ }; -
+
<%= render :partial => 'footer' -%> diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 4dcf2f4b37e..576ebdca4db 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -2578,15 +2578,18 @@ metric.confirmed_issues.description=Confirmed issues #-------------------------------------------------------------------------------------------------------------------- metric.sqale_index.name=Technical Debt +metric.sqale_index.short_name=Debt metric.sqale_index.description=Total effort (in days) to fix all the issues on the component and therefore to comply to all the requirements. metric.new_technical_debt.name=Added Technical Debt +metric.new_technical_debt.short_name=Added Debt metric.new_technical_debt.description=Added Technical Debt metric.sqale_rating.name=SQALE Rating metric.sqale_rating.description=Rating of the technical debt ratio based on the SQALE Governance Model. metric.sqale_debt_ratio.name=Technical Debt Ratio +metric.sqale_debt_ratio.short_name=Debt Ratio metric.sqale_debt_ratio.description=Ratio of the actual technical debt compared to the estimated cost to develop the whole source code from scratch. @@ -2741,6 +2744,7 @@ component_viewer.transition.duplication=Duplicated By component_viewer.tests.ordered_by=ordered by component_viewer.tests.duration=duration component_viewer.tests.test_name=name +component_viewer.tests.status=status component_viewer.x_lines_are_covered={0} lines are covered component_viewer.details=Details @@ -2761,6 +2765,7 @@ component_viewer.lines_limit_reached=For performance reasons, only the {0} first component_viewer.issues_limit_reached=For usability reasons, only the {0} first issues will be fully displayed. Remaining issues will simply be underlined. component_viewer.issues_limit_reached_tooltip={0}\n\nRefine your filter to be able to see the details of this issue. component_viewer.cannot_show=We're sorry, but something went wrong. Please try back in a few minutes and contact support if the problem persists. +component_viewer.show_measures=Show Measures component_viewer.workspace=Workspace component_viewer.workspace.tooltip=Keeps track of history of navigation -- 2.39.5