diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-09-04 15:41:11 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-09-04 16:19:44 +0200 |
commit | 00ed34a3c9900665ff62985abbb935f3260feb99 (patch) | |
tree | bb44c12936140e7a4f73ff1e6987de456b1939b4 | |
parent | d41a260a0b4ca8d18e2078b2ac08d8c5e4203f4e (diff) | |
download | sonarqube-00ed34a3c9900665ff62985abbb935f3260feb99.tar.gz sonarqube-00ed34a3c9900665ff62985abbb935f3260feb99.zip |
SONAR-5589 Create column projects.authorization_updated_at
45 files changed, 431 insertions, 161 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/DatabaseMigrations.java b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/DatabaseMigrations.java index e42b945d93e..755c8ad5cef 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/DatabaseMigrations.java +++ b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/DatabaseMigrations.java @@ -23,19 +23,10 @@ import com.google.common.collect.ImmutableList; import org.sonar.server.db.migrations.v36.ViolationMigration; import org.sonar.server.db.migrations.v42.CompleteIssueMessageMigration; import org.sonar.server.db.migrations.v42.PackageKeysMigration; -import org.sonar.server.db.migrations.v43.ConvertIssueDebtToMinutesMigration; -import org.sonar.server.db.migrations.v43.DevelopmentCostMeasuresMigration; -import org.sonar.server.db.migrations.v43.IssueChangelogMigration; -import org.sonar.server.db.migrations.v43.NotResolvedIssuesOnRemovedComponentsMigration; -import org.sonar.server.db.migrations.v43.RequirementMeasuresMigration; -import org.sonar.server.db.migrations.v43.TechnicalDebtMeasuresMigration; -import org.sonar.server.db.migrations.v44.ChangeLogMigration; -import org.sonar.server.db.migrations.v44.ConvertProfileMeasuresMigration; -import org.sonar.server.db.migrations.v44.FeedQProfileDatesMigration; -import org.sonar.server.db.migrations.v44.FeedQProfileKeysMigration; -import org.sonar.server.db.migrations.v44.IssueActionPlanKeyMigration; -import org.sonar.server.db.migrations.v44.MeasureDataMigration; +import org.sonar.server.db.migrations.v43.*; +import org.sonar.server.db.migrations.v44.*; import org.sonar.server.db.migrations.v45.AddMissingRuleParameterDefaultValuesMigration; +import org.sonar.server.db.migrations.v50.InsertProjectsAuthorizationUpdatedAtMigration; import java.util.List; @@ -65,7 +56,10 @@ public interface DatabaseMigrations { ConvertProfileMeasuresMigration.class, // 4.5 - AddMissingRuleParameterDefaultValuesMigration.class + AddMissingRuleParameterDefaultValuesMigration.class, + + // 5.0 + InsertProjectsAuthorizationUpdatedAtMigration.class ); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigration.java b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigration.java new file mode 100644 index 00000000000..2d3d2a541a6 --- /dev/null +++ b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigration.java @@ -0,0 +1,65 @@ +/* + * 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. + */ + +package org.sonar.server.db.migrations.v50; + +import org.sonar.api.utils.System2; +import org.sonar.core.persistence.Database; +import org.sonar.server.db.migrations.BaseDataChange; +import org.sonar.server.db.migrations.MassUpdate; +import org.sonar.server.db.migrations.Select; +import org.sonar.server.db.migrations.SqlStatement; + +import java.sql.SQLException; +import java.util.Date; + +/** + * Used in the Active Record Migration 701 + * + * @since 5.0 + */ +public class InsertProjectsAuthorizationUpdatedAtMigration extends BaseDataChange { + + private final System2 system; + + public InsertProjectsAuthorizationUpdatedAtMigration(Database db, System2 system) { + super(db); + this.system = system; + } + + @Override + public void execute(Context context) throws SQLException { + final Date now = new Date(system.now()); + + MassUpdate massUpdate = context.prepareMassUpdate(); + massUpdate.select("SELECT p.id FROM projects p WHERE p.scope=? AND p.enabled=?").setString(1, "PRJ").setBoolean(2, true); + massUpdate.update("UPDATE projects SET authorization_updated_at=? WHERE id=?"); + massUpdate.execute(new MassUpdate.Handler() { + @Override + public boolean handle(Select.Row row, SqlStatement update) throws SQLException { + Long id = row.getLong(1); + update.setDate(1, now); + update.setLong(2, id); + return true; + } + }); + } + +} diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigrationTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigrationTest.java new file mode 100644 index 00000000000..15d30bf2a7c --- /dev/null +++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigrationTest.java @@ -0,0 +1,58 @@ +/* + * 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. + */ + +package org.sonar.server.db.migrations.v50; + +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; +import org.sonar.api.utils.DateUtils; +import org.sonar.api.utils.System2; +import org.sonar.core.persistence.TestDatabase; +import org.sonar.server.db.migrations.DatabaseMigration; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class InsertProjectsAuthorizationUpdatedAtMigrationTest { + + @ClassRule + public static TestDatabase db = new TestDatabase().schema(InsertProjectsAuthorizationUpdatedAtMigrationTest.class, "schema.sql"); + + DatabaseMigration migration; + System2 system = mock(System2.class); + + @Before + public void setUp() throws Exception { + db.executeUpdateSql("truncate table projects"); + migration = new InsertProjectsAuthorizationUpdatedAtMigration(db.database(), system); + when(system.now()).thenReturn(DateUtils.parseDate("2014-09-03").getTime()); + } + + @Test + public void execute() throws Exception { + db.prepareDbUnit(getClass(), "before.xml"); + + migration.execute(); + + db.assertDbUnit(getClass(), "after.xml", "projects"); + } + +} diff --git a/server/sonar-server/src/test/resources/org/sonar/server/component/persistence/ComponentDaoTest/insert-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/component/persistence/ComponentDaoTest/insert-result.xml index 73f37328882..397d2ae97fc 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/component/persistence/ComponentDaoTest/insert-result.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/component/persistence/ComponentDaoTest/insert-result.xml @@ -3,7 +3,7 @@ <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" name="RequestContext.java" long_name="org.struts.RequestContext" qualifier="FIL" scope="FIL" language="java" path="src/org/struts/RequestContext.java" root_id="3" description="[null]" enabled="[true]" copy_resource_id="[null]" person_id="[null]" deprecated_kee="[null]" - created_at="2014-06-18" + authorization_updated_at="[null]" created_at="2014-06-18" /> </dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/component/persistence/ComponentDaoTest/multi-modules.xml b/server/sonar-server/src/test/resources/org/sonar/server/component/persistence/ComponentDaoTest/multi-modules.xml index decdab5279a..771faf6ec97 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/component/persistence/ComponentDaoTest/multi-modules.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/component/persistence/ComponentDaoTest/multi-modules.xml @@ -7,7 +7,7 @@ <!-- root project --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="the description" long_name="Apache Struts" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"/> + enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="[null]" /> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -30,7 +30,7 @@ <!-- module --> <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]"/> + description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]" /> <snapshots id="2" project_id="2" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -44,7 +44,7 @@ <!-- sub module --> <projects id="3" root_id="1" kee="org.struts:struts-data" name="Struts Data" scope="PRJ" qualifier="BRC" long_name="Struts Data" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]"/> + description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]" /> <snapshots id="3" project_id="3" parent_snapshot_id="2" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -59,7 +59,7 @@ <projects long_name="org.struts" id="4" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts" name="src/org/struts" root_id="3" description="[null]" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="src/org/struts"/> + enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="src/org/struts" authorization_updated_at="[null]" /> <snapshots id="4" project_id="4" parent_snapshot_id="3" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -74,7 +74,7 @@ <projects long_name="org.struts.RequestContext" id="5" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java" name="RequestContext.java" root_id="3" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]" /> <snapshots id="5" project_id="5" parent_snapshot_id="4" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/component/persistence/ComponentDaoTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/component/persistence/ComponentDaoTest/shared.xml index 05861ec543f..0730d8ed1b3 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/component/persistence/ComponentDaoTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/component/persistence/ComponentDaoTest/shared.xml @@ -7,7 +7,7 @@ <!-- root project --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="the description" long_name="Apache Struts" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"/> + enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="[null]" /> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -30,7 +30,7 @@ <!-- module --> <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]"/> + description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]" /> <snapshots id="2" project_id="2" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -45,7 +45,7 @@ <projects long_name="org.struts" id="3" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts" name="src/org/struts" root_id="2" description="[null]" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="src/org/struts"/> + enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="src/org/struts" authorization_updated_at="[null]" /> <snapshots id="3" project_id="3" parent_snapshot_id="2" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -60,7 +60,7 @@ <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java" name="RequestContext.java" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]" /> <snapshots id="4" project_id="4" parent_snapshot_id="3" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigrationTest/after.xml b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigrationTest/after.xml new file mode 100644 index 00000000000..e751fcc4f82 --- /dev/null +++ b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigrationTest/after.xml @@ -0,0 +1,20 @@ +<dataset> + + <projects id="1" kee="project" name="project" long_name="project" scope="PRJ" qualifier="TRK" root_id="[null]" description="[null]" + enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" + created_at="2014-09-01" authorization_updated_at="2014-09-03"/> + + <projects id="2" kee="view" name="View" long_name="View" scope="PRJ" qualifier="VW" root_id="[null]" description="[null]" + enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" + created_at="2014-09-01" authorization_updated_at="2014-09-03"/> + + <!-- File should not be updated --> + <projects id="3" kee="file" name="File" long_name="File" scope="FIL" qualifier="CLA" root_id="[null]" description="[null]" + enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" + created_at="2014-09-01" authorization_updated_at="[null]"/> + + <projects id="4" kee="disabled" name="Disabled" long_name="Disabled" scope="PRJ" qualifier="TRK" root_id="1" description="[null]" + enabled="false" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" + created_at="2014-09-01" authorization_updated_at="[null]"/> + +</dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigrationTest/before.xml b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigrationTest/before.xml new file mode 100644 index 00000000000..717580c2589 --- /dev/null +++ b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigrationTest/before.xml @@ -0,0 +1,20 @@ +<dataset> + + <projects id="1" kee="project" name="project" long_name="project" scope="PRJ" qualifier="TRK" root_id="[null]" description="[null]" + enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" + created_at="2014-09-01" authorization_updated_at="[null]"/> + + <projects id="2" kee="view" name="View" long_name="View" scope="PRJ" qualifier="VW" root_id="[null]" description="[null]" + enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" + created_at="2014-09-01" authorization_updated_at="[null]"/> + + <!-- File should not be updated --> + <projects id="3" kee="file" name="File" long_name="File" scope="FIL" qualifier="CLA" root_id="[null]" description="[null]" + enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" + created_at="2014-09-01" authorization_updated_at="[null]"/> + + <projects id="4" kee="disabled" name="Disabled" long_name="Disabled" scope="PRJ" qualifier="TRK" root_id="1" description="[null]" + enabled="false" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" + created_at="2014-09-01" authorization_updated_at="[null]"/> + +</dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigrationTest/schema.sql b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigrationTest/schema.sql new file mode 100644 index 00000000000..af8d7161e46 --- /dev/null +++ b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v50/InsertProjectsAuthorizationUpdatedAtMigrationTest/schema.sql @@ -0,0 +1,18 @@ +CREATE TABLE "PROJECTS" ( + "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + "NAME" VARCHAR(256), + "DESCRIPTION" VARCHAR(2000), + "ENABLED" BOOLEAN NOT NULL DEFAULT TRUE, + "SCOPE" VARCHAR(3), + "QUALIFIER" VARCHAR(10), + "KEE" VARCHAR(400), + "DEPRECATED_KEE" VARCHAR(400), + "PATH" VARCHAR(2000), + "ROOT_ID" INTEGER, + "LANGUAGE" VARCHAR(20), + "COPY_RESOURCE_ID" INTEGER, + "LONG_NAME" VARCHAR(256), + "PERSON_ID" INTEGER, + "CREATED_AT" TIMESTAMP, + "AUTHORIZATION_UPDATED_AT" TIMESTAMP +); diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/700_add_authorization_updated_at_to_projects.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/700_add_authorization_updated_at_to_projects.rb new file mode 100644 index 00000000000..3a243c84cff --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/700_add_authorization_updated_at_to_projects.rb @@ -0,0 +1,31 @@ +# +# 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.0 +# SONAR-5589 +# +class AddAuthorizationUpdatedAtToProjects < ActiveRecord::Migration + + def self.up + add_column 'projects', :authorization_updated_at, :datetime, :null => true + end +end + diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/701_insert_projects_authorization_updated_at.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/701_insert_projects_authorization_updated_at.rb new file mode 100644 index 00000000000..365ae624d80 --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/701_insert_projects_authorization_updated_at.rb @@ -0,0 +1,32 @@ +# +# 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.0 +# SONAR-5589 +# +class InsertProjectsAuthorizationUpdatedAt < ActiveRecord::Migration + + def self.up + execute_java_migration('org.sonar.server.db.migrations.v50.InsertProjectsAuthorizationUpdatedAtMigration') + end + +end + diff --git a/sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java b/sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java index e08774d96c1..c9ae930855b 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java @@ -36,13 +36,10 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import static org.fest.assertions.Assertions.assertThat; -import static org.hamcrest.Matchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { @@ -91,7 +88,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { ResourcePersister persister = new DefaultResourcePersister(getSession(), mock(ResourcePermissions.class), snapshotCache, resourceCache); persister.saveProject(singleProject, null); - checkTables("shouldSaveNewProject", new String[] {"build_date", "created_at"}, "projects", "snapshots"); + checkTables("shouldSaveNewProject", new String[] {"build_date", "created_at", "authorization_updated_at"}, "projects", "snapshots"); // SONAR-3636 : created_at must be fed when inserting a new entry in the 'projects' table ResourceModel model = getSession().getSingleResult(ResourceModel.class, "key", singleProject.getKey()); @@ -105,7 +102,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { ResourcePersister persister = new DefaultResourcePersister(getSession(), mock(ResourcePermissions.class), snapshotCache, resourceCache); persister.saveProject(singleCopyProject, null); - checkTables("shouldSaveCopyProject", new String[] {"build_date", "created_at"}, "projects", "snapshots"); + checkTables("shouldSaveCopyProject", new String[] {"build_date", "created_at", "authorization_updated_at"}, "projects", "snapshots"); } @Test @@ -118,7 +115,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { persister.saveProject(moduleB, multiModuleProject); persister.saveProject(moduleB1, moduleB); - checkTables("shouldSaveNewMultiModulesProject", new String[] {"build_date", "created_at"}, "projects", "snapshots"); + checkTables("shouldSaveNewMultiModulesProject", new String[] {"build_date", "created_at", "authorization_updated_at"}, "projects", "snapshots"); } @Test @@ -131,7 +128,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { Directory.create("src/main/java/org/foo", "org.foo").setEffectiveKey("foo:src/main/java/org/foo")); // check that the directory is attached to the project - checkTables("shouldSaveNewDirectory", new String[] {"build_date", "created_at"}, "projects", "snapshots"); + checkTables("shouldSaveNewDirectory", new String[] {"build_date", "created_at", "authorization_updated_at"}, "projects", "snapshots"); } @Test @@ -144,7 +141,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { persister.saveResource(singleProject, new Library("junit:junit", "4.8.2").setEffectiveKey("junit:junit"));// do nothing, already saved persister.saveResource(singleProject, new Library("junit:junit", "3.2").setEffectiveKey("junit:junit")); - checkTables("shouldSaveNewLibrary", new String[] {"build_date", "created_at"}, "projects", "snapshots"); + checkTables("shouldSaveNewLibrary", new String[] {"build_date", "created_at", "authorization_updated_at"}, "projects", "snapshots"); } @Test @@ -172,7 +169,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { singleProject.setDescription("new description"); persister.saveProject(singleProject, null); - checkTables("shouldUpdateExistingResource", new String[] {"build_date", "created_at"}, "projects", "snapshots"); + checkTables("shouldUpdateExistingResource", new String[] {"build_date", "created_at", "authorization_updated_at"}, "projects", "snapshots"); } // SONAR-1700 @@ -183,7 +180,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase { ResourcePersister persister = new DefaultResourcePersister(getSession(), mock(ResourcePermissions.class), snapshotCache, resourceCache); persister.saveProject(singleProject, null); - checkTables("shouldRemoveRootIndexIfResourceIsProject", new String[] {"build_date", "created_at"}, "projects", "snapshots"); + checkTables("shouldRemoveRootIndexIfResourceIsProject", new String[] {"build_date", "created_at", "authorization_updated_at"}, "projects", "snapshots"); } @Test diff --git a/sonar-batch/src/test/java/org/sonar/batch/index/ResourceKeyMigrationTest.java b/sonar-batch/src/test/java/org/sonar/batch/index/ResourceKeyMigrationTest.java index 1fe27bc91b1..3d8d7540787 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/index/ResourceKeyMigrationTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/index/ResourceKeyMigrationTest.java @@ -112,7 +112,7 @@ public class ResourceKeyMigrationTest extends AbstractDbUnitTestCase { verify(logger).info("Component {} changed to {}", "b:org/foo", "b:src/main/java/org/foo"); verify(logger).info("Component {} changed to {}", "b:[root]", "b:src/main/java"); - checkTables("shouldMigrateResourceKeys", new String[] {"build_date", "created_at"}, "projects"); + checkTables("shouldMigrateResourceKeys", new String[] {"build_date", "created_at", "authorization_updated_at"}, "projects"); } private static Project newProject(String key, String language) { diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java index ee7e376fa52..639bbc835eb 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java @@ -33,7 +33,7 @@ import java.util.List; */ public class DatabaseVersion implements BatchComponent, ServerComponent { - public static final int LAST_VERSION = 583; + public static final int LAST_VERSION = 701; public static enum Status { UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql index 9634897e73f..ddf06f6e80b 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql @@ -253,6 +253,8 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('580'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('581'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('582'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('583'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('700'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('701'); 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', '2011-09-26 22:27:48.0', '2011-09-26 22:27:48.0', null, null); ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2; diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl index d3c9a53a3e4..013bbc2ad72 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl @@ -266,7 +266,8 @@ CREATE TABLE "PROJECTS" ( "COPY_RESOURCE_ID" INTEGER, "LONG_NAME" VARCHAR(256), "PERSON_ID" INTEGER, - "CREATED_AT" TIMESTAMP + "CREATED_AT" TIMESTAMP, + "AUTHORIZATION_UPDATED_AT" TIMESTAMP ); CREATE TABLE "MANUAL_MEASURES" ( diff --git a/sonar-core/src/test/java/org/sonar/core/user/AuthorDaoTest.java b/sonar-core/src/test/java/org/sonar/core/user/AuthorDaoTest.java index 9b920b06fa7..03192a96181 100644 --- a/sonar-core/src/test/java/org/sonar/core/user/AuthorDaoTest.java +++ b/sonar-core/src/test/java/org/sonar/core/user/AuthorDaoTest.java @@ -76,7 +76,7 @@ public class AuthorDaoTest extends AbstractDaoTestCase { checkTables("shouldInsertAuthorAndDeveloper", new String[] {"created_at", "updated_at", "copy_resource_id", "description", "enabled", "kee", "deprecated_kee", "path", "language", "long_name", "person_id", "root_id", - "scope"}, + "scope", "authorization_updated_at"}, "authors", "projects"); } @@ -108,7 +108,7 @@ public class AuthorDaoTest extends AbstractDaoTestCase { checkTables("shouldPreventAuthorsAndDevelopersDuplication", new String[] {"created_at", "updated_at", "copy_resource_id", "description", "enabled", "kee", "deprecated_kee", "path", "language", "long_name", "person_id", "root_id", - "scope"}, + "scope", "authorization_updated_at"}, "authors", "projects"); } } diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml index 9663761342b..a040e19d4cb 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml @@ -11,17 +11,17 @@ What has been changed : <!-- the project --> <projects id="1" enabled="[false]" root_id="[null]" created_at="[null]" long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the directory --> <projects id="2" enabled="[false]" root_id="1" created_at="[null]" long_name="[null]" scope="DIR" qualifier="DIR" kee="project:my/dir" name="my/dir" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the file --> <projects id="3" enabled="[false]" root_id="1" created_at="[null]" long_name="[null]" scope="FIL" qualifier="FIL" kee="project:my/dir/File.java" name="my/dir/File.java" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]" /> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml index e2cc5f459c9..69fc2dfa623 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml @@ -3,17 +3,17 @@ <!-- the project --> <projects id="1" enabled="[true]" root_id="[null]" created_at="[null]" long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the directory --> <projects id="2" enabled="[true]" root_id="1" created_at="[null]" long_name="[null]" scope="DIR" qualifier="DIR" kee="project:my/dir" name="my/dir" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the file --> <projects id="3" enabled="[true]" root_id="1" created_at="[null]" long_name="[null]" scope="FIL" qualifier="FIL" kee="project:my/dir/File.java" name="my/dir/File.java" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml index 4e982e4dc12..62cff84cd84 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml @@ -8,7 +8,7 @@ Snapshot 2 has been deleted <!-- the project --> <projects id="1" enabled="[true]" root_id="[null]" long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <!-- past snapshot with status "processed" and already purged --> <snapshots id="1" @@ -43,4 +43,4 @@ Snapshot 2 has been deleted period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/> -</dataset>
\ No newline at end of file +</dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml index 34716adee47..5c9aeaa6580 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml @@ -3,7 +3,7 @@ <!-- the project --> <projects id="1" enabled="[true]" root_id="[null]" long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <!-- past snapshot with status "processed" and already purged --> <snapshots id="1" @@ -38,4 +38,4 @@ period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/> -</dataset>
\ No newline at end of file +</dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml index fa6f544a993..99e649835bb 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml @@ -9,17 +9,17 @@ What has been changed : purge_status=1 on snapshot 4 (PRJ) and snapshots 5 and 6 <!-- the project --> <projects id="1" enabled="[true]" root_id="[null]" created_at="[null]" long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the directory --> <projects id="2" enabled="[true]" root_id="1" created_at="[null]" long_name="[null]" scope="DIR" qualifier="DIR" kee="project:my/dir" name="my/dir" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]"/> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the file --> <projects id="3" enabled="[true]" root_id="1" created_at="[null]" long_name="[null]" scope="FIL" qualifier="FIL" kee="project:my/dir/File.java" name="my/dir/File.java" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- do not purge last snapshots --> <snapshots id="1" diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml index 7e4db89bd58..43f1e290dfb 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml @@ -3,17 +3,17 @@ <!-- the project --> <projects id="1" enabled="[true]" root_id="[null]" created_at="[null]" long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]"/> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the directory --> <projects id="2" enabled="[true]" root_id="1" created_at="[null]" long_name="[null]" scope="DIR" qualifier="DIR" kee="project:my/dir" name="my/dir" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the file --> <projects id="3" enabled="[true]" root_id="1" created_at="[null]" long_name="[null]" scope="FIL" qualifier="FIL" kee="project:my/dir/File.java" name="my/dir/File.java" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- do not purge last snapshots --> <snapshots id="1" diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml index cd02d9bb72b..818b9318fb5 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteProject.xml @@ -3,7 +3,7 @@ <!-- root --> <projects id="1" enabled="[true]" root_id="[null]" long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]" /> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="[false]" purge_status="[null]" @@ -48,7 +48,7 @@ <!-- modules --> <projects id="2" enabled="[true]" root_id="1" long_name="[null]" scope="PRJ" qualifier="BRC" kee="module1" name="module1" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]" /> <snapshots id="2" project_id="2" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1" status="P" islast="[false]" purge_status="[null]" @@ -64,7 +64,7 @@ <projects id="3" enabled="[false]" root_id="1" long_name="[null]" scope="PRJ" qualifier="BRC" kee="module2" name="module2" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]" /> <snapshots id="3" project_id="3" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" @@ -80,7 +80,7 @@ <!-- file of module 2--> <projects id="4" enabled="[false]" root_id="3" long_name="[null]" scope="FIL" qualifier="FIL" kee="module2:File.java" name="File" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" /> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]" /> <snapshots id="4" project_id="4" parent_snapshot_id="3" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" @@ -92,4 +92,4 @@ depth="[null]" scope="FIL" qualifier="FIL" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/> -</dataset>
\ No newline at end of file +</dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeProject-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeProject-result.xml index 917079471ee..a0d2def655e 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeProject-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeProject-result.xml @@ -3,7 +3,8 @@ <!-- the project --> <projects id="1" enabled="[true]" created_at="[null]" long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project" - root_id="[null]" description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" /> + root_id="[null]" description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" + authorization_updated_at="[null]"/> <!-- snapshot already purged --> diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeProject.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeProject.xml index 7fcfe0326af..57028909f15 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeProject.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeProject.xml @@ -3,7 +3,8 @@ <!-- the project --> <projects id="1" enabled="[true]" created_at="[null]" long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project" - root_id="[null]" description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" /> + root_id="[null]" description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" + authorization_updated_at="[null]" /> <!-- snapshot already purged --> diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml index 4d55fe35f48..05e8216a312 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml @@ -7,7 +7,7 @@ <projects id="1" enabled="[true]" root_id="[null]" created_at="[null]" long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]"/> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues.xml index c3c7aed53ed..c47968373a5 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues.xml @@ -2,7 +2,7 @@ <projects id="1" enabled="[true]" root_id="[null]" created_at="[null]" long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]"/> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml index 832ee1082a5..7e09946714b 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml @@ -2,7 +2,7 @@ <projects id="1" enabled="[true]" root_id="[null]" created_at="[null]" long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]"/> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues.xml index 47b40a5fdaf..ab6382bb22b 100644 --- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues.xml +++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues.xml @@ -2,7 +2,7 @@ <projects id="1" enabled="[true]" root_id="[null]" created_at="[null]" long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]"/> + description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/fixture-including-ghost-projects-and-technical-project.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/fixture-including-ghost-projects-and-technical-project.xml index af589e668fe..0d42037c279 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/fixture-including-ghost-projects-and-technical-project.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/fixture-including-ghost-projects-and-technical-project.xml @@ -3,7 +3,7 @@ <!-- root project --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="the description" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -26,7 +26,7 @@ <!-- project --> <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="2" project_id="2" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -41,7 +41,7 @@ <projects long_name="org.struts" id="3" scope="DIR" qualifier="PAC" kee="org.struts:struts:org.struts" name="org.struts" root_id="1" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="3" project_id="3" parent_snapshot_id="2" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -56,7 +56,7 @@ <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="CLA" kee="org.struts:struts:org.struts.RequestContext" name="RequestContext" root_id="1" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="4" project_id="4" parent_snapshot_id="3" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" @@ -71,7 +71,7 @@ <!-- technical project --> <projects id="5" root_id="[null]" scope="PRJ" qualifier="TRK" kee="COPYorg.struts:struts" name="Struts" description="the description" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="1" person_id="[null]"/> + enabled="[true]" language="java" copy_resource_id="1" person_id="[null]" authorization_updated_at="[null]"/> <!-- project without snapshot status=P--> <projects id="6" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.apache.shindig" name="Shinding" @@ -100,7 +100,7 @@ <!-- project without snapshot --> <projects id="7" root_id="[null]" kee="org.sample:sample" name="Sample" scope="PRJ" qualifier="TRK" long_name="Sample" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <!-- project not enabled --> <projects id="8" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.apache:tika" name="Tika" diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/fixture.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/fixture.xml index dacf468dabf..477deb8163e 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/fixture.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/fixture.xml @@ -7,7 +7,7 @@ <!-- root project --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="the description" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="[null]"/> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -30,7 +30,7 @@ <!-- module --> <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="2" project_id="2" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -45,7 +45,7 @@ <projects long_name="org.struts" id="3" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts" name="src/org/struts" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts" authorization_updated_at="[null]"/> <snapshots id="3" project_id="3" parent_snapshot_id="2" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -60,7 +60,7 @@ <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java" name="RequestContext.java" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> <snapshots id="4" project_id="4" parent_snapshot_id="3" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/getResources_exclude_disabled.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/getResources_exclude_disabled.xml index f210035c786..adbaacce38c 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/getResources_exclude_disabled.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/getResources_exclude_disabled.xml @@ -3,10 +3,10 @@ <!-- disabled --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="the description" long_name="Apache Struts" - enabled="[false]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[false]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <!-- enabled --> <projects id="2" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="the description" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/get_last_snapshot_by_resource_id.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/get_last_snapshot_by_resource_id.xml index 2b948c6aedc..0e975c6137e 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/get_last_snapshot_by_resource_id.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/get_last_snapshot_by_resource_id.xml @@ -1,23 +1,3 @@ -<!-- - ~ 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. - --> - <dataset> <!-- Struts projects is authorized for all user --> @@ -27,7 +7,7 @@ <!-- root project --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="the description" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="[null]"/> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" period1_mode="previous_analysis" period1_param="[null]" period1_date="[null]" @@ -50,7 +30,7 @@ <!-- module --> <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="2" project_id="2" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -65,7 +45,7 @@ <projects long_name="org.struts" id="3" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts" name="src/org/struts" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts" authorization_updated_at="[null]"/> <snapshots id="3" project_id="3" parent_snapshot_id="2" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -80,7 +60,7 @@ <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java" name="RequestContext.java" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> <snapshots id="4" project_id="4" parent_snapshot_id="3" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/insert-result.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/insert-result.xml index 3e2403d4518..3f1f7b78bcc 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/insert-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/insert-result.xml @@ -2,10 +2,12 @@ <projects id="1" root_id="[null]" scope="FIL" qualifier="FIL" kee="org.struts:struts:/src/main/java/org/struts/Action.java" name="Action" description="[null]" long_name="org.struts.Action" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="/foo/bar" deprecated_kee="org.struts:struts:org.struts.Action" /> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="/foo/bar" deprecated_kee="org.struts:struts:org.struts.Action" + authorization_updated_at="[null]"/> <projects id="2" root_id="[null]" scope="FIL" qualifier="FIL" kee="org.struts:struts:/src/main/java/org/struts/Filter.java" name="Filter" description="[null]" long_name="org.struts.Filter" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts:org.struts.Filter" /> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts:org.struts.Filter" + authorization_updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/should_find_children_component_ids_for_secured_project_for_group.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/should_find_children_component_ids_for_secured_project_for_group.xml index 7463dda0ea7..62891ca34dd 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/should_find_children_component_ids_for_secured_project_for_group.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/should_find_children_component_ids_for_secured_project_for_group.xml @@ -10,7 +10,7 @@ <!-- root project --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="the description" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -33,7 +33,7 @@ <!-- project --> <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="2" project_id="2" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -48,7 +48,7 @@ <projects long_name="org.struts" id="3" scope="DIR" qualifier="PAC" kee="org.struts:struts:org.struts" name="org.struts" root_id="1" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="3" project_id="3" parent_snapshot_id="2" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -63,7 +63,7 @@ <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="CLA" kee="org.struts:struts:org.struts.RequestContext" name="RequestContext" root_id="1" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="4" project_id="4" parent_snapshot_id="3" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/should_find_children_component_ids_for_secured_project_for_user.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/should_find_children_component_ids_for_secured_project_for_user.xml index 52c069319c2..d5a2af24edc 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/should_find_children_component_ids_for_secured_project_for_user.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/should_find_children_component_ids_for_secured_project_for_user.xml @@ -8,7 +8,7 @@ <!-- root project --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="the description" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -31,7 +31,7 @@ <!-- project --> <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="2" project_id="2" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -46,7 +46,7 @@ <projects long_name="org.struts" id="3" scope="DIR" qualifier="PAC" kee="org.struts:struts:org.struts" name="org.struts" root_id="1" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="3" project_id="3" parent_snapshot_id="2" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -61,7 +61,7 @@ <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="CLA" kee="org.struts:struts:org.struts.RequestContext" name="RequestContext" root_id="1" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> <snapshots id="4" project_id="4" parent_snapshot_id="3" root_project_id="1" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/update-result.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/update-result.xml index ba1fcbfe097..cae591a611c 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/update-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/update-result.xml @@ -2,6 +2,7 @@ <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="MVC Framework" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="/foo/bar" deprecated_kee="deprecated key"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="/foo/bar" deprecated_kee="deprecated key" + authorization_updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/update.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/update.xml index 9ba62dc1976..a735a55c1b5 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/update.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/update.xml @@ -2,6 +2,7 @@ <projects id="1" root_id="200" scope="PRJ" qualifier="TRK" kee="old key" name="old name" description="old name" long_name="old long name" - enabled="[false]" language="old" copy_resource_id="2" person_id="3" created_at="[null]" path="/old/foo/bar" deprecated_kee="old deprecated key"/> + enabled="[false]" language="old" copy_resource_id="2" person_id="3" created_at="[null]" path="/old/foo/bar" deprecated_kee="old deprecated key" + authorization_updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shared.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shared.xml index e3c65aea1e3..584e9a41f71 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shared.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shared.xml @@ -3,48 +3,56 @@ <!-- root project --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="[null]" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts" + authorization_updated_at="[null]"/> <!-- **************** First sub project **************** --> <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core" + authorization_updated_at="[null]"/> <!-- directory --> <projects long_name="org.struts" id="3" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:/src/org/struts" name="org.struts" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core:org.struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core:org.struts" + authorization_updated_at="[null]"/> <!-- file --> <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="CLA" kee="org.struts:struts-core:/src/org/struts/RequestContext.java" name="RequestContext" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core:org.struts.RequestContext"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core:org.struts.RequestContext" + authorization_updated_at="[null]"/> <!-- **************** Second sub project **************** --> <projects id="5" root_id="1" kee="org.struts:struts-ui" name="Struts UI" scope="PRJ" qualifier="BRC" long_name="Struts UI" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-ui"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-ui" + authorization_updated_at="[null]"/> <!-- directory --> <projects long_name="org.struts" id="6" scope="DIR" qualifier="DIR" kee="org.struts:struts-ui:/src/org/struts" name="org.struts" root_id="5" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-ui:org.struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-ui:org.struts" + authorization_updated_at="[null]"/> <!-- file --> <projects long_name="org.struts.RequestContext" id="7" scope="FIL" qualifier="CLA" kee="org.struts:struts-ui:/src/org/struts/RequestContext.java" name="RequestContext" root_id="5" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-ui:org.struts.RequestContext"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-ui:org.struts.RequestContext" + authorization_updated_at="[null]"/> <!-- **************** Another independent project **************** --> <projects id="8" root_id="[null]" kee="foo:struts-core" name="Foo Struts Core" scope="PRJ" qualifier="BRC" long_name="Foo Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-core"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-core" + authorization_updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKey-result.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKey-result.xml index b55b2699b11..4a66a14feac 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKey-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKey-result.xml @@ -3,48 +3,56 @@ <!-- root project --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.apache.struts:struts" name="Struts" description="[null]" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts" + authorization_updated_at="[null]"/> <!-- **************** First sub project **************** --> <projects id="2" root_id="1" kee="org.apache.struts:struts-core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-core"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-core" + authorization_updated_at="[null]"/> <!-- directory --> <projects long_name="org.struts" id="3" scope="DIR" qualifier="DIR" kee="org.apache.struts:struts-core:/src/org/struts" name="org.struts" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-core:org.struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-core:org.struts" + authorization_updated_at="[null]"/> <!-- file --> <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="CLA" kee="org.apache.struts:struts-core:/src/org/struts/RequestContext.java" name="RequestContext" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-core:org.struts.RequestContext"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-core:org.struts.RequestContext" + authorization_updated_at="[null]"/> <!-- **************** Second sub project **************** --> <projects id="5" root_id="1" kee="org.apache.struts:struts-ui" name="Struts UI" scope="PRJ" qualifier="BRC" long_name="Struts UI" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-ui"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-ui" + authorization_updated_at="[null]"/> <!-- directory --> <projects long_name="org.struts" id="6" scope="DIR" qualifier="DIR" kee="org.apache.struts:struts-ui:/src/org/struts" name="org.struts" root_id="5" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-ui:org.struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-ui:org.struts" + authorization_updated_at="[null]"/> <!-- file --> <projects long_name="org.struts.RequestContext" id="7" scope="FIL" qualifier="CLA" kee="org.apache.struts:struts-ui:/src/org/struts/RequestContext.java" name="RequestContext" root_id="5" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-ui:org.struts.RequestContext"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-ui:org.struts.RequestContext" + authorization_updated_at="[null]"/> <!-- **************** Another independent project **************** --> <projects id="8" root_id="[null]" kee="foo:struts-core" name="Foo Struts Core" scope="PRJ" qualifier="BRC" long_name="Foo Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-core"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-core" + authorization_updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml index ba73191c96f..39444c817ab 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml @@ -3,48 +3,56 @@ <!-- root project --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="[null]" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts" + authorization_updated_at="[null]"/> <!-- **************** First sub project **************** --> <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core" + authorization_updated_at="[null]"/> <!-- directory --> <projects long_name="org.struts" id="3" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:/src/org/struts" name="org.struts" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core:org.struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core:org.struts" + authorization_updated_at="[null]"/> <!-- file --> <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="CLA" kee="org.struts:struts-core:/src/org/struts/RequestContext.java" name="RequestContext" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core:org.struts.RequestContext"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core:org.struts.RequestContext" + authorization_updated_at="[null]"/> <!-- **************** Second sub project **************** --> <projects id="5" root_id="1" kee="org.struts:struts-web" name="Struts UI" scope="PRJ" qualifier="BRC" long_name="Struts UI" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-web"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-web" + authorization_updated_at="[null]"/> <!-- directory --> <projects long_name="org.struts" id="6" scope="DIR" qualifier="DIR" kee="org.struts:struts-web:/src/org/struts" name="org.struts" root_id="5" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-web:org.struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-web:org.struts" + authorization_updated_at="[null]"/> <!-- file --> <projects long_name="org.struts.RequestContext" id="7" scope="FIL" qualifier="CLA" kee="org.struts:struts-web:/src/org/struts/RequestContext.java" name="RequestContext" root_id="5" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-web:org.struts.RequestContext"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-web:org.struts.RequestContext" + authorization_updated_at="[null]"/> <!-- **************** Another independent project **************** --> <projects id="8" root_id="[null]" kee="foo:struts-core" name="Foo Struts Core" scope="PRJ" qualifier="BRC" long_name="Foo Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-core"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-core" + authorization_updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules-result.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules-result.xml index 55aa9728ecf..32f0b44755b 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules-result.xml @@ -3,42 +3,49 @@ <!-- root project --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.apache.struts:struts" name="Struts" description="[null]" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts" + authorization_updated_at="[null]"/> <!-- **************** First sub project **************** --> <projects id="2" root_id="1" kee="org.apache.struts:struts-core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-core"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-core" + authorization_updated_at="[null]"/> <!-- directory --> <projects long_name="org.struts" id="3" scope="DIR" qualifier="PAC" kee="org.apache.struts:struts-core:/src/org/struts" name="org.struts" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-core:org.struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-core:org.struts" + authorization_updated_at="[null]"/> <!-- file --> <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="CLA" kee="org.apache.struts:struts-core:/src/org/struts/RequestContext.java" name="RequestContext" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-core:org.struts.RequestContext"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.apache.struts:struts-core:org.struts.RequestContext" + authorization_updated_at="[null]"/> <!-- **************** Second sub project THAT HAS A DIFFERENT GROUP ID => MUST NOT BE UPDATED **************** --> <projects id="5" root_id="1" kee="foo:struts-ui" name="Struts UI" scope="PRJ" qualifier="BRC" long_name="Struts UI" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui" + authorization_updated_at="[null]"/> <!-- directory --> <projects long_name="org.struts" id="6" scope="DIR" qualifier="PAC" kee="foo:struts-ui:/src/org/struts" name="org.struts" root_id="5" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui:org.struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui:org.struts" + authorization_updated_at="[null]"/> <!-- file --> <projects long_name="org.struts.RequestContext" id="7" scope="FIL" qualifier="CLA" kee="foo:struts-ui:/src/org/struts/RequestContext.java" name="RequestContext" root_id="5" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui:org.struts.RequestContext"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui:org.struts.RequestContext" + authorization_updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules.xml index 58d4452c3b1..7dca7c04c32 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules.xml @@ -3,42 +3,49 @@ <!-- root project --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="[null]" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts" + authorization_updated_at="[null]"/> <!-- **************** First sub project **************** --> <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core" + authorization_updated_at="[null]"/> <!-- directory --> <projects long_name="org.struts" id="3" scope="DIR" qualifier="PAC" kee="org.struts:struts-core:/src/org/struts" name="org.struts" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core:org.struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core:org.struts" + authorization_updated_at="[null]"/> <!-- file --> <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="CLA" kee="org.struts:struts-core:/src/org/struts/RequestContext.java" name="RequestContext" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core:org.struts.RequestContext"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-core:org.struts.RequestContext" + authorization_updated_at="[null]"/> <!-- **************** Second sub project THAT HAS A DIFFERENT GROUP ID => MUST NOT BE UPDATED **************** --> <projects id="5" root_id="1" kee="foo:struts-ui" name="Struts UI" scope="PRJ" qualifier="BRC" long_name="Struts UI" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui" + authorization_updated_at="[null]"/> <!-- directory --> <projects long_name="org.struts" id="6" scope="DIR" qualifier="PAC" kee="foo:struts-ui:/src/org/struts" name="org.struts" root_id="5" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui:org.struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui:org.struts" + authorization_updated_at="[null]"/> <!-- file --> <projects long_name="org.struts.RequestContext" id="7" scope="FIL" qualifier="CLA" kee="foo:struts-ui:/src/org/struts/RequestContext.java" name="RequestContext" root_id="5" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui:org.struts.RequestContext"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui:org.struts.RequestContext" + authorization_updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldUpdateKey-result.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldUpdateKey-result.xml index 360bd068c94..1b07204d6f7 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldUpdateKey-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceKeyUpdaterDaoTest/shouldUpdateKey-result.xml @@ -3,7 +3,8 @@ <!-- root project --> <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="[null]" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts" + authorization_updated_at="[null]"/> <!-- **************** First sub project **************** --> @@ -11,42 +12,49 @@ <!-- --> <projects id="2" root_id="1" kee="struts:core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="struts:core"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="struts:core" + authorization_updated_at="[null]"/> <!-- directory --> <projects long_name="org.struts" id="3" scope="DIR" qualifier="DIR" kee="struts:core:/src/org/struts" name="org.struts" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="struts:core:org.struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="struts:core:org.struts" + authorization_updated_at="[null]"/> <!-- file --> <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="CLA" kee="struts:core:/src/org/struts/RequestContext.java" name="RequestContext" root_id="2" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="struts:core:org.struts.RequestContext"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="struts:core:org.struts.RequestContext" + authorization_updated_at="[null]"/> <!-- **************** Second sub project **************** --> <projects id="5" root_id="1" kee="org.struts:struts-ui" name="Struts UI" scope="PRJ" qualifier="BRC" long_name="Struts UI" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-ui"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-ui" + authorization_updated_at="[null]"/> <!-- directory --> <projects long_name="org.struts" id="6" scope="DIR" qualifier="DIR" kee="org.struts:struts-ui:/src/org/struts" name="org.struts" root_id="5" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-ui:org.struts"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-ui:org.struts" + authorization_updated_at="[null]"/> <!-- file --> <projects long_name="org.struts.RequestContext" id="7" scope="FIL" qualifier="CLA" kee="org.struts:struts-ui:/src/org/struts/RequestContext.java" name="RequestContext" root_id="5" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-ui:org.struts.RequestContext"/> + enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts-ui:org.struts.RequestContext" + authorization_updated_at="[null]"/> <!-- **************** Another independent project **************** --> <projects id="8" root_id="[null]" kee="foo:struts-core" name="Foo Struts Core" scope="PRJ" qualifier="BRC" long_name="Foo Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-core"/> + description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-core" + authorization_updated_at="[null]"/> </dataset> |