aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-11-26 20:41:57 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-11-26 20:41:57 +0100
commitad1c6547dddc9f53c4d0e6958a6e53c3fb90391a (patch)
treea6f4a804e38c6461f38e20747c8024e623244cd8 /sonar-core
parentf153a711e3af727e4a59a98ccc430b5763a2ad9a (diff)
downloadsonarqube-ad1c6547dddc9f53c4d0e6958a6e53c3fb90391a.tar.gz
sonarqube-ad1c6547dddc9f53c4d0e6958a6e53c3fb90391a.zip
Change type of column PROJECTS.AUTHORIZATION_UPDATED_AT from TIMESTAMP to BIGINT
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java6
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/db/IssueAuthorizationMapper.java33
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java3
-rw-r--r--sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java9
-rw-r--r--sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java6
-rw-r--r--sonar-core/src/main/java/org/sonar/core/resource/ResourceMapper.java3
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/issue/db/IssueAuthorizationMapper.xml88
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql4
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl2
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml4
-rw-r--r--sonar-core/src/test/java/org/sonar/core/component/ComponentDtoTest.java5
-rw-r--r--sonar-core/src/test/java/org/sonar/core/permission/PermissionFacadeTest.java5
-rw-r--r--sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java4
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_add_user_permission-result.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_add_user_permission.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_apply_permission_template.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_group_permission-result.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_group_permission.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_user_permission-result.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_user_permission.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_anyone_group_permission-result.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_anyone_group_permission.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_group_permission-result.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_group_permission.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/fixture.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/insert-result.xml4
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/update_authorization_date-result.xml2
28 files changed, 40 insertions, 164 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java b/sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java
index 719cd46ba12..9d1389309a6 100644
--- a/sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java
+++ b/sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java
@@ -46,7 +46,7 @@ public class ComponentDto extends Dto<String> implements Component {
private String language;
private Long subProjectId;
private boolean enabled = true;
- private Date authorizationUpdatedAt;
+ private Long authorizationUpdatedAt;
public Long getId() {
return id;
@@ -202,11 +202,11 @@ public class ComponentDto extends Dto<String> implements Component {
* Only available on projects
*/
@CheckForNull
- public Date getAuthorizationUpdatedAt() {
+ public Long getAuthorizationUpdatedAt() {
return authorizationUpdatedAt;
}
- public ComponentDto setAuthorizationUpdatedAt(@Nullable Date authorizationUpdatedAt) {
+ public ComponentDto setAuthorizationUpdatedAt(@Nullable Long authorizationUpdatedAt) {
this.authorizationUpdatedAt = authorizationUpdatedAt;
return this;
}
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueAuthorizationMapper.java b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueAuthorizationMapper.java
deleted file mode 100644
index d34ed67442d..00000000000
--- a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueAuthorizationMapper.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.core.issue.db;
-
-import org.apache.ibatis.annotations.Param;
-
-import javax.annotation.Nullable;
-
-import java.util.Date;
-
-public interface IssueAuthorizationMapper {
-
- IssueAuthorizationDto selectAfterDate(@Nullable @Param("date") Date date, @Param("permission") String permission, @Param("anyone") String anyoneGroup);
-
-}
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 79633975972..73f373f6a3d 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 = 714;
+ public static final int LAST_VERSION = 716;
/**
* List of all the tables.
* This list is hardcoded because we didn't succeed in using java.sql.DatabaseMetaData#getTables() in the same way
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java b/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
index cc81d7d2ccc..51da304c157 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
@@ -66,7 +66,6 @@ import org.sonar.core.issue.db.ActionPlanMapper;
import org.sonar.core.issue.db.ActionPlanStatsDto;
import org.sonar.core.issue.db.ActionPlanStatsMapper;
import org.sonar.core.issue.db.IssueAuthorizationDto;
-import org.sonar.core.issue.db.IssueAuthorizationMapper;
import org.sonar.core.issue.db.IssueChangeDto;
import org.sonar.core.issue.db.IssueChangeMapper;
import org.sonar.core.issue.db.IssueDto;
@@ -230,7 +229,7 @@ public class MyBatis implements BatchComponent, ServerComponent {
loadMapper(conf, "org.sonar.core.permission.PermissionMapper");
Class<?>[] mappers = {ActivityMapper.class, ActiveDashboardMapper.class, AuthorMapper.class, DashboardMapper.class,
DependencyMapper.class, DuplicationMapper.class, GraphDtoMapper.class,
- IssueMapper.class, IssueAuthorizationMapper.class, IssueChangeMapper.class, IssueFilterMapper.class, IssueFilterFavouriteMapper.class,
+ IssueMapper.class, IssueChangeMapper.class, IssueFilterMapper.class, IssueFilterFavouriteMapper.class,
LoadedTemplateMapper.class, MeasureFilterMapper.class, Migration44Mapper.class, PermissionTemplateMapper.class, PropertiesMapper.class, PurgeMapper.class,
ResourceKeyUpdaterMapper.class, ResourceIndexerMapper.class, ResourceSnapshotMapper.class, RoleMapper.class, RuleMapper.class,
SchemaMigrationMapper.class, SemaphoreMapper.class, UserMapper.class, GroupMapper.class, WidgetMapper.class, WidgetPropertyMapper.class,
diff --git a/sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java b/sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java
index 538ff9cbb7f..b26f6ff465e 100644
--- a/sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java
+++ b/sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java
@@ -35,7 +35,10 @@ import org.sonar.core.persistence.MyBatis;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
-import java.util.*;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
import static com.google.common.collect.Lists.newArrayList;
@@ -157,7 +160,7 @@ public class ResourceDao implements DaoComponent {
resource.setProjectUuid(uuid);
}
resource.setCreatedAt(now);
- resource.setAuthorizationUpdatedAt(now);
+ resource.setAuthorizationUpdatedAt(now.getTime());
mapper.insert(resource);
} else {
mapper.update(resource);
@@ -174,7 +177,7 @@ public class ResourceDao implements DaoComponent {
* Should not be called from batch side (used to reindex permission in E/S)
*/
public void updateAuthorizationDate(Long projectId, SqlSession session) {
- session.getMapper(ResourceMapper.class).updateAuthorizationDate(projectId, new Date(system2.now()));
+ session.getMapper(ResourceMapper.class).updateAuthorizationDate(projectId, system2.now());
}
@CheckForNull
diff --git a/sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java b/sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java
index 3e8f8ada5e9..3fef645f9ee 100644
--- a/sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java
+++ b/sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java
@@ -42,7 +42,7 @@ public class ResourceDto {
private Long copyResourceId;
private Long personId;
private Date createdAt;
- private Date authorizationUpdatedAt;
+ private Long authorizationUpdatedAt;
public Long getId() {
return id;
@@ -215,11 +215,11 @@ public class ResourceDto {
return this;
}
- public Date getAuthorizationUpdatedAt() {
+ public Long getAuthorizationUpdatedAt() {
return authorizationUpdatedAt;
}
- public ResourceDto setAuthorizationUpdatedAt(Date authorizationUpdatedAt) {
+ public ResourceDto setAuthorizationUpdatedAt(Long authorizationUpdatedAt) {
this.authorizationUpdatedAt = authorizationUpdatedAt;
return this;
}
diff --git a/sonar-core/src/main/java/org/sonar/core/resource/ResourceMapper.java b/sonar-core/src/main/java/org/sonar/core/resource/ResourceMapper.java
index e599e77f5ff..961e6bf3e9b 100644
--- a/sonar-core/src/main/java/org/sonar/core/resource/ResourceMapper.java
+++ b/sonar-core/src/main/java/org/sonar/core/resource/ResourceMapper.java
@@ -24,7 +24,6 @@ import org.apache.ibatis.session.ResultHandler;
import org.sonar.core.component.SnapshotDto;
import java.util.Collection;
-import java.util.Date;
import java.util.List;
public interface ResourceMapper {
@@ -77,6 +76,6 @@ public interface ResourceMapper {
void update(ResourceDto resource);
- void updateAuthorizationDate(@Param("projectId") Long projectId, @Param("authorizationDate") Date authorizationDate);
+ void updateAuthorizationDate(@Param("projectId") Long projectId, @Param("authorizationDate") Long authorizationDate);
}
diff --git a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueAuthorizationMapper.xml b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueAuthorizationMapper.xml
deleted file mode 100644
index 5b2def86db3..00000000000
--- a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueAuthorizationMapper.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mappei.dtd">
-
-<mapper namespace="org.sonar.core.issue.db.IssueAuthorizationMapper">
-
- <resultMap id="resultMap" type="map">
- <result property="project" column="project" />
- <result property="permissionUser" column="permissionUser"/>
- <result property="permissionGroup" column="permissionGroup"/>
- <result property="permissionRole" column="permissionRole"/>
- <result property="updatedAt" column="updatedAt" javaType="java.util.Date"/>
- </resultMap>
-
- <select id="selectAfterDate" parameterType="map" resultMap="resultMap"
- fetchSize="${_scrollFetchSize}" resultSetType="FORWARD_ONLY">
- SELECT
- project_authorization.project as "project",
- project_authorization.login as "permissionUser",
- project_authorization.permission_group as "permissionGroup",
- project_authorization.permission_role as "permissionRole",
- project_authorization.updated_at as "updatedAt"
- FROM (
- -- users
- SELECT
- projects.uuid AS project,
- projects.authorization_updated_at AS updated_at,
- users.login AS login,
- NULL AS permission_group,
- user_roles.role as permission_role
- FROM projects
- INNER JOIN user_roles ON user_roles.resource_id = projects.id AND user_roles.role = #{permission}
- INNER JOIN users ON users.id = user_roles.user_id
- WHERE
- projects.qualifier = 'TRK'
- AND projects.copy_resource_id is NULL
- <if test="date != null">
- AND projects.authorization_updated_at &gt;= #{date}
- </if>
- <if test="project != null">
- AND projects.uuid = #{project}
- </if>
- UNION
- -- groups without Anyone
- SELECT
- projects.uuid AS project,
- projects.authorization_updated_at AS updated_at,
- NULL AS login,
- groups.name AS permission_group,
- group_roles.role as permission_role
- FROM projects
- INNER JOIN group_roles ON group_roles.resource_id = projects.id AND group_roles.role = #{permission}
- INNER JOIN groups ON groups.id = group_roles.group_id
- WHERE
- projects.qualifier = 'TRK'
- AND projects.copy_resource_id is NULL
- <if test="date != null">
- AND projects.authorization_updated_at &gt;= #{date}
- </if>
- <if test="project != null">
- AND projects.uuid = #{project}
- </if>
- AND group_id IS NOT NULL
- UNION
- -- Anyone groups
- SELECT
- projects.uuid AS project,
- projects.authorization_updated_at AS updated_at,
- NULL AS login,
- #{anyone} AS permission_group,
- group_roles.role as permission_role
- FROM projects
- INNER JOIN group_roles ON group_roles.resource_id = projects.id AND group_roles.role = #{permission}
- WHERE
- projects.qualifier = 'TRK'
- AND projects.copy_resource_id is NULL
- <if test="date != null">
- AND projects.authorization_updated_at &gt;= #{date}
- </if>
- <if test="project != null">
- AND projects.uuid = #{project}
- </if>
- AND group_roles.group_id IS NULL
- ) project_authorization
- </select>
-
-</mapper>
-
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 1150833188c..4a0311f3d17 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
@@ -259,8 +259,6 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('601');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('603');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('604');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('605');
-INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('700');
-INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('701');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('702');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('703');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('704');
@@ -274,6 +272,8 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('711');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('712');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('713');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('714');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('715');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('716');
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 fec355edc63..722be701b68 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
@@ -271,7 +271,7 @@ CREATE TABLE "PROJECTS" (
"LONG_NAME" VARCHAR(256),
"PERSON_ID" INTEGER,
"CREATED_AT" TIMESTAMP,
- "AUTHORIZATION_UPDATED_AT" TIMESTAMP
+ "AUTHORIZATION_UPDATED_AT" BIGINT
);
CREATE TABLE "MANUAL_MEASURES" (
diff --git a/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml b/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml
index 337750718da..025d5f4deb1 100644
--- a/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml
@@ -226,9 +226,7 @@
<update id="updateAuthorizationDate" parameterType="map">
update projects set authorization_updated_at=#{authorizationDate}
- <where>
- AND id=#{projectId}
- </where>
+ where id=#{projectId}
</update>
</mapper>
diff --git a/sonar-core/src/test/java/org/sonar/core/component/ComponentDtoTest.java b/sonar-core/src/test/java/org/sonar/core/component/ComponentDtoTest.java
index de13c227c61..2816c20843b 100644
--- a/sonar-core/src/test/java/org/sonar/core/component/ComponentDtoTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/component/ComponentDtoTest.java
@@ -21,7 +21,6 @@
package org.sonar.core.component;
import org.junit.Test;
-import org.sonar.api.utils.DateUtils;
import static org.fest.assertions.Assertions.assertThat;
@@ -40,7 +39,7 @@ public class ComponentDtoTest {
.setLanguage("java")
.setPath("src/org/struts/RequestContext.java")
.setSubProjectId(3L)
- .setAuthorizationUpdatedAt(DateUtils.parseDate("2014-09-11"));
+ .setAuthorizationUpdatedAt(123456789L);
assertThat(componentDto.getId()).isEqualTo(1L);
assertThat(componentDto.key()).isEqualTo("org.struts:struts-core:src/org/struts/RequestContext.java");
@@ -52,7 +51,7 @@ public class ComponentDtoTest {
assertThat(componentDto.path()).isEqualTo("src/org/struts/RequestContext.java");
assertThat(componentDto.language()).isEqualTo("java");
assertThat(componentDto.subProjectId()).isEqualTo(3L);
- assertThat(componentDto.getAuthorizationUpdatedAt()).isEqualTo(DateUtils.parseDate("2014-09-11"));
+ assertThat(componentDto.getAuthorizationUpdatedAt()).isEqualTo(123456789L);
}
@Test
diff --git a/sonar-core/src/test/java/org/sonar/core/permission/PermissionFacadeTest.java b/sonar-core/src/test/java/org/sonar/core/permission/PermissionFacadeTest.java
index 26405bc7607..2f6a064e360 100644
--- a/sonar-core/src/test/java/org/sonar/core/permission/PermissionFacadeTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/permission/PermissionFacadeTest.java
@@ -26,7 +26,6 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.sonar.api.config.Settings;
-import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
import org.sonar.api.web.UserRole;
import org.sonar.core.persistence.AbstractDaoTestCase;
@@ -53,7 +52,7 @@ public class PermissionFacadeTest extends AbstractDaoTestCase {
@Before
public void setUp() {
system2 = mock(System2.class);
- when(system2.now()).thenReturn(DateUtils.parseDate("2014-09-03").getTime());
+ when(system2.now()).thenReturn(123456789L);
session = getMyBatis().openSession(false);
RoleDao roleDao = new RoleDao();
@@ -86,7 +85,7 @@ public class PermissionFacadeTest extends AbstractDaoTestCase {
assertThat(permissionFacade.selectUserPermissions(session, "marius", 123L)).containsOnly("admin");
- assertThat(resourceDao.getResource(123L, session).getAuthorizationUpdatedAt()).isEqualTo(DateUtils.parseDate("2014-09-03"));
+ assertThat(resourceDao.getResource(123L, session).getAuthorizationUpdatedAt()).isEqualTo(123456789L);
}
@Test
diff --git a/sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java b/sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java
index 0a3e21e3dd3..b5fdb0c48ac 100644
--- a/sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java
@@ -265,7 +265,7 @@ public class ResourceDaoTest extends AbstractDaoTestCase {
assertThat(file1.getId()).isNotNull();
assertThat(file2.getId()).isNotNull();
- checkTables("insert", "projects");
+ checkTables("insert", new String[] {"authorization_updated_at"}, "projects");
// SONAR-3636 : created_at must be fed when inserting a new entry in the 'projects' table
ResourceDto fileLoadedFromDB = dao.getResource(file1.getId());
@@ -436,7 +436,7 @@ public class ResourceDaoTest extends AbstractDaoTestCase {
public void update_authorization_date() {
setupData("update_authorization_date");
- when(system2.now()).thenReturn(DateUtils.parseDate("2014-09-03").getTime());
+ when(system2.now()).thenReturn(987654321L);
dao.updateAuthorizationDate(1L, session);
session.commit();
diff --git a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_add_user_permission-result.xml b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_add_user_permission-result.xml
index e3bec368812..dbd5e8b636c 100644
--- a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_add_user_permission-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_add_user_permission-result.xml
@@ -7,6 +7,6 @@
<projects id="100" 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]" authorization_updated_at="2014-09-03"/>
+ enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_add_user_permission.xml b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_add_user_permission.xml
index 48f61b2505a..d40ea59c0ba 100644
--- a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_add_user_permission.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_add_user_permission.xml
@@ -6,6 +6,6 @@
<projects id="123" 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]" authorization_updated_at="2010-01-01"/>
+ enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_apply_permission_template.xml b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_apply_permission_template.xml
index 8c761b5daaa..7d07da03f61 100644
--- a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_apply_permission_template.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_apply_permission_template.xml
@@ -2,7 +2,7 @@
<projects id="123" 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]" authorization_updated_at="2010-01-01"/>
+ enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/>
<groups id="100" name="sonar-administrators" />
<groups id="101" name="sonar-users" />
diff --git a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_group_permission-result.xml b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_group_permission-result.xml
index fc6722d58dd..d280edba4a5 100644
--- a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_group_permission-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_group_permission-result.xml
@@ -6,6 +6,6 @@
<projects id="123" 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]" authorization_updated_at="2014-09-03"/>
+ enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_group_permission.xml b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_group_permission.xml
index 70eb158107d..aa0328516a4 100644
--- a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_group_permission.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_group_permission.xml
@@ -7,6 +7,6 @@
<projects id="123" 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]" authorization_updated_at="2014-09-01"/>
+ enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_user_permission-result.xml b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_user_permission-result.xml
index 72df0ea9490..d40ea59c0ba 100644
--- a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_user_permission-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_user_permission-result.xml
@@ -6,6 +6,6 @@
<projects id="123" 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]" authorization_updated_at="2014-09-03"/>
+ enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_user_permission.xml b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_user_permission.xml
index 2e96b709620..fd37d39cbab 100644
--- a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_user_permission.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_delete_user_permission.xml
@@ -7,6 +7,6 @@
<projects id="123" 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]" authorization_updated_at="2014-09-01"/>
+ enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_anyone_group_permission-result.xml b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_anyone_group_permission-result.xml
index badbf13378a..9b43d347c46 100644
--- a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_anyone_group_permission-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_anyone_group_permission-result.xml
@@ -7,7 +7,7 @@
<projects id="123" 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]" authorization_updated_at="2014-09-03"/>
+ enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_anyone_group_permission.xml b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_anyone_group_permission.xml
index 4c9370a070b..8fb097772df 100644
--- a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_anyone_group_permission.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_anyone_group_permission.xml
@@ -6,7 +6,7 @@
<projects id="123" 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]" authorization_updated_at="2014-09-01"/>
+ enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_group_permission-result.xml b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_group_permission-result.xml
index 59fefdb7445..aa0328516a4 100644
--- a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_group_permission-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_group_permission-result.xml
@@ -7,6 +7,6 @@
<projects id="123" 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]" authorization_updated_at="2014-09-03"/>
+ enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_group_permission.xml b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_group_permission.xml
index a67a1967f9a..d280edba4a5 100644
--- a/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_group_permission.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/permission/PermissionFacadeTest/should_insert_group_permission.xml
@@ -6,6 +6,6 @@
<projects id="123" 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]" authorization_updated_at="2014-09-01"/>
+ enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/>
</dataset>
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 1819dc696de..b878d636fbe 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
@@ -9,7 +9,7 @@
uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="[null]"
description="the description" long_name="Apache Struts"
enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]"
- created_at="2008-12-02" authorization_updated_at="2014-09-03"/>
+ created_at="2008-12-02" authorization_updated_at="123456789"/>
<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]"
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 21ffd255e84..08cef5638d4 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
@@ -4,12 +4,12 @@
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="2014-09-03" path="/foo/bar" deprecated_kee="org.struts:struts:org.struts.Action"
- authorization_updated_at="2014-09-03"/>
+ authorization_updated_at="123456789"/>
<projects id="2" root_id="[null]" uuid="BCDE" project_uuid="FGHI" module_uuid="[null]" module_uuid_path="[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="2014-09-03" path="[null]" deprecated_kee="org.struts:struts:org.struts.Filter"
- authorization_updated_at="2014-09-03"/>
+ authorization_updated_at="123456789"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/update_authorization_date-result.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/update_authorization_date-result.xml
index 06dec472118..084fab84366 100644
--- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/update_authorization_date-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/update_authorization_date-result.xml
@@ -4,6 +4,6 @@
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"
- authorization_updated_at="2014-09-03"/>
+ authorization_updated_at="987654321"/>
</dataset>