From 5a6aa5d5a28b0ee5fe50972d443061e1e3becde5 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 3 Aug 2015 01:04:20 +0200 Subject: [PATCH] Add column LOCATIONS to db table ISSUES --- .../close_issue-result.xml | 1 + .../insert_new_issue-result.xml | 1 + .../step/PersistIssuesStepTest/shared.xml | 1 + .../should_insert_new_issues-result.xml | 1 + ...ld_resolve_conflicts_on_updates-result.xml | 1 + .../should_resolve_conflicts_on_updates.xml | 1 + .../should_update_issues-result.xml | 1 + .../IssueStorageTest/should_update_issues.xml | 1 + .../should_insert_new_issues-result.xml | 1 + .../should_update_issues-result.xml | 1 + .../should_update_issues.xml | 1 + .../issue/index/IssueIndexerTest/index.xml | 1 + .../extract_directory_path.xml | 12 +++-- .../extract_file_path.xml | 12 +++-- .../IssueResultSetIteratorTest/one_issue.xml | 3 +- .../IssueResultSetIteratorTest/shared.xml | 15 ++++-- .../db/migrate/927_add_issues_locations.rb | 30 ++++++++++++ .../org/sonar/core/issue/DefaultIssue.java | 11 ++++- .../java/org/sonar/db/issue/IssueDto.java | 34 +++++++++++++ .../org/sonar/db/version/DatabaseVersion.java | 2 +- sonar-db/src/main/protobuf/db_commons.proto | 41 ++++++++++++++++ sonar-db/src/main/protobuf/db_issues.proto | 48 +++++++++++++++++++ .../org/sonar/db/version/rows-h2.sql | 1 + .../org/sonar/db/version/schema-h2.ddl | 3 +- .../should_find_by_project.xml | 3 ++ ...tChangelogOfNonClosedIssuesByComponent.xml | 4 ++ .../IssueDaoTest/find_by_action_plan.xml | 1 + .../find_severities_by_component.xml | 3 ++ .../db/issue/IssueDaoTest/get_by_key.xml | 4 +- .../db/issue/IssueDaoTest/insert-result.xml | 3 +- .../should_select_issue_and_component_ids.xml | 3 ++ ...uld_select_non_closed_issues_by_module.xml | 5 ++ ...ed_issues_by_module_on_removed_project.xml | 4 ++ .../db/issue/IssueDaoTest/update-result.xml | 1 + .../sonar/db/issue/IssueDaoTest/update.xml | 1 + .../IssueMapperTest/testInsert-result.xml | 1 + .../IssueMapperTest/testUpdate-result.xml | 1 + .../db/issue/IssueMapperTest/testUpdate.xml | 1 + ...eforeSelectedDate_with_conflict-result.xml | 1 + ...updateBeforeSelectedDate_with_conflict.xml | 1 + .../should_select_assignees.xml | 3 ++ ...resources_without_last_snapshot-result.xml | 10 ++-- ...isable_resources_without_last_snapshot.xml | 8 ++-- .../PurgeDaoTest/shouldDeleteProject.xml | 2 + ...should_delete_all_closed_issues-result.xml | 11 +++-- .../should_delete_all_closed_issues.xml | 10 ++-- ...should_delete_old_closed_issues-result.xml | 10 ++-- .../should_delete_old_closed_issues.xml | 10 ++-- 48 files changed, 279 insertions(+), 46 deletions(-) create mode 100644 server/sonar-web/src/main/webapp/WEB-INF/db/migrate/927_add_issues_locations.rb create mode 100644 sonar-db/src/main/protobuf/db_commons.proto create mode 100644 sonar-db/src/main/protobuf/db_issues.proto diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistIssuesStepTest/close_issue-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistIssuesStepTest/close_issue-result.xml index a4c029b4606..b2765988177 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistIssuesStepTest/close_issue-result.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistIssuesStepTest/close_issue-result.xml @@ -26,6 +26,7 @@ issue_close_date="[null]" created_at="1300000000000" updated_at="1400000000000" + locations="[null]" /> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistIssuesStepTest/insert_new_issue-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistIssuesStepTest/insert_new_issue-result.xml index 7c0c5c10d55..d114f261b49 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistIssuesStepTest/insert_new_issue-result.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistIssuesStepTest/insert_new_issue-result.xml @@ -26,6 +26,7 @@ issue_close_date="[null]" created_at="1400000000000" updated_at="1400000000000" + locations="[null]" /> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistIssuesStepTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistIssuesStepTest/shared.xml index 3cee2f8e087..263f957b384 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistIssuesStepTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistIssuesStepTest/shared.xml @@ -38,6 +38,7 @@ issue_close_date="[null]" created_at="1300000000000" updated_at="1300000000000" + locations="[null]" /> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/IssueStorageTest/should_insert_new_issues-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/IssueStorageTest/should_insert_new_issues-result.xml index 48631f4bb0f..3db758bb13b 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/IssueStorageTest/should_insert_new_issues-result.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/IssueStorageTest/should_insert_new_issues-result.xml @@ -19,6 +19,7 @@ issue_creation_date="1368878400000" issue_update_date="1368878400000" issue_close_date="1368878400000" + locations="[null]" /> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/IssueStorageTest/should_resolve_conflicts_on_updates.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/IssueStorageTest/should_resolve_conflicts_on_updates.xml index 5f4ddaca1a1..76ef67e4569 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/IssueStorageTest/should_resolve_conflicts_on_updates.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/IssueStorageTest/should_resolve_conflicts_on_updates.xml @@ -31,5 +31,6 @@ issue_creation_date="1115848800000" issue_update_date="1368878400000" issue_close_date="[null]" + locations="[null]" /> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/IssueStorageTest/should_update_issues-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/IssueStorageTest/should_update_issues-result.xml index 170a3b210cc..f5ffd879c45 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/IssueStorageTest/should_update_issues-result.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/IssueStorageTest/should_update_issues-result.xml @@ -24,6 +24,7 @@ issue_creation_date="1368878400000" issue_update_date="1368878400000" issue_close_date="1368878400000" + locations="[null]" /> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_insert_new_issues-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_insert_new_issues-result.xml index b63e969de7f..29ff12edfe0 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_insert_new_issues-result.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_insert_new_issues-result.xml @@ -19,6 +19,7 @@ issue_creation_date="1368878400000" issue_update_date="1368878400000" issue_close_date="1368878400000" + locations="[null]" /> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index.xml index d7e82dde47c..1277674a21f 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index.xml @@ -32,5 +32,6 @@ issue_creation_date="1115848800000" issue_update_date="1368828000000" issue_close_date="[null]" + locations="[null]" /> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_directory_path.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_directory_path.xml index 9440a8227a4..939428fa0d5 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_directory_path.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_directory_path.xml @@ -32,7 +32,8 @@ updated_at="1400000000000" issue_creation_date="1115848800000" issue_update_date="1356994800000" - issue_close_date="[null]"/> + issue_close_date="[null]" + locations="[null]"/> + issue_close_date="[null]" + locations="[null]"/> + issue_close_date="[null]" + locations="[null]"/> + issue_close_date="[null]" + locations="[null]"/> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_file_path.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_file_path.xml index 9440a8227a4..939428fa0d5 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_file_path.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_file_path.xml @@ -32,7 +32,8 @@ updated_at="1400000000000" issue_creation_date="1115848800000" issue_update_date="1356994800000" - issue_close_date="[null]"/> + issue_close_date="[null]" + locations="[null]"/> + issue_close_date="[null]" + locations="[null]"/> + issue_close_date="[null]" + locations="[null]"/> + issue_close_date="[null]" + locations="[null]"/> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/one_issue.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/one_issue.xml index c632c495a9e..f9cb45385b0 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/one_issue.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/one_issue.xml @@ -32,6 +32,7 @@ updated_at="1400000000000" issue_creation_date="1115848800000" issue_update_date="1356994800000" - issue_close_date="[null]"/> + issue_close_date="[null]" + locations="[null]"/> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/shared.xml index 52c576adc8a..417b2fdce4c 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/shared.xml @@ -32,7 +32,9 @@ updated_at="1400000000000" issue_creation_date="1115848800000" issue_update_date="1356994800000" - issue_close_date="[null]"/> + issue_close_date="[null]" + locations="[null]" + /> + issue_close_date="[null]" + locations="[null]" + /> + issue_close_date="[null]" + locations="[null]"/> + issue_close_date="[null]" + locations="[null]" + /> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/927_add_issues_locations.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/927_add_issues_locations.rb new file mode 100644 index 00000000000..b97dabe36cb --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/927_add_issues_locations.rb @@ -0,0 +1,30 @@ +# +# SonarQube, open source software quality management tool. +# Copyright (C) 2008-2014 SonarSource +# mailto:contact AT sonarsource DOT com +# +# SonarQube is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# +# SonarQube is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# + +# +# SonarQube 5.2 +# +class AddIssuesLocations < ActiveRecord::Migration + + def self.up + add_column 'issues', 'locations', :binary, :null => true + end + +end diff --git a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java index 9f3fcb16170..7c2fd24f6cc 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java @@ -87,7 +87,8 @@ public class DefaultIssue implements Issue, Trackable { private String actionPlanKey; private List comments = null; private Set tags = null; - + // temporarily an Object as long as DefaultIssue is used by sonar-batch + private Object locations = null; // FUNCTIONAL DATES private Date creationDate; private Date updateDate; @@ -557,6 +558,14 @@ public class DefaultIssue implements Issue, Trackable { return this; } + public T getLocations() { + return (T)locations; + } + + public void setLocations(Object locations) { + this.locations = locations; + } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java index 51518fb1dc9..008bf7f1ba9 100644 --- a/sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java +++ b/sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java @@ -24,6 +24,7 @@ import com.google.common.base.Objects; import com.google.common.base.Preconditions; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableSet; +import com.google.protobuf.InvalidProtocolBufferException; import java.io.Serializable; import java.util.Collection; import java.util.Date; @@ -39,6 +40,7 @@ import org.sonar.api.utils.KeyValueFormat; import org.sonar.api.utils.internal.Uuids; import org.sonar.core.issue.DefaultIssue; import org.sonar.db.component.ComponentDto; +import org.sonar.db.protobuf.DbIssues; import org.sonar.db.rule.RuleDto; import static org.sonar.api.utils.DateUtils.dateToLong; @@ -69,6 +71,7 @@ public final class IssueDto implements Serializable { private String authorLogin; private String actionPlanKey; private String issueAttributes; + private byte[] locations; private long createdAt; private long updatedAt; @@ -645,6 +648,37 @@ public final class IssueDto implements Serializable { return this; } + @CheckForNull + public byte[] getLocations() { + return locations; + } + + @CheckForNull + public DbIssues.Locations parseLocations() { + if (locations != null) { + try { + return DbIssues.Locations.parseFrom(locations); + } catch (InvalidProtocolBufferException e) { + throw new IllegalStateException(String.format("Fail to read ISSUES.LOCATIONS [KEE=%s]", kee), e); + } + } + return null; + } + + public IssueDto setLocations(byte[] locations) { + this.locations = locations; + return this; + } + + public IssueDto setLocations(@Nullable DbIssues.Locations locations) { + if (locations == null) { + this.locations = null; + } else { + this.locations = locations.toByteArray(); + } + return this; + } + @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); diff --git a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java index db0a87e060f..31d098b7d5e 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java +++ b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java @@ -29,7 +29,7 @@ import org.sonar.db.MyBatis; public class DatabaseVersion { - public static final int LAST_VERSION = 926; + public static final int LAST_VERSION = 927; /** * The minimum supported version which can be upgraded. Lower diff --git a/sonar-db/src/main/protobuf/db_commons.proto b/sonar-db/src/main/protobuf/db_commons.proto new file mode 100644 index 00000000000..f06ede6ad35 --- /dev/null +++ b/sonar-db/src/main/protobuf/db_commons.proto @@ -0,0 +1,41 @@ +// SonarQube, open source software quality management tool. +// Copyright (C) 2008-2015 SonarSource +// mailto:contact AT sonarsource DOT com +// +// SonarQube is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 3 of the License, or (at your option) any later version. +// +// SonarQube is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program; if not, write to the Free Software Foundation, +// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +syntax = "proto2"; + +package sonarqube.db.commons; + +// The java package can be changed without breaking compatibility. +// it impacts only the generated Java code. +option java_package = "org.sonar.db.protobuf"; +option optimize_for = SPEED; + +// Lines start at 1 and line offsets start at 0 +message TextRange { + // Start line. Should never be absent + optional int32 start_line = 1; + + // End line (inclusive). Absent means it is same as start line + optional int32 end_line = 2; + + // If absent it means range starts at the first offset of start line + optional int32 start_offset = 3; + + // If absent it means range ends at the last offset of end line + optional int32 end_offset = 4; +} diff --git a/sonar-db/src/main/protobuf/db_issues.proto b/sonar-db/src/main/protobuf/db_issues.proto new file mode 100644 index 00000000000..a61f8c187d1 --- /dev/null +++ b/sonar-db/src/main/protobuf/db_issues.proto @@ -0,0 +1,48 @@ +// SonarQube, open source software quality management tool. +// Copyright (C) 2008-2015 SonarSource +// mailto:contact AT sonarsource DOT com +// +// SonarQube is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 3 of the License, or (at your option) any later version. +// +// SonarQube is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program; if not, write to the Free Software Foundation, +// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +// Structure of table ISSUES + +syntax = "proto2"; + +package sonarqube.db.issues; + +import "db_commons.proto"; + +// The java package can be changed without breaking compatibility. +// it impacts only the generated Java code. +option java_package = "org.sonar.db.protobuf"; +option optimize_for = SPEED; + +message Locations { + optional Location primary = 1; + repeated Location secondaries = 2; + repeated ExecutionFlow execution_flows = 3; +} + +message ExecutionFlow { + repeated Location locations = 1; +} + +message Location { + optional string component_id = 1; + // Only when component is a file. Can be empty for a file if this is an issue global to the file. + optional sonarqube.db.commons.TextRange text_range = 2; + optional string msg = 3; +} diff --git a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql index c5095b8e9f1..2963913915a 100644 --- a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql +++ b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql @@ -345,6 +345,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('923'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('924'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('925'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('926'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('927'); INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '1418215735482', '1418215735482', null, null); ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2; diff --git a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl index f65405490c3..29e46ea45b1 100644 --- a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl +++ b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl @@ -434,7 +434,8 @@ CREATE TABLE "ISSUES" ( "ISSUE_CLOSE_DATE" BIGINT, "ISSUE_UPDATE_DATE" BIGINT, "CREATED_AT" BIGINT, - "UPDATED_AT" BIGINT + "UPDATED_AT" BIGINT, + "LOCATIONS" BLOB(167772150), ); CREATE TABLE "ISSUE_CHANGES" ( diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanStatsDaoTest/should_find_by_project.xml b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanStatsDaoTest/should_find_by_project.xml index f38c53fea63..4db99c6f324 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanStatsDaoTest/should_find_by_project.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanStatsDaoTest/should_find_by_project.xml @@ -26,6 +26,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueChangeDaoTest/selectChangelogOfNonClosedIssuesByComponent.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueChangeDaoTest/selectChangelogOfNonClosedIssuesByComponent.xml index ef1c47fe020..4644c4b315e 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueChangeDaoTest/selectChangelogOfNonClosedIssuesByComponent.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueChangeDaoTest/selectChangelogOfNonClosedIssuesByComponent.xml @@ -24,6 +24,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" + locations="[null]" /> @@ -76,6 +77,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_by_action_plan.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_by_action_plan.xml index a052d421f66..1cff4867ca0 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_by_action_plan.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_by_action_plan.xml @@ -24,6 +24,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_severities_by_component.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_severities_by_component.xml index deb88387a4a..fc563ef376a 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_severities_by_component.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_severities_by_component.xml @@ -24,6 +24,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" + locations="[null]" /> @@ -76,5 +78,6 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/get_by_key.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/get_by_key.xml index 3d5a5c70e2e..0b261a3252d 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/get_by_key.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/get_by_key.xml @@ -23,7 +23,8 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="1450000000000" - /> + locations="[null]" + /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/insert-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/insert-result.xml index fc1543cb2b9..130d6b737b0 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/insert-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/insert-result.xml @@ -25,5 +25,6 @@ created_at="1400000000000" updated_at="1450000000000" action_plan_key="current_sprint" - /> + locations="[null]" + /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/should_select_issue_and_component_ids.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/should_select_issue_and_component_ids.xml index f92b8328c21..6fd8b2b3069 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/should_select_issue_and_component_ids.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/should_select_issue_and_component_ids.xml @@ -24,6 +24,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" + locations="[null]" /> @@ -76,5 +78,6 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="1400000000000" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/should_select_non_closed_issues_by_module.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/should_select_non_closed_issues_by_module.xml index b3575610bd1..ec48c8b1855 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/should_select_non_closed_issues_by_module.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/should_select_non_closed_issues_by_module.xml @@ -24,6 +24,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" + locations="[null]" /> @@ -50,6 +51,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" + locations="[null]" /> @@ -76,6 +78,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" + locations="[null]" /> @@ -102,6 +105,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" + locations="[null]" /> @@ -128,6 +132,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/should_select_non_closed_issues_by_module_on_removed_project.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/should_select_non_closed_issues_by_module_on_removed_project.xml index b7fa286ffca..7d05f81ce71 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/should_select_non_closed_issues_by_module_on_removed_project.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/should_select_non_closed_issues_by_module_on_removed_project.xml @@ -44,6 +44,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" + locations="[null]" /> @@ -70,6 +71,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" + locations="[null]" /> @@ -96,6 +98,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" + locations="[null]" /> @@ -122,6 +125,7 @@ issue_close_date="1366063200000" created_at="1400000000000" updated_at="[null]" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update-result.xml index d5959c63659..57a7c8e0191 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update-result.xml @@ -25,5 +25,6 @@ created_at="1400000000000" updated_at="1450000000000" action_plan_key="current_sprint" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update.xml index 9c41f1922cc..afd7cebe690 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update.xml @@ -24,5 +24,6 @@ created_at="1400000000000" updated_at="1400000000000" action_plan_key="[null]" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/testInsert-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/testInsert-result.xml index 816b527458c..faeae185035 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/testInsert-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/testInsert-result.xml @@ -25,5 +25,6 @@ created_at="1400000000000" updated_at="1500000000000" action_plan_key="current_sprint" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/testUpdate-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/testUpdate-result.xml index afce8a1ed86..3ff7dda68ea 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/testUpdate-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/testUpdate-result.xml @@ -25,5 +25,6 @@ created_at="1400000000000" updated_at="1500000000000" action_plan_key="current_sprint" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/testUpdate.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/testUpdate.xml index 5cb05d1dd96..a0bb2436319 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/testUpdate.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/testUpdate.xml @@ -23,5 +23,6 @@ created_at="1400000000000" updated_at="1500000000000" action_plan_key="[null]" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/updateBeforeSelectedDate_with_conflict-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/updateBeforeSelectedDate_with_conflict-result.xml index ecb26c85603..cd9eb4a6a3a 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/updateBeforeSelectedDate_with_conflict-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/updateBeforeSelectedDate_with_conflict-result.xml @@ -26,5 +26,6 @@ created_at="1400000000000" updated_at="1450000000000" action_plan_key="[null]" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/updateBeforeSelectedDate_with_conflict.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/updateBeforeSelectedDate_with_conflict.xml index 0264dc2bd7b..c48d24ec9e5 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/updateBeforeSelectedDate_with_conflict.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueMapperTest/updateBeforeSelectedDate_with_conflict.xml @@ -24,5 +24,6 @@ created_at="1400000000000" updated_at="1450000000000" action_plan_key="[null]" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueStatsDaoTest/should_select_assignees.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueStatsDaoTest/should_select_assignees.xml index 4cc9d077a16..023402c8d1b 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueStatsDaoTest/should_select_assignees.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueStatsDaoTest/should_select_assignees.xml @@ -26,6 +26,7 @@ issue_close_date="1366063200000" created_at="2013-04-16" updated_at="2013-04-16" + locations="[null]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml index 530dafeedaa..a29dac6c3f5 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml @@ -74,7 +74,9 @@ What has been changed : message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="1450000000000" issue_creation_date="1366063200000" issue_update_date="1396994400000" - created_at="1450000000000" tags="[null]"/> + created_at="1450000000000" tags="[null]" + locations="[null]" + /> + created_at="1450000000000" tags="[null]" locations="[null]"/> + created_at="1450000000000" tags="[null]" locations="[null]"/> + created_at="1450000000000" tags="[null]" locations="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml index 0cfef24e585..98781137978 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml @@ -66,7 +66,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1450000000000"/> + created_at="1450000000000" locations="[null]"/> + created_at="1450000000000" locations="[null]"/> + created_at="1450000000000" locations="[null]"/> + created_at="1450000000000" locations="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml index 1f554aded5d..fac178de73e 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml @@ -32,6 +32,7 @@ issue_creation_date="1366063200000" issue_update_date="1366063200000" issue_close_date="1366063200000" + locations="[null]" /> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="2013-04-16" + locations="[null]" /> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="2013-04-16" locations="[null]" locations="[null]"/> --> @@ -56,7 +57,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> @@ -71,7 +72,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> @@ -83,7 +84,7 @@ issue_close_date="1735686000000" resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" - updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="2013-04-16"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="2013-04-16" locations="[null]"/> --> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues.xml index 9fe05024ebd..90dfe2ed797 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues.xml @@ -28,7 +28,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> @@ -42,7 +42,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> @@ -58,7 +58,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> @@ -73,7 +73,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> @@ -87,7 +87,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml index 7b79eaacc03..fc37dd89259 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml @@ -25,7 +25,7 @@ issue_close_date="1262300400000" resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" - updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="2013-04-16"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="2013-04-16" locations="[null]"/> + updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" created_at="2013-04-16" locations="[null]"/> --> @@ -50,7 +50,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> @@ -65,7 +65,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> @@ -79,7 +79,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues.xml index 95d56051843..4688bc5f6f8 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues.xml @@ -27,7 +27,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> @@ -41,7 +41,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> @@ -57,7 +57,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> @@ -72,7 +72,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> @@ -86,7 +86,7 @@ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]" updated_at="[null]" issue_creation_date="1366063200000" issue_update_date="1366063200000" - created_at="1400000000000"/> + created_at="1400000000000" locations="[null]"/> -- 2.39.5