diff options
184 files changed, 1008 insertions, 1153 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ComponentService.java b/server/sonar-server/src/main/java/org/sonar/server/component/ComponentService.java index 670dfea5f9c..5af8eddb220 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/component/ComponentService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/component/ComponentService.java @@ -31,9 +31,9 @@ import java.util.Map; import java.util.Set; import javax.annotation.CheckForNull; import javax.annotation.Nullable; +import org.sonar.api.ce.ComputeEngineSide; import org.sonar.api.i18n.I18n; import org.sonar.api.resources.Scopes; -import org.sonar.api.ce.ComputeEngineSide; import org.sonar.api.server.ServerSide; import org.sonar.api.utils.System2; import org.sonar.api.web.UserRole; @@ -112,7 +112,7 @@ public class ComponentService { try { ComponentDto projectOrModule = getByKey(session, projectOrModuleKey); userSession.checkComponentUuidPermission(UserRole.ADMIN, projectOrModule.projectUuid()); - dbClient.resourceKeyUpdaterDao().updateKey(projectOrModule.getId(), newKey); + dbClient.resourceKeyUpdaterDao().updateKey(projectOrModule.uuid(), newKey); session.commit(); session.commit(); @@ -126,7 +126,7 @@ public class ComponentService { try { ComponentDto project = getByKey(projectKey); userSession.checkComponentUuidPermission(UserRole.ADMIN, project.projectUuid()); - return dbClient.resourceKeyUpdaterDao().checkModuleKeysBeforeRenaming(project.getId(), stringToReplace, replacementString); + return dbClient.resourceKeyUpdaterDao().checkModuleKeysBeforeRenaming(project.uuid(), stringToReplace, replacementString); } finally { session.close(); } @@ -138,7 +138,7 @@ public class ComponentService { try { ComponentDto project = getByKey(session, projectKey); userSession.checkComponentUuidPermission(UserRole.ADMIN, project.projectUuid()); - dbClient.resourceKeyUpdaterDao().bulkUpdateKey(session, project.getId(), stringToReplace, replacementString); + dbClient.resourceKeyUpdaterDao().bulkUpdateKey(session, project.uuid(), stringToReplace, replacementString); session.commit(); } finally { session.close(); @@ -185,6 +185,7 @@ public class ComponentService { String uuid = Uuids.create(); ComponentDto component = new ComponentDto() .setUuid(uuid) + .setRootUuid(uuid) .setModuleUuid(null) .setModuleUuidPath(ComponentDto.MODULE_UUID_PATH_SEP + uuid + ComponentDto.MODULE_UUID_PATH_SEP) .setProjectUuid(uuid) diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ws/AppAction.java b/server/sonar-server/src/main/java/org/sonar/server/component/ws/AppAction.java index 71580811805..5e3291dbeb0 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/component/ws/AppAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/component/ws/AppAction.java @@ -134,11 +134,11 @@ public class AppAction implements RequestHandler { json.prop("longName", component.longName()); json.prop("q", component.qualifier()); - ComponentDto parentProject = nullableComponentById(component.parentProjectId(), session); + ComponentDto parentProject = retrieveRootIfNotCurrentComponent(component, session); ComponentDto project = dbClient.componentDao().selectOrFailByUuid(session, component.projectUuid()); // Do not display parent project if parent project and project are the same - boolean displayParentProject = parentProject != null && !parentProject.getId().equals(project.getId()); + boolean displayParentProject = parentProject != null && !parentProject.uuid().equals(project.uuid()); json.prop("subProject", displayParentProject ? parentProject.key() : null); json.prop("subProjectName", displayParentProject ? parentProject.longName() : null); json.prop("project", project.key()); @@ -188,11 +188,11 @@ public class AppAction implements RequestHandler { } @CheckForNull - private ComponentDto nullableComponentById(@Nullable Long componentId, DbSession session) { - if (componentId != null) { - return dbClient.componentDao().selectOrFailById(session, componentId); + private ComponentDto retrieveRootIfNotCurrentComponent(ComponentDto componentDto, DbSession session) { + if (componentDto.uuid().equals(componentDto.getRootUuid())) { + return null; } - return null; + return dbClient.componentDao().selectOrFailByUuid(session, componentDto.getRootUuid()); } @CheckForNull diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ws/ComponentDtoToWsComponent.java b/server/sonar-server/src/main/java/org/sonar/server/component/ws/ComponentDtoToWsComponent.java index b538fd7e56b..3fadd22a6c6 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/component/ws/ComponentDtoToWsComponent.java +++ b/server/sonar-server/src/main/java/org/sonar/server/component/ws/ComponentDtoToWsComponent.java @@ -50,11 +50,11 @@ class ComponentDtoToWsComponent { return wsComponent; } - static WsComponents.Component.Builder componentDtoToWsComponent(ComponentDto component, Map<Long, ComponentDto> referenceComponentsById) { + static WsComponents.Component.Builder componentDtoToWsComponent(ComponentDto component, Map<String, ComponentDto> referenceComponentsByUuid) { WsComponents.Component.Builder wsComponent = componentDtoToWsComponent(component); - ComponentDto referenceComponent = referenceComponentsById.get(component.getCopyResourceId()); - if (!referenceComponentsById.isEmpty() && referenceComponent != null) { + ComponentDto referenceComponent = referenceComponentsByUuid.get(component.getCopyResourceUuid()); + if (referenceComponent != null) { wsComponent.setRefId(referenceComponent.uuid()); wsComponent.setRefKey(referenceComponent.key()); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ws/TreeAction.java b/server/sonar-server/src/main/java/org/sonar/server/component/ws/TreeAction.java index 3ba6e4d9c96..41225d4d5c2 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/component/ws/TreeAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/component/ws/TreeAction.java @@ -19,18 +19,15 @@ */ package org.sonar.server.component.ws; -import com.google.common.base.Function; import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSortedSet; import com.google.common.collect.Sets; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import javax.annotation.CheckForNull; -import javax.annotation.Nonnull; import org.sonar.api.i18n.I18n; import org.sonar.api.resources.ResourceTypes; import org.sonar.api.server.ws.Request; @@ -179,31 +176,26 @@ public class TreeAction implements ComponentsWsAction { default: throw new IllegalStateException("Unknown component tree strategy"); } - Map<Long, ComponentDto> referenceComponentUuidsById = searchReferenceComponentUuidsById(dbSession, components); + Map<String, ComponentDto> referenceComponentsByUuid = searchreferenceComponentsByUuid(dbSession, components); - return buildResponse(baseComponent, components, referenceComponentUuidsById, + return buildResponse(baseComponent, components, referenceComponentsByUuid, Paging.forPageIndex(query.getPage()).withPageSize(query.getPageSize()).andTotal(total)); } finally { dbClient.closeSession(dbSession); } } - private Map<Long, ComponentDto> searchReferenceComponentUuidsById(DbSession dbSession, List<ComponentDtoWithSnapshotId> components) { - List<Long> referenceComponentIds = from(components) - .transform(ComponentDtoWithSnapshotIdToCopyResourceIdFunction.INSTANCE) - .filter(Predicates.<Long>notNull()) + private Map<String, ComponentDto> searchreferenceComponentsByUuid(DbSession dbSession, List<ComponentDtoWithSnapshotId> components) { + List<String> referenceComponentIds = from(components) + .transform(ComponentDto::getCopyResourceUuid) + .filter(Predicates.<String>notNull()) .toList(); if (referenceComponentIds.isEmpty()) { return emptyMap(); } - List<ComponentDto> referenceComponents = dbClient.componentDao().selectByIds(dbSession, referenceComponentIds); - Map<Long, ComponentDto> referenceComponentUuidsById = new HashMap<>(); - for (ComponentDto referenceComponent : referenceComponents) { - referenceComponentUuidsById.put(referenceComponent.getId(), referenceComponent); - } - - return referenceComponentUuidsById; + return from(dbClient.componentDao().selectByUuids(dbSession, referenceComponentIds)) + .uniqueIndex(ComponentDto::uuid); } private void checkPermissions(ComponentDto baseComponent) { @@ -215,8 +207,8 @@ public class TreeAction implements ComponentsWsAction { } } - private static TreeWsResponse buildResponse(ComponentDto baseComponent, List<ComponentDtoWithSnapshotId> components, Map<Long, ComponentDto> referenceComponentsById, - Paging paging) { + private static TreeWsResponse buildResponse(ComponentDto baseComponent, List<ComponentDtoWithSnapshotId> components, + Map<String, ComponentDto> referenceComponentsByUuid, Paging paging) { TreeWsResponse.Builder response = TreeWsResponse.newBuilder(); response.getPagingBuilder() .setPageIndex(paging.pageIndex()) @@ -224,9 +216,9 @@ public class TreeAction implements ComponentsWsAction { .setTotal(paging.total()) .build(); - response.setBaseComponent(componentDtoToWsComponent(baseComponent, referenceComponentsById)); + response.setBaseComponent(componentDtoToWsComponent(baseComponent, referenceComponentsByUuid)); for (ComponentDto dto : components) { - response.addComponents(componentDtoToWsComponent(dto, referenceComponentsById)); + response.addComponents(componentDtoToWsComponent(dto, referenceComponentsByUuid)); } return response.build(); @@ -238,7 +230,7 @@ public class TreeAction implements ComponentsWsAction { .setTotal(0) .setPageIndex(request.getPage()) .setPageSize(request.getPageSize()); - response.setBaseComponent(componentDtoToWsComponent(baseComponent, Collections.<Long, ComponentDto>emptyMap())); + response.setBaseComponent(componentDtoToWsComponent(baseComponent, Collections.<String, ComponentDto>emptyMap())); return response.build(); } @@ -302,11 +294,4 @@ public class TreeAction implements ComponentsWsAction { return treeWsRequest; } - private enum ComponentDtoWithSnapshotIdToCopyResourceIdFunction implements Function<ComponentDtoWithSnapshotId, Long> { - INSTANCE; - @Override - public Long apply(@Nonnull ComponentDtoWithSnapshotId input) { - return input.getCopyResourceId(); - } - } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/ProjectViewAttributes.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/ProjectViewAttributes.java index 2b1b0cb2c87..646db69d9a2 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/ProjectViewAttributes.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/ProjectViewAttributes.java @@ -25,18 +25,12 @@ import static java.util.Objects.requireNonNull; @Immutable public class ProjectViewAttributes { - private final long projectId; private final String projectUuid; - public ProjectViewAttributes(long projectId, String projectUuid) { - this.projectId = projectId; + public ProjectViewAttributes(String projectUuid) { this.projectUuid = requireNonNull(projectUuid, "projectUuid can't be null"); } - public long getProjectId() { - return projectId; - } - public String getProjectUuid() { return projectUuid; } @@ -44,7 +38,6 @@ public class ProjectViewAttributes { @Override public String toString() { return "ProjectViewAttributes{" + - "projectId=" + projectId + ", projectUuid='" + projectUuid + '\'' + '}'; } diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistComponentsStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistComponentsStep.java index d70fd5cce3e..823361a13a8 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistComponentsStep.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistComponentsStep.java @@ -192,6 +192,7 @@ public class PersistComponentsStep implements ComputationStep { res.setLongName(res.name()); res.setDescription(project.getDescription()); res.setProjectUuid(res.uuid()); + res.setRootUuid(res.uuid()); res.setModuleUuidPath(MODULE_UUID_PATH_SEP + res.uuid() + MODULE_UUID_PATH_SEP); return res; @@ -250,6 +251,7 @@ public class PersistComponentsStep implements ComputationStep { res.setDescription(view.getDescription()); res.setLongName(res.name()); res.setProjectUuid(res.uuid()); + res.setRootUuid(res.uuid()); res.setModuleUuidPath(MODULE_UUID_PATH_SEP + res.uuid() + MODULE_UUID_PATH_SEP); return res; @@ -276,7 +278,7 @@ public class PersistComponentsStep implements ComputationStep { res.setQualifier(Qualifiers.PROJECT); res.setName(projectView.getName()); res.setLongName(res.name()); - res.setCopyResourceId(projectView.getProjectViewAttributes().getProjectId()); + res.setCopyComponentUuid(projectView.getProjectViewAttributes().getProjectUuid()); setRootAndParentModule(res, path); @@ -301,7 +303,7 @@ public class PersistComponentsStep implements ComputationStep { */ private static void setRootAndParentModule(ComponentDto res, PathAwareVisitor.Path<ComponentDtoHolder> path) { ComponentDto projectDto = from(path.getCurrentPath()).last().get().getElement().getDto(); - res.setParentProjectId(projectDto.getId()); + res.setRootUuid(projectDto.uuid()); res.setProjectUuid(projectDto.uuid()); ComponentDto parentModule = path.parent().getDto(); @@ -318,7 +320,7 @@ public class PersistComponentsStep implements ComputationStep { .first() .get() .getElement().getDto(); - componentDto.setParentProjectId(parentModule.getId()); + componentDto.setRootUuid(parentModule.uuid()); componentDto.setProjectUuid(parentModule.projectUuid()); componentDto.setModuleUuid(parentModule.uuid()); componentDto.setModuleUuidPath(parentModule.moduleUuidPath()); @@ -350,12 +352,12 @@ public class PersistComponentsStep implements ComputationStep { existingComponent.setModuleUuidPath(newComponent.moduleUuidPath()); modified = true; } - if (!ObjectUtils.equals(existingComponent.parentProjectId(), newComponent.parentProjectId())) { - existingComponent.setParentProjectId(newComponent.parentProjectId()); + if (!ObjectUtils.equals(existingComponent.getRootUuid(), newComponent.getRootUuid())) { + existingComponent.setRootUuid(newComponent.getRootUuid()); modified = true; } - if (!ObjectUtils.equals(existingComponent.getCopyResourceId(), newComponent.getCopyResourceId())) { - existingComponent.setCopyResourceId(newComponent.getCopyResourceId()); + if (!ObjectUtils.equals(existingComponent.getCopyResourceUuid(), newComponent.getCopyResourceUuid())) { + existingComponent.setCopyComponentUuid(newComponent.getCopyResourceUuid()); modified = true; } if (!existingComponent.isEnabled()) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsJsonWriter.java b/server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsJsonWriter.java index c741633990c..1e6cee7f956 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsJsonWriter.java +++ b/server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsJsonWriter.java @@ -84,7 +84,7 @@ public class DuplicationsJsonWriter { private void writeFiles(Map<String, String> refByComponentKey, JsonWriter json, DbSession session) { Map<String, ComponentDto> projectsByUuid = newHashMap(); - Map<Long, ComponentDto> parentProjectsById = newHashMap(); + Map<String, ComponentDto> parentProjectsByUuid = newHashMap(); for (Map.Entry<String, String> entry : refByComponentKey.entrySet()) { String componentKey = entry.getKey(); String ref = entry.getValue(); @@ -95,7 +95,7 @@ public class DuplicationsJsonWriter { addFile(json, file); ComponentDto project = getProject(file.projectUuid(), projectsByUuid, session); - ComponentDto parentProject = getParentProject(file.parentProjectId(), parentProjectsById, session); + ComponentDto parentProject = getParentProject(file.getRootUuid(), parentProjectsByUuid, session); addProject(json, project, parentProject); json.endObject(); @@ -116,7 +116,7 @@ public class DuplicationsJsonWriter { json.prop("projectName", project.longName()); // Do not return sub project if sub project and project are the same - boolean displaySubProject = subProject != null && !subProject.getId().equals(project.getId()); + boolean displaySubProject = subProject != null && !subProject.uuid().equals(project.uuid()); if (displaySubProject) { json.prop("subProject", subProject.key()); json.prop("subProjectUuid", subProject.uuid()); @@ -137,13 +137,13 @@ public class DuplicationsJsonWriter { return project; } - private ComponentDto getParentProject(@Nullable Long projectId, Map<Long, ComponentDto> subProjectsById, DbSession session) { - ComponentDto project = subProjectsById.get(projectId); - if (project == null && projectId != null) { - Optional<ComponentDto> projectOptional = componentDao.selectById(session, projectId); + private ComponentDto getParentProject(String rootUuid, Map<String, ComponentDto> subProjectsByUuid, DbSession session) { + ComponentDto project = subProjectsByUuid.get(rootUuid); + if (project == null) { + Optional<ComponentDto> projectOptional = componentDao.selectByUuid(session, rootUuid); if (projectOptional.isPresent()) { project = projectOptional.get(); - subProjectsById.put(project.getId(), project); + subProjectsByUuid.put(project.uuid(), project); } } return project; diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java index 5fa880c1cf7..266214b6ed3 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java @@ -69,9 +69,7 @@ import static com.google.common.collect.FluentIterable.from; import static com.google.common.collect.Lists.newArrayList; import static java.lang.String.format; import static org.sonar.api.utils.DateUtils.longToDate; -import static org.sonar.db.component.ComponentDtoFunctions.toCopyResourceId; import static org.sonar.db.component.ComponentDtoFunctions.toProjectUuid; -import static org.sonar.db.component.ComponentDtoFunctions.toUuid; import static org.sonar.server.ws.WsUtils.checkFoundWithOptional; import static org.sonar.server.ws.WsUtils.checkRequest; import static org.sonarqube.ws.client.issue.IssueFilterParameters.COMPONENTS; @@ -403,9 +401,7 @@ public class IssueQueryService { Collection<String> developerUuids = Collections2.transform(technicalProjects, toProjectUuid()); Collection<String> authorsFromProjects = authorsFromParamsOrFromDeveloper(session, developerUuids, authors); builder.authors(authorsFromProjects); - Collection<Long> projectIds = Collections2.transform(technicalProjects, toCopyResourceId()); - List<ComponentDto> originalProjects = dbClient.componentDao().selectByIds(session, projectIds); - Collection<String> projectUuids = Collections2.transform(originalProjects, toUuid()); + Collection<String> projectUuids = Collections2.transform(technicalProjects, ComponentDto::getCopyResourceUuid); builder.projectUuids(projectUuids); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueAuthorizationDao.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueAuthorizationDao.java index d61b0ff76a2..96d06a875b1 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueAuthorizationDao.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueAuthorizationDao.java @@ -92,7 +92,7 @@ public class IssueAuthorizationDao { " FROM projects " + " WHERE " + " projects.qualifier = 'TRK' " + - " AND projects.copy_resource_id is NULL " + + " AND projects.copy_component_uuid is NULL " + " {dateCondition} " + " UNION " + @@ -108,7 +108,7 @@ public class IssueAuthorizationDao { " INNER JOIN users ON users.id = user_roles.user_id " + " WHERE " + " projects.qualifier = 'TRK' " + - " AND projects.copy_resource_id is NULL " + + " AND projects.copy_component_uuid is NULL " + " {dateCondition} " + " UNION " + @@ -124,7 +124,7 @@ public class IssueAuthorizationDao { " INNER JOIN groups ON groups.id = group_roles.group_id " + " WHERE " + " projects.qualifier = 'TRK' " + - " AND projects.copy_resource_id is NULL " + + " AND projects.copy_component_uuid is NULL " + " {dateCondition} " + " AND group_id IS NOT NULL " + " UNION " + @@ -140,7 +140,7 @@ public class IssueAuthorizationDao { " INNER JOIN group_roles ON group_roles.resource_id = projects.id AND group_roles.role='user' " + " WHERE " + " projects.qualifier = 'TRK' " + - " AND projects.copy_resource_id is NULL " + + " AND projects.copy_component_uuid is NULL " + " {dateCondition} " + " AND group_roles.group_id IS NULL " + " ) project_authorization"; diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java index f3d9f339afb..e9385a5c47d 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java @@ -304,10 +304,11 @@ public class SearchResponseFormat { Collection<ComponentDto> components = data.getComponents(); if (components != null) { for (ComponentDto dto : components) { + String uuid = dto.uuid(); Issues.Component.Builder builder = Issues.Component.newBuilder() .setId(dto.getId()) .setKey(dto.key()) - .setUuid(dto.uuid()) + .setUuid(uuid) .setQualifier(dto.qualifier()) .setName(nullToEmpty(dto.name())) .setLongName(nullToEmpty(dto.longName())) @@ -320,12 +321,11 @@ public class SearchResponseFormat { } // On a root project, parentProjectId is null but projectId is equal to itself, which make no sense. - if (dto.projectUuid() != null && dto.parentProjectId() != null) { + if (!uuid.equals(dto.getRootUuid())) { ComponentDto project = data.getComponentByUuid(dto.projectUuid()); builder.setProjectId(project.getId()); - } - if (dto.parentProjectId() != null) { - builder.setSubProjectId(dto.parentProjectId()); + ComponentDto subProject = data.getComponentByUuid(dto.getRootUuid()); + builder.setSubProjectId(subProject.getId()); } result.add(builder.build()); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterRow.java b/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterRow.java index 0a8669bddd5..21fd8e7bf19 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterRow.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterRow.java @@ -24,15 +24,15 @@ import org.apache.commons.lang.StringUtils; public class MeasureFilterRow { private final long snapshotId; private final long resourceId; - private final long resourceRootId; + private final String rootComponentUuid; private String sortText = null; private Long sortDate = null; private Double sortDouble = null; - MeasureFilterRow(long snapshotId, long resourceId, long resourceRootId) { + MeasureFilterRow(long snapshotId, long resourceId, String rootComponentUuid) { this.snapshotId = snapshotId; this.resourceId = resourceId; - this.resourceRootId = resourceRootId; + this.rootComponentUuid = rootComponentUuid; } public long getSnapshotId() { @@ -43,8 +43,8 @@ public class MeasureFilterRow { return resourceId; } - public long getResourceRootId() { - return resourceRootId; + public String getRootComponentUuid() { + return rootComponentUuid; } public String getSortText() { diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSql.java b/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSql.java index 125fe79428e..211b867bcb6 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSql.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSql.java @@ -96,7 +96,7 @@ class MeasureFilterSql { private String generateSql() { StringBuilder sb = new StringBuilder(1000); - sb.append("SELECT s.id, p.id, root.id, "); + sb.append("SELECT s.id, p.id, root.uuid, "); sb.append(filter.sort().column()); sb.append(" FROM snapshots s"); sb.append(" INNER JOIN projects p ON s.component_uuid=p.uuid "); @@ -134,7 +134,7 @@ class MeasureFilterSql { private void appendResourceConditions(StringBuilder sb) { sb.append(" s.status='P' AND s.islast=").append(database.getDialect().getTrueSqlValue()); if (context.getBaseSnapshot() == null) { - sb.append(" AND p.copy_resource_id IS NULL "); + sb.append(" AND p.copy_component_uuid IS NULL "); } if (!filter.getResourceQualifiers().isEmpty()) { sb.append(" AND s.qualifier IN "); @@ -259,7 +259,7 @@ class MeasureFilterSql { static class TextSortRowProcessor extends RowProcessor { @Override MeasureFilterRow fetch(ResultSet rs) throws SQLException { - MeasureFilterRow row = new MeasureFilterRow(rs.getLong(1), rs.getLong(2), rs.getLong(3)); + MeasureFilterRow row = new MeasureFilterRow(rs.getLong(1), rs.getLong(2), rs.getString(3)); row.setSortText(rs.getString(4)); return row; } @@ -304,7 +304,7 @@ class MeasureFilterSql { @Override MeasureFilterRow fetch(ResultSet rs) throws SQLException { - MeasureFilterRow row = new MeasureFilterRow(rs.getLong(1), rs.getLong(2), rs.getLong(3)); + MeasureFilterRow row = new MeasureFilterRow(rs.getLong(1), rs.getLong(2), rs.getString(3)); double value = rs.getDouble(4); if (!rs.wasNull()) { row.setSortDouble(value); @@ -333,7 +333,7 @@ class MeasureFilterSql { @Override MeasureFilterRow fetch(ResultSet rs) throws SQLException { - MeasureFilterRow row = new MeasureFilterRow(rs.getLong(1), rs.getLong(2), rs.getLong(3)); + MeasureFilterRow row = new MeasureFilterRow(rs.getLong(1), rs.getLong(2), rs.getString(3)); row.setSortDate(rs.getTimestamp(4).getTime()); return row; } @@ -352,7 +352,7 @@ class MeasureFilterSql { @Override MeasureFilterRow fetch(ResultSet rs) throws SQLException { - MeasureFilterRow row = new MeasureFilterRow(rs.getLong(1), rs.getLong(2), rs.getLong(3)); + MeasureFilterRow row = new MeasureFilterRow(rs.getLong(1), rs.getLong(2), rs.getString(3)); row.setSortDate(rs.getLong(4)); return row; } diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentAction.java b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentAction.java index 5a8f2b7e18e..185bd453cfe 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentAction.java @@ -58,6 +58,8 @@ import static com.google.common.base.MoreObjects.firstNonNull; import static com.google.common.collect.FluentIterable.from; import static java.lang.String.format; import static java.util.Collections.emptyList; +import static java.util.Collections.emptyMap; +import static java.util.Collections.singletonMap; import static org.sonar.core.util.Uuids.UUID_EXAMPLE_01; import static org.sonar.server.component.ComponentFinder.ParamNames.COMPONENT_ID_AND_KEY; import static org.sonar.server.component.ComponentFinder.ParamNames.DEVELOPER_ID_AND_KEY; @@ -156,11 +158,11 @@ public class ComponentAction implements MeasuresWsAction { } private Optional<ComponentDto> getReferenceComponent(DbSession dbSession, ComponentDto component) { - if (component.getCopyResourceId() == null) { + if (component.getCopyResourceUuid() == null) { return Optional.absent(); } - return dbClient.componentDao().selectById(dbSession, component.getCopyResourceId()); + return dbClient.componentDao().selectByUuid(dbSession, component.getCopyResourceUuid()); } private static ComponentWsResponse buildResponse(ComponentWsRequest request, ComponentDto component, Optional<ComponentDto> refComponent, List<MeasureDto> measures, @@ -172,12 +174,12 @@ public class ComponentAction implements MeasuresWsAction { MetricDto metric = metricsById.get(measure.getMetricId()); measuresByMetric.put(metric, measure); } - Map<Long, ComponentDto> referenceComponentUuidById = new HashMap<>(); if (refComponent.isPresent()) { - referenceComponentUuidById.put(refComponent.get().getId(), refComponent.get()); + response.setComponent(componentDtoToWsComponent(component, measuresByMetric, singletonMap(refComponent.get().uuid(), refComponent.get()))); + } else { + response.setComponent(componentDtoToWsComponent(component, measuresByMetric, emptyMap())); } - response.setComponent(componentDtoToWsComponent(component, measuresByMetric, referenceComponentUuidById)); List<String> additionalFields = request.getAdditionalFields(); if (additionalFields != null) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentDtoToWsComponent.java b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentDtoToWsComponent.java index 123dfdc9c97..ea97045cd0c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentDtoToWsComponent.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentDtoToWsComponent.java @@ -33,11 +33,11 @@ class ComponentDtoToWsComponent { } static WsMeasures.Component.Builder componentDtoToWsComponent(ComponentDto component, Map<MetricDto, MeasureDto> measuresByMetric, - Map<Long, ComponentDto> referenceComponentsById) { + Map<String, ComponentDto> referenceComponentsByUuid) { WsMeasures.Component.Builder wsComponent = componentDtoToWsComponent(component); - ComponentDto referenceComponent = referenceComponentsById.get(component.getCopyResourceId()); - if (!referenceComponentsById.isEmpty() && referenceComponent != null) { + ComponentDto referenceComponent = referenceComponentsByUuid.get(component.getCopyResourceUuid()); + if (referenceComponent != null) { wsComponent.setRefId(referenceComponent.uuid()); wsComponent.setRefKey(referenceComponent.key()); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeAction.java b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeAction.java index be23ef35f58..2b872defd6f 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeAction.java @@ -216,13 +216,13 @@ public class ComponentTreeAction implements MeasuresWsAction { componentDtoToWsComponent( data.getBaseComponent(), data.getMeasuresByComponentUuidAndMetric().row(data.getBaseComponent().uuid()), - data.getReferenceComponentsById())); + data.getReferenceComponentsByUuid())); for (ComponentDto componentDto : data.getComponents()) { response.addComponents(componentDtoToWsComponent( componentDto, data.getMeasuresByComponentUuidAndMetric().row(componentDto.uuid()), - data.getReferenceComponentsById())); + data.getReferenceComponentsByUuid())); } if (areMetricsInResponse(request)) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeData.java b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeData.java index 7c4505c61bf..78e779e4ff3 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeData.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeData.java @@ -35,7 +35,7 @@ class ComponentTreeData { private final ComponentDto baseComponent; private final List<ComponentDtoWithSnapshotId> components; private final int componentCount; - private final Map<Long, ComponentDto> referenceComponentsById; + private final Map<String, ComponentDto> referenceComponentsByUuid; private final List<MetricDto> metrics; private final List<WsMeasures.Period> periods; private final Table<String, MetricDto, MeasureDto> measuresByComponentUuidAndMetric; @@ -44,7 +44,7 @@ class ComponentTreeData { this.baseComponent = builder.baseComponent; this.components = builder.componentsFromDb; this.componentCount = builder.componentCount; - this.referenceComponentsById = builder.referenceComponentsById; + this.referenceComponentsByUuid = builder.referenceComponentsByUuid; this.metrics = builder.metrics; this.measuresByComponentUuidAndMetric = builder.measuresByComponentUuidAndMetric; this.periods = builder.periods; @@ -65,8 +65,8 @@ class ComponentTreeData { } @CheckForNull - public Map<Long, ComponentDto> getReferenceComponentsById() { - return referenceComponentsById; + public Map<String, ComponentDto> getReferenceComponentsByUuid() { + return referenceComponentsByUuid; } @CheckForNull @@ -91,7 +91,7 @@ class ComponentTreeData { static class Builder { private ComponentDto baseComponent; private List<ComponentDtoWithSnapshotId> componentsFromDb; - private Map<Long, ComponentDto> referenceComponentsById; + private Map<String, ComponentDto> referenceComponentsByUuid; private int componentCount; private List<MetricDto> metrics; private List<WsMeasures.Period> periods; @@ -131,8 +131,8 @@ class ComponentTreeData { return this; } - public Builder setReferenceComponentsById(Map<Long, ComponentDto> referenceComponentsById) { - this.referenceComponentsById = referenceComponentsById; + public Builder setReferenceComponentsByUuid(Map<String, ComponentDto> referenceComponentsByUuid) { + this.referenceComponentsByUuid = referenceComponentsByUuid; return this; } diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeDataLoader.java b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeDataLoader.java index 3b29e1c58a4..4063539a8d3 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeDataLoader.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeDataLoader.java @@ -24,6 +24,7 @@ import com.google.common.base.Joiner; import com.google.common.base.Optional; import com.google.common.base.Predicate; import com.google.common.base.Predicates; +import com.google.common.collect.FluentIterable; import com.google.common.collect.HashBasedTable; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; @@ -121,7 +122,7 @@ public class ComponentTreeDataLoader { components = sortComponents(components, wsRequest, metrics, measuresByComponentUuidAndMetric); int componentCount = computeComponentCount(componentDtosAndTotal.total, components, componentWithMeasuresOnly(wsRequest)); components = paginateComponents(components, wsRequest); - Map<Long, ComponentDto> referenceComponentsById = searchReferenceComponentsById(dbSession, components); + Map<String, ComponentDto> referenceComponentsById = searchReferenceComponentsById(dbSession, components); return ComponentTreeData.builder() .setBaseComponent(baseComponent) @@ -130,7 +131,7 @@ public class ComponentTreeDataLoader { .setMeasuresByComponentUuidAndMetric(measuresByComponentUuidAndMetric) .setMetrics(metrics) .setPeriods(periods) - .setReferenceComponentsById(referenceComponentsById) + .setReferenceComponentsByUuid(referenceComponentsById) .build(); } finally { dbClient.closeSession(dbSession); @@ -150,22 +151,17 @@ public class ComponentTreeDataLoader { return componentFinder.getByUuidOrKey(dbSession, wsRequest.getDeveloperId(), wsRequest.getDeveloperKey(), DEVELOPER_ID_AND_KEY).getId(); } - private Map<Long, ComponentDto> searchReferenceComponentsById(DbSession dbSession, List<ComponentDtoWithSnapshotId> components) { - List<Long> referenceComponentIds = from(components) - .transform(ComponentDtoWithSnapshotIdToCopyResourceIdFunction.INSTANCE) - .filter(Predicates.<Long>notNull()) + private Map<String, ComponentDto> searchReferenceComponentsById(DbSession dbSession, List<ComponentDtoWithSnapshotId> components) { + List<String> referenceComponentUUids = from(components) + .transform(ComponentDto::getCopyResourceUuid) + .filter(Predicates.<String>notNull()) .toList(); - if (referenceComponentIds.isEmpty()) { + if (referenceComponentUUids.isEmpty()) { return emptyMap(); } - List<ComponentDto> referenceComponents = dbClient.componentDao().selectByIds(dbSession, referenceComponentIds); - Map<Long, ComponentDto> referenceComponentUuidsById = new HashMap<>(); - for (ComponentDto referenceComponent : referenceComponents) { - referenceComponentUuidsById.put(referenceComponent.getId(), referenceComponent); - } - - return referenceComponentUuidsById; + return FluentIterable.from(dbClient.componentDao().selectByUuids(dbSession, referenceComponentUUids)) + .uniqueIndex(ComponentDto::uuid); } private ComponentDtosAndTotal searchComponents(DbSession dbSession, ComponentTreeQuery dbQuery, ComponentTreeWsRequest wsRequest) { @@ -409,15 +405,6 @@ public class ComponentTreeDataLoader { } } - private enum ComponentDtoWithSnapshotIdToCopyResourceIdFunction implements Function<ComponentDtoWithSnapshotId, Long> { - INSTANCE; - - @Override - public Long apply(@Nonnull ComponentDtoWithSnapshotId input) { - return input.getCopyResourceId(); - } - } - private static class MatchMetricKey implements Predicate<MetricDto> { private final String metricKeyToSort; diff --git a/server/sonar-server/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java b/server/sonar-server/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java index e069e6c296b..96b87788136 100644 --- a/server/sonar-server/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java +++ b/server/sonar-server/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java @@ -207,7 +207,7 @@ public class CeQueueImplTest { } private static ComponentDto newComponentDto(String uuid) { - return new ComponentDto().setUuid(uuid).setName("name_" + uuid).setKey("key_" + uuid); + return new ComponentDto().setUuid(uuid).setRootUuid(uuid).setName("name_" + uuid).setKey("key_" + uuid); } private CeTask submit(String reportType, String componentUuid) { diff --git a/server/sonar-server/src/test/java/org/sonar/server/batch/ProjectDataLoaderTest.java b/server/sonar-server/src/test/java/org/sonar/server/batch/ProjectDataLoaderTest.java index cc3683e6098..7ff44abc27d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/batch/ProjectDataLoaderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/batch/ProjectDataLoaderTest.java @@ -80,6 +80,7 @@ public class ProjectDataLoaderTest { underTest.load(ProjectDataQuery.create().setModuleKey(key)); } + private int uuidCounter = 0; @Test public void load_fails_with_BRE_if_component_is_neither_a_project_or_a_module() { String[][] allScopesAndQualifierButProjectAndModule = { @@ -96,7 +97,8 @@ public class ProjectDataLoaderTest { String scope = scopeAndQualifier[0]; String qualifier = scopeAndQualifier[1]; String key = "theKey_" + scope + "_" + qualifier; - dbClient.componentDao().insert(dbSession, new ComponentDto().setScope(scope).setQualifier(qualifier).setKey(key)); + String uuid = "uuid_" + uuidCounter++; + dbClient.componentDao().insert(dbSession, new ComponentDto().setUuid(uuid).setRootUuid(uuid).setScope(scope).setQualifier(qualifier).setKey(key)); dbSession.commit(); try { diff --git a/server/sonar-server/src/test/java/org/sonar/server/ce/ws/TaskFormatterTest.java b/server/sonar-server/src/test/java/org/sonar/server/ce/ws/TaskFormatterTest.java index 620b0e7dc55..c2b3c191354 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ce/ws/TaskFormatterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ce/ws/TaskFormatterTest.java @@ -85,8 +85,9 @@ public class TaskFormatterTest { @Test public void formatQueue_with_component_and_other_fields() throws IOException { when(ceLogging.getFile(any(LogFileRef.class))).thenReturn(Optional.of(temp.newFile())); + String uuid = "COMPONENT_UUID"; db.getDbClient().componentDao().insert(db.getSession(), new ComponentDto() - .setUuid("COMPONENT_UUID").setKey("COMPONENT_KEY").setName("Component Name").setQualifier(Qualifiers.PROJECT)); + .setUuid(uuid).setRootUuid(uuid).setKey("COMPONENT_KEY").setName("Component Name").setQualifier(Qualifiers.PROJECT)); CeQueueDto dto = new CeQueueDto(); dto.setUuid("UUID"); @@ -94,14 +95,14 @@ public class TaskFormatterTest { dto.setStatus(CeQueueDto.Status.IN_PROGRESS); dto.setCreatedAt(1_450_000_000_000L); dto.setStartedAt(1_451_000_000_000L); - dto.setComponentUuid("COMPONENT_UUID"); + dto.setComponentUuid(uuid); dto.setSubmitterLogin("rob"); WsCe.Task wsTask = underTest.formatQueue(db.getSession(), dto); assertThat(wsTask.getType()).isEqualTo("TYPE"); assertThat(wsTask.getId()).isEqualTo("UUID"); - assertThat(wsTask.getComponentId()).isEqualTo("COMPONENT_UUID"); + assertThat(wsTask.getComponentId()).isEqualTo(uuid); assertThat(wsTask.getComponentKey()).isEqualTo("COMPONENT_KEY"); assertThat(wsTask.getComponentName()).isEqualTo("Component Name"); assertThat(wsTask.getComponentQualifier()).isEqualTo("TRK"); diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ws/AppActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ws/AppActionTest.java index c2d7d1f65f0..545857ebec5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ws/AppActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ws/AppActionTest.java @@ -123,9 +123,9 @@ public class AppActionTest { .setProjectUuid("THE_PROJECT") .setLongName("src/main/java/org/sonar/api/Plugin.java") .setPath("src/main/java/org/sonar/api/Plugin.java") - .setParentProjectId(5L); + .setRootUuid("uuid_5"); when(componentDao.selectByUuid(session, COMPONENT_UUID)).thenReturn(Optional.of(file)); - when(componentDao.selectOrFailById(session, 5L)).thenReturn(new ComponentDto().setId(5L).setLongName("SonarQube :: Plugin API").setKey(SUB_PROJECT_KEY)); + when(componentDao.selectOrFailByUuid(session, "uuid_5")).thenReturn(new ComponentDto().setUuid("uuid_5").setLongName("SonarQube :: Plugin API").setKey(SUB_PROJECT_KEY)); when(componentDao.selectOrFailByUuid(session, project.uuid())).thenReturn(project); when(propertiesDao.selectByQuery(any(PropertyQuery.class), eq(session))).thenReturn(newArrayList(new PropertyDto())); @@ -227,9 +227,9 @@ public class AppActionTest { .setName("Plugin.java") .setLongName("src/main/java/org/sonar/api/Plugin.java") .setPath("src/main/java/org/sonar/api/Plugin.java") - .setParentProjectId(5L); + .setRootUuid("uuid_5"); when(componentDao.selectByUuid(session, COMPONENT_UUID)).thenReturn(Optional.of(file)); - when(componentDao.selectOrFailById(session, 5L)).thenReturn(new ComponentDto().setId(5L).setLongName("SonarQube :: Plugin API").setKey(SUB_PROJECT_KEY)); + when(componentDao.selectOrFailByUuid(session, "uuid_5")).thenReturn(new ComponentDto().setUuid("uuid_5").setLongName("SonarQube :: Plugin API").setKey(SUB_PROJECT_KEY)); when(componentDao.selectOrFailByUuid(session, project.uuid())).thenReturn(project); return file; } diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ws/TreeActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ws/TreeActionTest.java index 9617ea2e474..80b67c4c27f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ws/TreeActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ws/TreeActionTest.java @@ -402,6 +402,7 @@ public class TreeActionTest { JsonObject componentAsJsonObject = componentAsJsonElement.getAsJsonObject(); componentDb.insertComponentAndSnapshot(new ComponentDto() .setUuid(getJsonField(componentAsJsonObject, "id")) + .setRootUuid("root_uuid") .setKey(getJsonField(componentAsJsonObject, "key")) .setName(getJsonField(componentAsJsonObject, "name")) .setLanguage(getJsonField(componentAsJsonObject, "language")) diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/queue/InternalCeQueueImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/queue/InternalCeQueueImplTest.java index aeedba846ce..5e407ac4fa6 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/queue/InternalCeQueueImplTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/queue/InternalCeQueueImplTest.java @@ -307,7 +307,7 @@ public class InternalCeQueueImplTest { } private static ComponentDto newComponentDto(String uuid) { - return new ComponentDto().setUuid(uuid).setName("name_" + uuid).setKey("key_" + uuid); + return new ComponentDto().setUuid(uuid).setRootUuid(uuid).setName("name_" + uuid).setKey("key_" + uuid); } private CeTask submit(String reportType, String componentUuid) { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java index 37d66d469c3..68e97a0758c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java @@ -391,7 +391,7 @@ public class PersistMeasuresStepTest extends BaseStepTest { } private ComponentDto addComponent(String key, String uuid) { - ComponentDto componentDto = new ComponentDto().setKey(key).setUuid(uuid); + ComponentDto componentDto = new ComponentDto().setKey(key).setUuid(uuid).setRootUuid(uuid); dbClient.componentDao().insert(dbTester.getSession(), componentDto); return componentDto; } diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportPersistComponentsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportPersistComponentsStepTest.java index 3977c052c7c..dbddd340e32 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportPersistComponentsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportPersistComponentsStepTest.java @@ -117,7 +117,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(projectDto.projectUuid()).isEqualTo(projectDto.uuid()); assertThat(projectDto.qualifier()).isEqualTo("TRK"); assertThat(projectDto.scope()).isEqualTo("PRJ"); - assertThat(projectDto.parentProjectId()).isNull(); + assertThat(projectDto.getRootUuid()).isEqualTo("ABCD"); assertThat(projectDto.getCreatedAt()).isEqualTo(now); ComponentDto moduleDto = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_KEY").get(); @@ -130,7 +130,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(moduleDto.projectUuid()).isEqualTo(projectDto.uuid()); assertThat(moduleDto.qualifier()).isEqualTo("BRC"); assertThat(moduleDto.scope()).isEqualTo("PRJ"); - assertThat(moduleDto.parentProjectId()).isEqualTo(projectDto.getId()); + assertThat(moduleDto.getRootUuid()).isEqualTo(projectDto.uuid()); assertThat(moduleDto.getCreatedAt()).isEqualTo(now); ComponentDto directoryDto = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_KEY:src/main/java/dir").get(); @@ -143,7 +143,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(directoryDto.projectUuid()).isEqualTo(projectDto.uuid()); assertThat(directoryDto.qualifier()).isEqualTo("DIR"); assertThat(directoryDto.scope()).isEqualTo("DIR"); - assertThat(directoryDto.parentProjectId()).isEqualTo(moduleDto.getId()); + assertThat(directoryDto.getRootUuid()).isEqualTo(moduleDto.uuid()); assertThat(directoryDto.getCreatedAt()).isEqualTo(now); ComponentDto fileDto = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_KEY:src/main/java/dir/Foo.java").get(); @@ -157,7 +157,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(fileDto.projectUuid()).isEqualTo(projectDto.uuid()); assertThat(fileDto.qualifier()).isEqualTo("FIL"); assertThat(fileDto.scope()).isEqualTo("FIL"); - assertThat(fileDto.parentProjectId()).isEqualTo(moduleDto.getId()); + assertThat(fileDto.getRootUuid()).isEqualTo(moduleDto.uuid()); assertThat(fileDto.getCreatedAt()).isEqualTo(now); assertThat(dbIdsRepository.getComponentId(project)).isEqualTo(projectDto.getId()); @@ -254,23 +254,23 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(moduleReloaded.moduleUuid()).isEqualTo(module.moduleUuid()); assertThat(moduleReloaded.moduleUuidPath()).isEqualTo(module.moduleUuidPath()); assertThat(moduleReloaded.projectUuid()).isEqualTo(module.projectUuid()); - assertThat(moduleReloaded.parentProjectId()).isEqualTo(module.parentProjectId()); + assertThat(moduleReloaded.getRootUuid()).isEqualTo(module.getRootUuid()); ComponentDto directory = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_KEY:src/main/java/dir").get(); assertThat(directory.moduleUuid()).isEqualTo(module.uuid()); assertThat(directory.moduleUuidPath()).isEqualTo(module.moduleUuidPath()); assertThat(directory.projectUuid()).isEqualTo(project.uuid()); - assertThat(directory.parentProjectId()).isEqualTo(module.getId()); + assertThat(directory.getRootUuid()).isEqualTo(module.uuid()); ComponentDto file = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_KEY:src/main/java/dir/Foo.java").get(); assertThat(file.moduleUuid()).isEqualTo(module.uuid()); assertThat(file.moduleUuidPath()).isEqualTo(module.moduleUuidPath()); assertThat(file.projectUuid()).isEqualTo(project.uuid()); - assertThat(file.parentProjectId()).isEqualTo(module.getId()); + assertThat(file.getRootUuid()).isEqualTo(module.uuid()); } @Test - public void compute_parent_project_id() { + public void compute_root_uuid() { treeRootHolder.setRoot( builder(PROJECT, 1).setUuid("ABCD").setKey(PROJECT_KEY) .setName("Project") @@ -298,23 +298,23 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { Optional<ComponentDto> project = dbClient.componentDao().selectByKey(dbTester.getSession(), PROJECT_KEY); assertThat(project).isPresent(); - assertThat(project.get().parentProjectId()).isNull(); + assertThat(project.get().getRootUuid()).isEqualTo("ABCD"); Optional<ComponentDto> module = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_KEY"); assertThat(module).isPresent(); - assertThat(module.get().parentProjectId()).isEqualTo(project.get().getId()); + assertThat(module.get().getRootUuid()).isEqualTo(project.get().uuid()); Optional<ComponentDto> subModule1 = dbClient.componentDao().selectByKey(dbTester.getSession(), "SUB_MODULE_1_KEY"); assertThat(subModule1).isPresent(); - assertThat(subModule1.get().parentProjectId()).isEqualTo(project.get().getId()); + assertThat(subModule1.get().getRootUuid()).isEqualTo(project.get().uuid()); Optional<ComponentDto> subModule2 = dbClient.componentDao().selectByKey(dbTester.getSession(), "SUB_MODULE_2_KEY"); assertThat(subModule2).isPresent(); - assertThat(subModule2.get().parentProjectId()).isEqualTo(project.get().getId()); + assertThat(subModule2.get().getRootUuid()).isEqualTo(project.get().uuid()); Optional<ComponentDto> directory = dbClient.componentDao().selectByKey(dbTester.getSession(), "SUB_MODULE_2_KEY:src/main/java/dir"); assertThat(directory).isPresent(); - assertThat(directory.get().parentProjectId()).isEqualTo(subModule2.get().getId()); + assertThat(directory.get().getRootUuid()).isEqualTo(subModule2.get().uuid()); } @Test @@ -342,22 +342,22 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { ComponentDto project = dbClient.componentDao().selectByKey(dbTester.getSession(), PROJECT_KEY).get(); assertThat(project.moduleUuid()).isNull(); assertThat(project.moduleUuidPath()).isEqualTo("." + project.uuid() + "."); - assertThat(project.parentProjectId()).isNull(); + assertThat(project.getRootUuid()).isEqualTo("ABCD"); ComponentDto moduleA = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_A").get(); assertThat(moduleA.moduleUuid()).isEqualTo(project.uuid()); assertThat(moduleA.moduleUuidPath()).isEqualTo(project.moduleUuidPath() + moduleA.uuid() + "."); - assertThat(moduleA.parentProjectId()).isEqualTo(project.getId()); + assertThat(moduleA.getRootUuid()).isEqualTo(project.uuid()); ComponentDto subModuleA = dbClient.componentDao().selectByKey(dbTester.getSession(), "SUB_MODULE_A").get(); assertThat(subModuleA.moduleUuid()).isEqualTo(moduleA.uuid()); assertThat(subModuleA.moduleUuidPath()).isEqualTo(moduleA.moduleUuidPath() + subModuleA.uuid() + "."); - assertThat(subModuleA.parentProjectId()).isEqualTo(project.getId()); + assertThat(subModuleA.getRootUuid()).isEqualTo(project.uuid()); ComponentDto moduleB = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_B").get(); assertThat(moduleB.moduleUuid()).isEqualTo(project.uuid()); assertThat(moduleB.moduleUuidPath()).isEqualTo(project.moduleUuidPath() + moduleB.uuid() + "."); - assertThat(moduleB.parentProjectId()).isEqualTo(project.getId()); + assertThat(moduleB.getRootUuid()).isEqualTo(project.uuid()); } @Test @@ -402,7 +402,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(projectReloaded.moduleUuid()).isEqualTo(project.moduleUuid()); assertThat(projectReloaded.moduleUuidPath()).isEqualTo(project.moduleUuidPath()); assertThat(projectReloaded.projectUuid()).isEqualTo(project.projectUuid()); - assertThat(projectReloaded.parentProjectId()).isEqualTo(project.parentProjectId()); + assertThat(projectReloaded.getRootUuid()).isEqualTo(project.getRootUuid()); ComponentDto moduleReloaded = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_KEY").get(); assertThat(moduleReloaded.getId()).isEqualTo(module.getId()); @@ -410,14 +410,14 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(moduleReloaded.moduleUuid()).isEqualTo(module.moduleUuid()); assertThat(moduleReloaded.moduleUuidPath()).isEqualTo(module.moduleUuidPath()); assertThat(moduleReloaded.projectUuid()).isEqualTo(module.projectUuid()); - assertThat(moduleReloaded.parentProjectId()).isEqualTo(module.parentProjectId()); + assertThat(moduleReloaded.getRootUuid()).isEqualTo(module.getRootUuid()); ComponentDto directoryReloaded = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_KEY:src/main/java/dir").get(); assertThat(directoryReloaded.uuid()).isEqualTo(directory.uuid()); assertThat(directoryReloaded.moduleUuid()).isEqualTo(directory.moduleUuid()); assertThat(directoryReloaded.moduleUuidPath()).isEqualTo(directory.moduleUuidPath()); assertThat(directoryReloaded.projectUuid()).isEqualTo(directory.projectUuid()); - assertThat(directoryReloaded.parentProjectId()).isEqualTo(directory.parentProjectId()); + assertThat(directoryReloaded.getRootUuid()).isEqualTo(directory.getRootUuid()); assertThat(directoryReloaded.name()).isEqualTo(directory.name()); assertThat(directoryReloaded.path()).isEqualTo(directory.path()); @@ -426,7 +426,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(fileReloaded.moduleUuid()).isEqualTo(file.moduleUuid()); assertThat(fileReloaded.moduleUuidPath()).isEqualTo(file.moduleUuidPath()); assertThat(fileReloaded.projectUuid()).isEqualTo(file.projectUuid()); - assertThat(fileReloaded.parentProjectId()).isEqualTo(file.parentProjectId()); + assertThat(fileReloaded.getRootUuid()).isEqualTo(file.getRootUuid()); assertThat(fileReloaded.name()).isEqualTo(file.name()); assertThat(fileReloaded.path()).isEqualTo(file.path()); } @@ -555,7 +555,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(moduleBReloaded.moduleUuid()).isEqualTo(moduleAreloaded.uuid()); assertThat(moduleBReloaded.moduleUuidPath()).isEqualTo(moduleAreloaded.moduleUuidPath() + moduleBReloaded.uuid() + "."); assertThat(moduleBReloaded.projectUuid()).isEqualTo(project.uuid()); - assertThat(moduleBReloaded.parentProjectId()).isEqualTo(project.getId()); + assertThat(moduleBReloaded.getRootUuid()).isEqualTo(project.uuid()); ComponentDto directoryReloaded = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_B:src/main/java/dir").get(); assertThat(directoryReloaded).isNotNull(); @@ -563,7 +563,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(directoryReloaded.moduleUuid()).isEqualTo(moduleBReloaded.uuid()); assertThat(directoryReloaded.moduleUuidPath()).isEqualTo(moduleBReloaded.moduleUuidPath()); assertThat(directoryReloaded.projectUuid()).isEqualTo(project.uuid()); - assertThat(directoryReloaded.parentProjectId()).isEqualTo(moduleBReloaded.getId()); + assertThat(directoryReloaded.getRootUuid()).isEqualTo(moduleBReloaded.uuid()); ComponentDto fileReloaded = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_B:src/main/java/dir/Foo.java").get(); assertThat(fileReloaded).isNotNull(); @@ -571,7 +571,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(fileReloaded.moduleUuid()).isEqualTo(moduleBReloaded.uuid()); assertThat(fileReloaded.moduleUuidPath()).isEqualTo(moduleBReloaded.moduleUuidPath()); assertThat(fileReloaded.projectUuid()).isEqualTo(project.uuid()); - assertThat(fileReloaded.parentProjectId()).isEqualTo(moduleBReloaded.getId()); + assertThat(fileReloaded.getRootUuid()).isEqualTo(moduleBReloaded.uuid()); } @Test @@ -638,7 +638,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(projectReloaded.moduleUuid()).isEqualTo(project.moduleUuid()); assertThat(projectReloaded.moduleUuidPath()).isEqualTo(project.moduleUuidPath()); assertThat(projectReloaded.projectUuid()).isEqualTo(project.projectUuid()); - assertThat(projectReloaded.parentProjectId()).isEqualTo(project.parentProjectId()); + assertThat(projectReloaded.getRootUuid()).isEqualTo(project.getRootUuid()); assertThat(projectReloaded.isEnabled()).isTrue(); ComponentDto moduleReloaded = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_KEY").get(); @@ -647,7 +647,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(moduleReloaded.moduleUuid()).isEqualTo(removedModule.moduleUuid()); assertThat(moduleReloaded.moduleUuidPath()).isEqualTo(removedModule.moduleUuidPath()); assertThat(moduleReloaded.projectUuid()).isEqualTo(removedModule.projectUuid()); - assertThat(moduleReloaded.parentProjectId()).isEqualTo(removedModule.parentProjectId()); + assertThat(moduleReloaded.getRootUuid()).isEqualTo(removedModule.getRootUuid()); assertThat(moduleReloaded.isEnabled()).isTrue(); ComponentDto directoryReloaded = dbClient.componentDao().selectByKey(dbTester.getSession(), "MODULE_KEY:src/main/java/dir").get(); @@ -656,7 +656,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(directoryReloaded.moduleUuid()).isEqualTo(removedDirectory.moduleUuid()); assertThat(directoryReloaded.moduleUuidPath()).isEqualTo(removedDirectory.moduleUuidPath()); assertThat(directoryReloaded.projectUuid()).isEqualTo(removedDirectory.projectUuid()); - assertThat(directoryReloaded.parentProjectId()).isEqualTo(removedDirectory.parentProjectId()); + assertThat(directoryReloaded.getRootUuid()).isEqualTo(removedDirectory.getRootUuid()); assertThat(directoryReloaded.name()).isEqualTo(removedDirectory.name()); assertThat(directoryReloaded.path()).isEqualTo(removedDirectory.path()); assertThat(directoryReloaded.isEnabled()).isTrue(); @@ -667,7 +667,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(fileReloaded.moduleUuid()).isEqualTo(removedFile.moduleUuid()); assertThat(fileReloaded.moduleUuidPath()).isEqualTo(removedFile.moduleUuidPath()); assertThat(fileReloaded.projectUuid()).isEqualTo(removedFile.projectUuid()); - assertThat(fileReloaded.parentProjectId()).isEqualTo(removedFile.parentProjectId()); + assertThat(fileReloaded.getRootUuid()).isEqualTo(removedFile.getRootUuid()); assertThat(fileReloaded.name()).isEqualTo(removedFile.name()); assertThat(fileReloaded.path()).isEqualTo(removedFile.path()); assertThat(fileReloaded.isEnabled()).isTrue(); @@ -717,7 +717,7 @@ public class ReportPersistComponentsStepTest extends BaseStepTest { assertThat(fileReloaded.moduleUuid()).isEqualTo(moduleReloaded.uuid()); assertThat(fileReloaded.moduleUuidPath()).isEqualTo(moduleReloaded.moduleUuidPath()); assertThat(fileReloaded.projectUuid()).isEqualTo(moduleReloaded.projectUuid()); - assertThat(fileReloaded.parentProjectId()).isEqualTo(moduleReloaded.getId()); + assertThat(fileReloaded.getRootUuid()).isEqualTo(moduleReloaded.uuid()); assertThat(fileReloaded.name()).isEqualTo(removedFile.name()); assertThat(fileReloaded.path()).isEqualTo(removedFile.path()); assertThat(fileReloaded.isEnabled()).isTrue(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsPersistComponentsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsPersistComponentsStepTest.java index 41266b7ed31..0aa17f31b5c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsPersistComponentsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsPersistComponentsStepTest.java @@ -300,7 +300,7 @@ public class ViewsPersistComponentsStepTest extends BaseStepTest { .setUuid(PROJECT_VIEW_1_UUID) .setName(PROJECT_VIEW_1_NAME) .setDescription("project view description is not persisted") - .setProjectViewAttributes(new ProjectViewAttributes(project.getId(), project.uuid())); + .setProjectViewAttributes(new ProjectViewAttributes(project.uuid())); } private void persistComponents(ComponentDto... componentDtos) { @@ -333,12 +333,12 @@ public class ViewsPersistComponentsStepTest extends BaseStepTest { assertThat(projectDto.path()).isNull(); assertThat(projectDto.uuid()).isEqualTo(VIEW_UUID); assertThat(projectDto.projectUuid()).isEqualTo(projectDto.uuid()); - assertThat(projectDto.parentProjectId()).isNull(); + assertThat(projectDto.getRootUuid()).isEqualTo(VIEW_UUID); assertThat(projectDto.moduleUuid()).isNull(); assertThat(projectDto.moduleUuidPath()).isEqualTo("." + projectDto.uuid() + "."); assertThat(projectDto.qualifier()).isEqualTo(Qualifiers.VIEW); assertThat(projectDto.scope()).isEqualTo(Scopes.PROJECT); - assertThat(projectDto.getCopyResourceId()).isNull(); + assertThat(projectDto.getCopyResourceUuid()).isNull(); assertThat(projectDto.getCreatedAt()).isEqualTo(now); } @@ -352,12 +352,12 @@ public class ViewsPersistComponentsStepTest extends BaseStepTest { assertThat(sv1Dto.path()).isNull(); assertThat(sv1Dto.uuid()).isEqualTo(SUBVIEW_1_UUID); assertThat(sv1Dto.projectUuid()).isEqualTo(viewDto.uuid()); - assertThat(sv1Dto.parentProjectId()).isEqualTo(viewDto.getId()); + assertThat(sv1Dto.getRootUuid()).isEqualTo(viewDto.uuid()); assertThat(sv1Dto.moduleUuid()).isEqualTo(viewDto.uuid()); assertThat(sv1Dto.moduleUuidPath()).isEqualTo(viewDto.moduleUuidPath() + sv1Dto.uuid() + "."); assertThat(sv1Dto.qualifier()).isEqualTo(Qualifiers.SUBVIEW); assertThat(sv1Dto.scope()).isEqualTo(Scopes.PROJECT); - assertThat(sv1Dto.getCopyResourceId()).isNull(); + assertThat(sv1Dto.getCopyResourceUuid()).isNull(); assertThat(sv1Dto.getCreatedAt()).isEqualTo(now); } @@ -368,12 +368,12 @@ public class ViewsPersistComponentsStepTest extends BaseStepTest { assertThat(pv1Dto.path()).isNull(); assertThat(pv1Dto.uuid()).isEqualTo(PROJECT_VIEW_1_UUID); assertThat(pv1Dto.projectUuid()).isEqualTo(viewDto.uuid()); - assertThat(pv1Dto.parentProjectId()).isEqualTo(viewDto.getId()); + assertThat(pv1Dto.getRootUuid()).isEqualTo(viewDto.uuid()); assertThat(pv1Dto.moduleUuid()).isEqualTo(parentViewDto.uuid()); assertThat(pv1Dto.moduleUuidPath()).isEqualTo(parentViewDto.moduleUuidPath() + pv1Dto.uuid() + "."); assertThat(pv1Dto.qualifier()).isEqualTo(Qualifiers.PROJECT); assertThat(pv1Dto.scope()).isEqualTo(Scopes.FILE); - assertThat(pv1Dto.getCopyResourceId()).isEqualTo(project.getId()); + assertThat(pv1Dto.getCopyResourceUuid()).isEqualTo(project.uuid()); assertThat(pv1Dto.getCreatedAt()).isEqualTo(now); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsJsonWriterTest.java b/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsJsonWriterTest.java index c2dcb26c40a..5bfda9d6d01 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsJsonWriterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsJsonWriterTest.java @@ -70,14 +70,14 @@ public class DuplicationsJsonWriterTest { @Test public void write_duplications() { String key1 = "org.codehaus.sonar:sonar-ws-client:src/main/java/org/sonar/wsclient/services/PropertyDeleteQuery.java"; - ComponentDto file1 = ComponentTesting.newFileDto(project).setId(10L).setKey(key1).setLongName("PropertyDeleteQuery").setParentProjectId(5L); + ComponentDto file1 = ComponentTesting.newFileDto(project).setId(10L).setKey(key1).setLongName("PropertyDeleteQuery").setRootUuid("uuid_5"); String key2 = "org.codehaus.sonar:sonar-ws-client:src/main/java/org/sonar/wsclient/services/PropertyUpdateQuery.java"; - ComponentDto file2 = ComponentTesting.newFileDto(project).setId(11L).setQualifier("FIL").setKey(key2).setLongName("PropertyUpdateQuery").setParentProjectId(5L); + ComponentDto file2 = ComponentTesting.newFileDto(project).setId(11L).setQualifier("FIL").setKey(key2).setLongName("PropertyUpdateQuery").setRootUuid("uuid_5"); when(componentDao.selectByKey(session, key1)).thenReturn(Optional.of(file1)); when(componentDao.selectByKey(session, key2)).thenReturn(Optional.of(file2)); - when(componentDao.selectById(session, 5L)).thenReturn(Optional.of( - new ComponentDto().setId(5L).setKey("org.codehaus.sonar:sonar-ws-client").setLongName("SonarQube :: Web Service Client"))); + when(componentDao.selectByUuid(session, "uuid_5")).thenReturn(Optional.of( + new ComponentDto().setUuid("uuid_5").setKey("org.codehaus.sonar:sonar-ws-client").setLongName("SonarQube :: Web Service Client"))); when(componentDao.selectByUuid(session, project.uuid())).thenReturn(Optional.of(project)); List<DuplicationsParser.Block> blocks = newArrayList(); @@ -123,7 +123,7 @@ public class DuplicationsJsonWriterTest { verify(componentDao, times(2)).selectByKey(eq(session), anyString()); // Verify call to dao is cached when searching for project / sub project verify(componentDao, times(1)).selectByUuid(eq(session), eq(project.uuid())); - verify(componentDao, times(1)).selectById(eq(session), eq(5L)); + verify(componentDao, times(1)).selectByUuid(eq(session), eq("uuid_5")); } @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java index a3fc80c56b2..becabf75163 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueQueryServiceTest.java @@ -347,16 +347,12 @@ public class IssueQueryServiceTest { String login2 = "darth.vader"; String copyProjectUuid = devUuid + ":" + projectUuid; - long copyResourceId = 42L; - ComponentDto technicalProject = new ComponentDto().setProjectUuid(devUuid).setCopyResourceId(copyResourceId); + ComponentDto technicalProject = new ComponentDto().setProjectUuid(devUuid).setCopyComponentUuid(projectUuid); when(componentDao.selectByUuids(isA(DbSession.class), anyCollection())).thenReturn(Arrays.asList(technicalProject)); when(componentService.getDistinctQualifiers(isA(DbSession.class), anyCollection())).thenReturn(Sets.newHashSet("DEV_PRJ")); when(authorDao.selectScmAccountsByDeveloperUuids(isA(DbSession.class), anyCollection())).thenReturn(Lists.newArrayList(login1, login2)); - ComponentDto actualProject = new ComponentDto().setUuid(projectUuid); - when(componentDao.selectByIds(isA(DbSession.class), anyCollection())).thenReturn(Arrays.asList(actualProject)); - Map<String, Object> map = newHashMap(); map.put("componentUuids", newArrayList(copyProjectUuid)); IssueQuery query = underTest.createFromMap(map); diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterExecutorTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterExecutorTest.java index 6f8d2adabb7..d927ffcf25d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterExecutorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterExecutorTest.java @@ -19,6 +19,9 @@ */ package org.sonar.server.measure; +import static com.google.common.collect.Lists.newArrayList; +import static org.assertj.core.api.Assertions.assertThat; + import java.sql.SQLException; import java.util.Arrays; import java.util.Date; @@ -34,20 +37,19 @@ import org.sonar.db.DbTester; import org.sonar.db.component.ResourceDao; import org.sonar.db.component.SnapshotDto; -import static com.google.common.collect.Lists.newArrayList; -import static org.assertj.core.api.Assertions.assertThat; - public class MeasureFilterExecutorTest { private static final long JAVA_PROJECT_ID = 1L; private static final long JAVA_FILE_BIG_ID = 3L; private static final long JAVA_FILE_TINY_ID = 4L; + private static final String JAVA_PROJECT_UUID = "UUID_JAVA_PROJECT"; private static final long JAVA_PROJECT_SNAPSHOT_ID = 101L; private static final long JAVA_FILE_BIG_SNAPSHOT_ID = 103L; private static final long JAVA_FILE_TINY_SNAPSHOT_ID = 104L; private static final long JAVA_PACKAGE_SNAPSHOT_ID = 102L; private static final long PHP_PROJECT_ID = 10L; + private static final String PHP_PROJECT_UUID = "UUID_PHP_PROJECT"; private static final long PHP_SNAPSHOT_ID = 110L; private static final Metric METRIC_LINES = new Metric.Builder("lines", "Lines", Metric.ValueType.INT).create().setId(1); private static final Metric METRIC_PROFILE = new Metric.Builder("profile", "Profile", Metric.ValueType.STRING).create().setId(2); @@ -373,7 +375,7 @@ public class MeasureFilterExecutorTest { assertThat(rows).hasSize(3); verifyPhpProject(rows.get(0)); verifyJavaProject(rows.get(1)); - verifyProject(rows.get(2), 120L, 20L, 20L); + verifyProject(rows.get(2), 120L, 20L, "CDEF"); } @Test @@ -386,7 +388,7 @@ public class MeasureFilterExecutorTest { // Js Project ERROR, Java Project WARN, then Php Project OK assertThat(rows).hasSize(3); - verifyProject(rows.get(0), 120L, 20L, 20L); + verifyProject(rows.get(0), 120L, 20L, "CDEF"); verifyJavaProject(rows.get(1)); verifyPhpProject(rows.get(2)); } @@ -589,24 +591,24 @@ public class MeasureFilterExecutorTest { } private void verifyJavaProject(MeasureFilterRow row) { - verifyProject(row, JAVA_PROJECT_SNAPSHOT_ID, JAVA_PROJECT_ID, JAVA_PROJECT_ID); + verifyProject(row, JAVA_PROJECT_SNAPSHOT_ID, JAVA_PROJECT_ID, JAVA_PROJECT_UUID); } private void verifyJavaBigFile(MeasureFilterRow row) { - verifyProject(row, JAVA_FILE_BIG_SNAPSHOT_ID, JAVA_FILE_BIG_ID, JAVA_PROJECT_ID); + verifyProject(row, JAVA_FILE_BIG_SNAPSHOT_ID, JAVA_FILE_BIG_ID, JAVA_PROJECT_UUID); } private void verifyJavaTinyFile(MeasureFilterRow row) { - verifyProject(row, JAVA_FILE_TINY_SNAPSHOT_ID, JAVA_FILE_TINY_ID, JAVA_PROJECT_ID); + verifyProject(row, JAVA_FILE_TINY_SNAPSHOT_ID, JAVA_FILE_TINY_ID, JAVA_PROJECT_UUID); } private void verifyPhpProject(MeasureFilterRow row) { - verifyProject(row, PHP_SNAPSHOT_ID, PHP_PROJECT_ID, PHP_PROJECT_ID); + verifyProject(row, PHP_SNAPSHOT_ID, PHP_PROJECT_ID, PHP_PROJECT_UUID); } - private void verifyProject(MeasureFilterRow row, Long snashotId, Long resourceId, Long resourceRootId) { + private void verifyProject(MeasureFilterRow row, Long snashotId, Long resourceId, String rootComponentUuid) { assertThat(row.getSnapshotId()).isEqualTo(snashotId); assertThat(row.getResourceId()).isEqualTo(resourceId); - assertThat(row.getResourceRootId()).isEqualTo(resourceRootId); + assertThat(row.getRootComponentUuid()).isEqualTo(rootComponentUuid); } } diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryMediumTest.java index ede524fe811..27c29402afc 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryMediumTest.java @@ -336,6 +336,7 @@ public class QProfileFactoryMediumTest { ComponentDto project = new ComponentDto() .setId(1L) .setUuid("ABCD") + .setRootUuid("ABCD") .setKey("org.codehaus.sonar:sonar") .setName("SonarQube") .setLongName("SonarQube") diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileProjectOperationsMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileProjectOperationsMediumTest.java index fd054edc264..ef9d3011859 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileProjectOperationsMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileProjectOperationsMediumTest.java @@ -68,6 +68,7 @@ public class QProfileProjectOperationsMediumTest { project = new ComponentDto() .setUuid(PROJECT_UUID) + .setRootUuid(PROJECT_UUID) .setKey(PROJECT_KEY) .setName("SonarQube") .setLongName("SonarQube") @@ -123,6 +124,7 @@ public class QProfileProjectOperationsMediumTest { public void remove_all_projects() { ComponentDto project1 = new ComponentDto() .setUuid("BCDE") + .setRootUuid("BCDE") .setKey("project1") .setName("project1") .setLongName("project1") @@ -131,6 +133,7 @@ public class QProfileProjectOperationsMediumTest { .setEnabled(true); ComponentDto project2 = new ComponentDto() .setUuid("CDEF") + .setRootUuid("CDEF") .setKey("project2") .setName("project2") .setLongName("project2") diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsMediumTest.java index 36bd0c012f2..d58e2c97b48 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/QProfilesWsMediumTest.java @@ -444,6 +444,7 @@ public class QProfilesWsMediumTest { ComponentDto project = new ComponentDto() .setId(1L) .setUuid("ABCD") + .setRootUuid("ABCD") .setKey("org.codehaus.sonar:sonar") .setName("SonarQube") .setLongName("SonarQube") @@ -473,6 +474,7 @@ public class QProfilesWsMediumTest { ComponentDto project = new ComponentDto() .setId(1L) .setUuid("ABCD") + .setRootUuid("ABCD") .setKey("org.codehaus.sonar:sonar") .setName("SonarQube") .setLongName("SonarQube") @@ -498,6 +500,7 @@ public class QProfilesWsMediumTest { ComponentDto project = new ComponentDto() .setId(1L) .setUuid("ABCD") + .setRootUuid("ABCD") .setKey("org.codehaus.sonar:sonar") .setName("SonarQube") .setLongName("SonarQube") @@ -563,6 +566,7 @@ public class QProfilesWsMediumTest { ComponentDto project = new ComponentDto() .setId(1L) .setUuid("ABCD") + .setRootUuid("ABCD") .setKey("org.codehaus.sonar:sonar") .setName("SonarQube") .setLongName("SonarQube") @@ -587,6 +591,7 @@ public class QProfilesWsMediumTest { ComponentDto project = new ComponentDto() .setId(1L) .setUuid("ABCD") + .setRootUuid("ABCD") .setKey("org.codehaus.sonar:sonar") .setName("SonarQube") .setLongName("SonarQube") diff --git a/server/sonar-server/src/test/java/org/sonar/server/test/ws/ListActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/test/ws/ListActionTest.java index 5c02d4830aa..6ba9fc08daf 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/test/ws/ListActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/test/ws/ListActionTest.java @@ -116,6 +116,7 @@ public class ListActionTest { TestFile2.dto(), new ComponentDto() .setUuid(mainFileUuid) + .setRootUuid(TestFile1.PROJECT_UUID) .setProjectUuid(TestFile1.PROJECT_UUID)); db.getSession().commit(); @@ -140,6 +141,7 @@ public class ListActionTest { TestFile2.dto(), new ComponentDto() .setUuid(sourceFileUuid) + .setRootUuid(TestFile1.PROJECT_UUID) .setKey(sourceFileKey) .setProjectUuid(TestFile1.PROJECT_UUID)); db.getSession().commit(); @@ -192,7 +194,7 @@ public class ListActionTest { public void fail_when_no_sufficient_privilege_on_main_file_uuid() throws Exception { userSessionRule.addProjectUuidPermissions(UserRole.USER, TestFile1.PROJECT_UUID); String mainFileUuid = "MAIN-FILE-UUID"; - dbClient.componentDao().insert(db.getSession(), new ComponentDto().setUuid(mainFileUuid).setProjectUuid(TestFile1.PROJECT_UUID)); + dbClient.componentDao().insert(db.getSession(), new ComponentDto().setUuid(mainFileUuid).setRootUuid(TestFile1.PROJECT_UUID).setProjectUuid(TestFile1.PROJECT_UUID)); db.getSession().commit(); ws.newGetRequest("api/tests", "list") @@ -227,6 +229,7 @@ public class ListActionTest { public static ComponentDto dto() { return new ComponentDto() .setUuid(TestFile1.FILE_UUID) + .setRootUuid(TestFile1.PROJECT_UUID) .setLongName(TestFile1.LONG_NAME) .setProjectUuid(TestFile1.PROJECT_UUID) .setKey(TestFile1.KEY); @@ -266,6 +269,7 @@ public class ListActionTest { public static ComponentDto dto() { return new ComponentDto() .setUuid(TestFile2.FILE_UUID) + .setRootUuid(TestFile2.PROJECT_UUID) .setLongName(TestFile2.LONG_NAME) .setProjectUuid(TestFile2.PROJECT_UUID) .setKey(TestFile2.KEY); diff --git a/server/sonar-server/src/test/resources/org/sonar/server/component/ws/SearchViewComponentsActionTest/return_only_authorized_projects_from_view.xml b/server/sonar-server/src/test/resources/org/sonar/server/component/ws/SearchViewComponentsActionTest/return_only_authorized_projects_from_view.xml index 0bf9a7d567e..0c271cedf2d 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/component/ws/SearchViewComponentsActionTest/return_only_authorized_projects_from_view.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/component/ws/SearchViewComponentsActionTest/return_only_authorized_projects_from_view.xml @@ -4,24 +4,24 @@ <group_roles id="1" group_id="[null]" resource_id="100" role="user"/> <!-- View --> - <projects id="11" uuid="EFGH" project_uuid="EFGH" module_uuid="[null]" module_uuid_path="." copy_resource_id="[null]" enabled="[true]" + <projects id="11" uuid="EFGH" root_uuid="EFGH" project_uuid="EFGH" module_uuid="[null]" module_uuid_path="." copy_component_uuid="[null]" enabled="[true]" kee="LANGUAGE_VIEW" scope="PRJ" qualifier="VW" name="By Language" path="[null]"/> - <projects id="112" uuid="GHIJ" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_resource_id="101" enabled="[true]" + <projects id="112" uuid="GHIJ" root_uuid="EFGH" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_component_uuid="KLMN" enabled="[true]" kee="VIEW2org.elasticsearch:elasticsearch" scope="FIL" qualifier="TRK" name="Elasticsearch" path="[null]"/> - <projects id="113" uuid="HIJK" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_resource_id="100" enabled="[true]" + <projects id="113" uuid="HIJK" root_uuid="EFGH" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_component_uuid="JKLM" enabled="[true]" kee="VIEW2org.struts:struts" scope="FIL" qualifier="TRK" name="Struts" path="[null]"/> <!-- Real projects --> <projects id="100" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" - uuid="JKLM" project_uuid="JKLM" module_uuid="[null]" module_uuid_path="." - enabled="[true]" copy_resource_id="[null]" path="[null]"/> + uuid="JKLM" root_uuid="JKLM" root_project_uuid="JKLM" module_uuid="[null]" module_uuid_path="." + enabled="[true]" copy_component_uuid="[null]" path="[null]"/> <projects id="101" scope="PRJ" qualifier="TRK" kee="org.elasticsearch:elasticsearch" name="Elasticsearch" - uuid="KLMN" project_uuid="KLMN" module_uuid="[null]" module_uuid_path="." - enabled="[true]" copy_resource_id="[null]" path="[null]"/> + uuid="KLMN" root_uuid="KLMN" project_uuid="KLMN" module_uuid="[null]" module_uuid_path="." + enabled="[true]" copy_component_uuid="[null]" path="[null]"/> <resource_index id="1" kee="struts" component_uuid="JKLM" root_component_uuid="JKLM" position="0" name_size="6" qualifier="TRK"/> <resource_index id="2" kee="elasticsearch" component_uuid="KLMN" root_component_uuid="KLMN" position="0" name_size="13" qualifier="TRK"/> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/component/ws/SearchViewComponentsActionTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/component/ws/SearchViewComponentsActionTest/shared.xml index 2f4dbf7348d..989b7def85e 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/component/ws/SearchViewComponentsActionTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/component/ws/SearchViewComponentsActionTest/shared.xml @@ -5,28 +5,28 @@ <group_roles id="2" group_id="[null]" resource_id="101" role="user"/> <!-- View with sub view --> - <projects id="11" uuid="EFGH" project_uuid="EFGH" module_uuid="[null]" module_uuid_path="." copy_resource_id="[null]" enabled="[true]" + <projects id="11" uuid="EFGH" root_uuid="EFGH" project_uuid="EFGH" module_uuid="[null]" module_uuid_path="." copy_component_uuid="[null]" enabled="[true]" kee="LANGUAGE_VIEW" scope="PRJ" qualifier="VW" name="By Language" path="[null]"/> - <projects id="112" uuid="GHIJ" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_resource_id="101" enabled="[true]" + <projects id="112" uuid="GHIJ" root_uuid="EFGH" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_component_uuid="KLMN" enabled="[true]" kee="VIEW2org.elasticsearch:elasticsearch" scope="FIL" qualifier="TRK" name="Elasticsearch" path="[null]"/> <!-- Sub view --> - <projects id="13" uuid="FGHI" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_resource_id="[null]" enabled="[true]" + <projects id="13" uuid="FGHI" root_uuid="EFGH" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_component_uuid="[null]" enabled="[true]" kee="JAVA_PROJECTS" scope="PRJ" qualifier="SVW" name="Java projects" path="[null]"/> - <projects id="113" uuid="HIJK" project_uuid="EFGH" module_uuid="FGHI" module_uuid_path=".EFGH.FGHI." copy_resource_id="100" enabled="[true]" + <projects id="113" uuid="HIJK" root_uuid="EFGH" project_uuid="EFGH" module_uuid="FGHI" module_uuid_path=".EFGH.FGHI." copy_component_uuid="JKLM" enabled="[true]" kee="VIEW2org.struts:struts" scope="FIL" qualifier="TRK" name="Struts" path="[null]"/> <!-- Real projects --> <projects id="100" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" - uuid="JKLM" project_uuid="JKLM" module_uuid="[null]" module_uuid_path="." - enabled="[true]" copy_resource_id="[null]" path="[null]"/> + uuid="JKLM" root_uuid="JKLM" project_uuid="JKLM" module_uuid="[null]" module_uuid_path="." + enabled="[true]" copy_component_uuid="[null]" path="[null]"/> <projects id="101" scope="PRJ" qualifier="TRK" kee="org.elasticsearch:elasticsearch" name="Elasticsearch" - uuid="KLMN" project_uuid="KLMN" module_uuid="[null]" module_uuid_path="." - enabled="[true]" copy_resource_id="[null]" path="[null]"/> + uuid="KLMN" root_uuid="KLMN" project_uuid="KLMN" module_uuid="[null]" module_uuid_path="." + enabled="[true]" copy_component_uuid="[null]" path="[null]"/> <resource_index id="1" kee="struts" component_uuid="JKLM" root_component_uuid="JKLM" position="0" name_size="6" qualifier="TRK"/> <resource_index id="2" kee="elasticsearch" component_uuid="KLMN" root_component_uuid="KLMN" position="0" name_size="13" qualifier="TRK"/> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/measure/MeasureRepositoryImplTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/measure/MeasureRepositoryImplTest/shared.xml index 87081a4e2d1..9c4b40ca293 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/measure/MeasureRepositoryImplTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/measure/MeasureRepositoryImplTest/shared.xml @@ -1,5 +1,5 @@ <dataset> - <projects id="567" uuid="uuid_1" kee="file cpt key" enabled="[true]"/> + <projects id="567" uuid="uuid_1" root_uuid="uuid_1" kee="file cpt key" enabled="[true]"/> <snapshots id="123" component_uuid="uuid_1" root_component_uuid="uuid_1" islast="[true]"/> <snapshots id="369" component_uuid="uuid_1" root_component_uuid="uuid_1" islast="[false]"/> <metrics id="1" name="metric 1" /> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/empty.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/empty.xml index 006696dc819..a01559680bc 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/empty.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/empty.xml @@ -1,5 +1,5 @@ <dataset> - <projects id="1" root_id="[null]" kee="ROOT_KEY" uuid="ABCD"/> + <projects id="1" root_uuid="ABCD" kee="ROOT_KEY" uuid="ABCD"/> </dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/no_previous_version.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/no_previous_version.xml index be57cfc6d21..b984a948a37 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/no_previous_version.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/no_previous_version.xml @@ -1,6 +1,6 @@ <dataset> - <projects id="1" kee="ROOT_KEY" name="project" uuid="ABCD"/> + <projects id="1" kee="ROOT_KEY" name="project" uuid="ABCD" root_uuid="ABCD"/> <!-- 2008-11-11 --> <!-- Version 0.9 --> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/previous_version_deleted.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/previous_version_deleted.xml index f8b76a17917..4008dbdd93d 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/previous_version_deleted.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/previous_version_deleted.xml @@ -1,6 +1,6 @@ <dataset> - <projects id="1" root_id="[null]" kee="ROOT_KEY" uuid="ABCD"/> + <projects id="1" kee="ROOT_KEY" uuid="ABCD" root_uuid="ABCD"/> <!-- 2008-11-11 --> <!-- Version 0.9 --> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/previous_version_is_last_one.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/previous_version_is_last_one.xml index 6a97946ef19..7f56e789607 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/previous_version_is_last_one.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/previous_version_is_last_one.xml @@ -1,6 +1,6 @@ <dataset> - <projects id="1" kee="ROOT_KEY" name="project" uuid="ABCD"/> + <projects id="1" kee="ROOT_KEY" name="project" uuid="ABCD" root_uuid="ABCD"/> <!-- 2008-11-11 --> <!-- Version 0.9 --> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/shared.xml index 2c8ae5c913f..6f93823e528 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/shared.xml @@ -1,6 +1,6 @@ <dataset> - <projects id="1" kee="ROOT_KEY" name="project" uuid="ABCD"/> + <projects id="1" kee="ROOT_KEY" name="project" uuid="ABCD" root_uuid="ABCD"/> <!-- 2008-11-11 --> <!-- Version 0.9 --> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/unprocessed_snapshots.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/unprocessed_snapshots.xml index 70de478ba1e..33c2443b3c7 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/unprocessed_snapshots.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/unprocessed_snapshots.xml @@ -1,8 +1,8 @@ <dataset> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="PROJECT_KEY" name="project" long_name="[null]" description="[null]" + <projects id="1" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="PROJECT_KEY" name="project" long_name="[null]" description="[null]" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" /> <!-- Unprocessed snapshot --> <snapshots id="1000" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/load_component_id_from_db.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/load_component_id_from_db.xml index 1a1f7e8466a..ab190db883e 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/load_component_id_from_db.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/load_component_id_from_db.xml @@ -1,7 +1,7 @@ <dataset> - <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="ABCD"/> + <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="ABCD" root_uuid="ABCD"/> <snapshots id="10" component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]"/> - <projects id="100" scope="FIL" qualifier="CLA" kee="struts:Action" name="Action" uuid="BCDE"/> + <projects id="100" scope="FIL" qualifier="CLA" kee="struts:Action" name="Action" uuid="BCDE" root_uuid="ABCD"/> <snapshots id="100" component_uuid="BCDE" root_component_uuid="ABCD" islast="[true]"/> </dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/load_project_id_from_db.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/load_project_id_from_db.xml index f17681470e3..a1508445b14 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/load_project_id_from_db.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/load_project_id_from_db.xml @@ -1,6 +1,6 @@ <dataset> - <projects id="1" kee="struts" root_id="[null]" uuid="ABCD"/> - <projects id="2" kee="struts:Action.java" root_id="1" uuid="BCDE"/> + <projects id="1" kee="struts" root_uuid="ABCD" uuid="ABCD"/> + <projects id="2" kee="struts:Action.java" root_uuid="ABCD" uuid="BCDE"/> <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" islast="[true]" /> <snapshots id="2" component_uuid="BCDE" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1" islast="[true]" /> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_insert_new_issues.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_insert_new_issues.xml index 1a1f7e8466a..ab190db883e 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_insert_new_issues.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_insert_new_issues.xml @@ -1,7 +1,7 @@ <dataset> - <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="ABCD"/> + <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="ABCD" root_uuid="ABCD"/> <snapshots id="10" component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]"/> - <projects id="100" scope="FIL" qualifier="CLA" kee="struts:Action" name="Action" uuid="BCDE"/> + <projects id="100" scope="FIL" qualifier="CLA" kee="struts:Action" name="Action" uuid="BCDE" root_uuid="ABCD"/> <snapshots id="100" component_uuid="BCDE" root_component_uuid="ABCD" islast="[true]"/> </dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_update_issues.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_update_issues.xml index 832058c2eef..918d755636a 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_update_issues.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_update_issues.xml @@ -1,9 +1,9 @@ <dataset> - <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="ABCD"/> + <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="ABCD" root_uuid="ABCD"/> <snapshots id="10" component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]"/> - <projects id="100" scope="FIL" qualifier="CLA" kee="struts:Action" name="Action" uuid="BCDE"/> + <projects id="100" scope="FIL" qualifier="CLA" kee="struts:Action" name="Action" uuid="BCDE" root_uuid="ABCD"/> <snapshots id="100" component_uuid="BCDE" root_component_uuid="ABCD" islast="[true]"/> <issues id="1" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueAuthorizationDaoTest/no_authorization.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueAuthorizationDaoTest/no_authorization.xml index 06f424257dc..b24592a016b 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueAuthorizationDaoTest/no_authorization.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueAuthorizationDaoTest/no_authorization.xml @@ -1,9 +1,9 @@ <dataset> <projects id="1" uuid="ABC" project_uuid="ABC" module_uuid="[null]" module_uuid_path="." - root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + root_uuid="ABC" 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" path="[null]" authorization_updated_at="123456789"/> <!-- no authorizations project ABC. --> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueAuthorizationDaoTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueAuthorizationDaoTest/shared.xml index c204155e2bc..4a8ebf00a64 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueAuthorizationDaoTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueAuthorizationDaoTest/shared.xml @@ -1,15 +1,15 @@ <dataset> <projects id="1" uuid="ABC" project_uuid="ABC" module_uuid="[null]" module_uuid_path="." - root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + root_uuid="ABC" 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" path="[null]" authorization_updated_at="1000000000"/> <projects id="2" uuid="DEF" project_uuid="DEF" module_uuid="[null]" module_uuid_path="." - root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.sonar.sample" name="Sample" + root_uuid="ABC" scope="PRJ" qualifier="TRK" kee="org.sonar.sample" name="Sample" description="the description" long_name="Sample" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" + enabled="[true]" language="java" path="[null]" authorization_updated_at="2000000000"/> <!-- user1 can access both projects --> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueAuthorizationIndexerTest/index.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueAuthorizationIndexerTest/index.xml index cc3f8cf7b04..6ef3ef25402 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueAuthorizationIndexerTest/index.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueAuthorizationIndexerTest/index.xml @@ -1,9 +1,9 @@ <dataset> <projects id="1" uuid="ABC" project_uuid="ABC" module_uuid="[null]" module_uuid_path="." - root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + root_uuid="ABC" 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" path="[null]" authorization_updated_at="123456789"/> <users id="10" login="user1" name="User 1" email="user1@company.net" active="[true]"/> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index.xml index dcc1e50070d..0651a152049 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index.xml @@ -3,9 +3,9 @@ plugin_config_key="[null]" plugin_name="squid"/> <projects id="10" scope="PRJ" qualifier="TRK" kee="the_project" name="TheProject" - uuid="THE_PROJECT" module_uuid="[null]" module_uuid_path="." path="[null]"/> + uuid="THE_PROJECT" root_uuid="THE_PROJECT" module_uuid="[null]" module_uuid_path="." path="[null]"/> <projects id="11" scope="FIL" qualifier="FIL" kee="abcde" name="TheFile" - uuid="THE_FILE" module_uuid="THE_PROJECT" module_uuid_path=".THE_PROJECT." + uuid="THE_FILE" root_uuid="THE_PROJECT" module_uuid="THE_PROJECT" module_uuid_path=".THE_PROJECT." path="src/main/java/TheFile.java"/> <issues id="1" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index_project.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index_project.xml index 5d57824f80d..e5aa741671c 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index_project.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index_project.xml @@ -4,9 +4,9 @@ <!-- Project 1 --> <projects id="10" scope="PRJ" qualifier="TRK" kee="the_project_1" name="TheProject1" - uuid="THE_PROJECT_1" module_uuid="[null]" module_uuid_path="." path="[null]"/> + uuid="THE_PROJECT_1" root_uuid="THE_PROJECT_1" module_uuid="[null]" module_uuid_path="." path="[null]"/> <projects id="11" scope="FIL" qualifier="FIL" kee="the_file_1" name="TheFile1" - uuid="THE_FILE_1" module_uuid="THE_PROJECT_1" module_uuid_path=".THE_PROJECT_1." + uuid="THE_FILE_1" root_uuid="THE_PROJECT_1" module_uuid="THE_PROJECT_1" module_uuid_path=".THE_PROJECT_1." path="src/main/java/TheFile.java"/> <issues id="1" @@ -39,9 +39,9 @@ <!-- Project 2 --> <projects id="100" scope="PRJ" qualifier="TRK" kee="the_project_2" name="TheProject2" - uuid="THE_PROJECT_2" module_uuid="[null]" module_uuid_path="." path="[null]"/> + uuid="THE_PROJECT_2" root_uuid="THE_PROJECT_2" module_uuid="[null]" module_uuid_path="." path="[null]"/> <projects id="111" scope="FIL" qualifier="FIL" kee="the_file_2" name="TheFile2" - uuid="THE_FILE_2" module_uuid="THE_PROJECT_2" module_uuid_path=".THE_PROJECT_2." + uuid="THE_FILE_2" root_uuid="THE_PROJECT_2" module_uuid="THE_PROJECT_2" module_uuid_path=".THE_PROJECT_2." path="src/main/java/TheFile.java"/> <issues id="10" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_directory_path.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_directory_path.xml index 1e3158f86fb..2da877f4899 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_directory_path.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_directory_path.xml @@ -2,10 +2,10 @@ <rules tags="[null]" system_tags="[null]" id="200" name="Avoid Cycles" plugin_rule_key="AvoidCycles" plugin_config_key="[null]" plugin_name="squid"/> - <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="PROJECT" path="[null]" module_uuid_path=".PROJECT."/> - <projects id="11" scope="PRJ" qualifier="BRC" kee="struts-core" name="Struts Core" uuid="MODULE" path="struts-core" module_uuid_path=".PROJECT.MODULE."/> - <projects id="100" scope="FIL" qualifier="FIL" kee="struts:Action" name="Action" uuid="FILE" path="src/main/java/Action.java" module_uuid_path=".PROJECT.MODULE."/> - <projects id="101" scope="FIL" qualifier="FIL" kee="pom" name="pom.xml" uuid="ROOT_FILE" path="pom.xml" module_uuid_path=".PROJECT.MODULE."/> + <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="PROJECT" root_uuid="MODULE" path="[null]" module_uuid_path=".PROJECT."/> + <projects id="11" scope="PRJ" qualifier="BRC" kee="struts-core" name="Struts Core" uuid="MODULE" root_uuid="PROJECT" path="struts-core" module_uuid_path=".PROJECT.MODULE."/> + <projects id="100" scope="FIL" qualifier="FIL" kee="struts:Action" name="Action" uuid="FILE" root_uuid="MODULE" path="src/main/java/Action.java" module_uuid_path=".PROJECT.MODULE."/> + <projects id="101" scope="FIL" qualifier="FIL" kee="pom" name="pom.xml" uuid="ROOT_FILE" root_uuid="MODULE" path="pom.xml" module_uuid_path=".PROJECT.MODULE."/> <issues id="1" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_file_path.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_file_path.xml index c68a82fb8c8..f7d0cd8bbda 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_file_path.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_file_path.xml @@ -2,10 +2,10 @@ <rules tags="[null]" system_tags="[null]" id="200" name="Avoid Cycles" plugin_rule_key="AvoidCycles" plugin_config_key="[null]" plugin_name="squid"/> - <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="PROJECT" path="[null]" module_uuid_path=".PROJECT."/> - <projects id="11" scope="PRJ" qualifier="BRC" kee="struts-core" name="Struts Core" uuid="MODULE" path="struts-core" module_uuid_path=".PROJECT.MODULE."/> - <projects id="100" scope="FIL" qualifier="FIL" kee="struts:Action" name="Action" uuid="FILE" path="src/main/java/Action.java" module_uuid_path=".PROJECT.MODULE."/> - <projects id="101" scope="FIL" qualifier="FIL" kee="pom" name="pom.xml" uuid="ROOT_FILE" path="pom.xml" module_uuid_path=".PROJECT.MODULE."/> + <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="PROJECT" root_uuid="MODULE" path="[null]" module_uuid_path=".PROJECT."/> + <projects id="11" scope="PRJ" qualifier="BRC" kee="struts-core" name="Struts Core" uuid="MODULE" root_uuid="PROJECT" path="struts-core" module_uuid_path=".PROJECT.MODULE."/> + <projects id="100" scope="FIL" qualifier="FIL" kee="struts:Action" name="Action" uuid="FILE" root_uuid="MODULE" path="src/main/java/Action.java" module_uuid_path=".PROJECT.MODULE."/> + <projects id="101" scope="FIL" qualifier="FIL" kee="pom" name="pom.xml" uuid="ROOT_FILE" root_uuid="MODULE" path="pom.xml" module_uuid_path=".PROJECT.MODULE."/> <issues id="1" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/many_projects.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/many_projects.xml index 3a568be54c8..d7b49d669db 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/many_projects.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/many_projects.xml @@ -4,9 +4,9 @@ <!-- Project 1 --> <projects id="10" scope="PRJ" qualifier="TRK" kee="the_project_1" name="TheProject1" - uuid="THE_PROJECT_1" module_uuid="[null]" module_uuid_path="." path="[null]"/> + uuid="THE_PROJECT_1" root_uuid="THE_PROJECT_1" module_uuid="[null]" module_uuid_path="." path="[null]"/> <projects id="11" scope="FIL" qualifier="FIL" kee="the_file_1" name="TheFile1" - uuid="THE_FILE_1" module_uuid="THE_PROJECT_1" module_uuid_path=".THE_PROJECT_1." + uuid="THE_FILE_1" root_uuid="THE_PROJECT_1" module_uuid="THE_PROJECT_1" module_uuid_path=".THE_PROJECT_1." path="src/main/java/TheFile.java"/> <issues id="1" @@ -67,9 +67,9 @@ <!-- Project 2 --> <projects id="100" scope="PRJ" qualifier="TRK" kee="the_project_2" name="TheProject2" - uuid="THE_PROJECT_2" module_uuid="[null]" module_uuid_path="." path="[null]"/> + uuid="THE_PROJECT_2" root_uuid="THE_PROJECT_2" module_uuid="[null]" module_uuid_path="." path="[null]"/> <projects id="111" scope="FIL" qualifier="FIL" kee="the_file_2" name="TheFile2" - uuid="THE_FILE_2" module_uuid="THE_PROJECT_2" module_uuid_path=".THE_PROJECT_2." + uuid="THE_FILE_2" root_uuid="THE_PROJECT_2" module_uuid="THE_PROJECT_2" module_uuid_path=".THE_PROJECT_2." path="src/main/java/TheFile.java"/> <issues id="10" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/one_issue.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/one_issue.xml index d4343d23191..7b64628aabc 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/one_issue.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/one_issue.xml @@ -2,10 +2,10 @@ <rules tags="[null]" system_tags="[null]" id="200" name="Avoid Cycles" plugin_rule_key="AvoidCycles" plugin_config_key="[null]" plugin_name="squid"/> - <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="PROJECT1" path="[null]" module_uuid_path=".PROJECT1."/> - <projects id="50" scope="PRJ" qualifier="BRC" kee="struts:struts-tiles" name="Struts Tiles" uuid="MODULE1" path="[null]" module_uuid_path=".PROJECT1.MODULE1."/> - <projects id="70" scope="DIR" qualifier="DIR" kee="struts:struts-tiles:/" name="src/main/java/" uuid="DIR1" path="src/main/java" module_uuid_path=".PROJECT1.MODULE1."/> - <projects id="100" scope="FIL" qualifier="CLA" kee="struts:Action" name="Action" uuid="FILE1" path="src/main/java/Action.java" module_uuid_path=".PROJECT1."/> + <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="PROJECT1" root_uuid="PROJECT1" path="[null]" module_uuid_path=".PROJECT1."/> + <projects id="50" scope="PRJ" qualifier="BRC" kee="struts:struts-tiles" name="Struts Tiles" uuid="MODULE1" root_uuid="PROJECT1" path="[null]" module_uuid_path=".PROJECT1.MODULE1."/> + <projects id="70" scope="DIR" qualifier="DIR" kee="struts:struts-tiles:/" name="src/main/java/" uuid="DIR1" root_uuid="MODULE1" path="src/main/java" module_uuid_path=".PROJECT1.MODULE1."/> + <projects id="100" scope="FIL" qualifier="CLA" kee="struts:Action" name="Action" uuid="FILE1" root_uuid="MODULE1" path="src/main/java/Action.java" module_uuid_path=".PROJECT1."/> <issues id="1" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/shared.xml index 018199d9f56..00a834ce17f 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/shared.xml @@ -2,10 +2,10 @@ <rules tags="[null]" system_tags="[null]" id="200" name="Avoid Cycles" plugin_rule_key="AvoidCycles" plugin_config_key="[null]" plugin_name="squid"/> - <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="PROJECT1" path="[null]" module_uuid_path=".PROJECT1."/> - <projects id="50" scope="PRJ" qualifier="BRC" kee="struts:struts-tiles" name="Struts Tiles" uuid="MODULE1" path="[null]" module_uuid_path=".PROJECT1.MODULE1."/> - <projects id="70" scope="DIR" qualifier="DIR" kee="struts:struts-tiles:/" name="src/main/java/" uuid="DIR1" path="src/main/java" module_uuid_path=".PROJECT1.MODULE1."/> - <projects id="100" scope="FIL" qualifier="CLA" kee="struts:Action" name="Action" uuid="FILE1" path="src/main/java/Action.java" module_uuid_path=".PROJECT1."/> + <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="PROJECT1" root_uuid="PROJECT1" path="[null]" module_uuid_path=".PROJECT1."/> + <projects id="50" scope="PRJ" qualifier="BRC" kee="struts:struts-tiles" name="Struts Tiles" uuid="MODULE1" root_uuid="PROJECT1" path="[null]" module_uuid_path=".PROJECT1.MODULE1."/> + <projects id="70" scope="DIR" qualifier="DIR" kee="struts:struts-tiles:/" name="src/main/java/" uuid="DIR1" root_uuid="MODULE1" path="src/main/java" module_uuid_path=".PROJECT1.MODULE1."/> + <projects id="100" scope="FIL" qualifier="CLA" kee="struts:Action" name="Action" uuid="FILE1" root_uuid="MODULE1" path="src/main/java/Action.java" module_uuid_path=".PROJECT1."/> <issues id="1" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/escape_percent_and_underscore_when_filter_by_component_name_or_key.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/escape_percent_and_underscore_when_filter_by_component_name_or_key.xml index 126b499f803..f51f08eef2e 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/escape_percent_and_underscore_when_filter_by_component_name_or_key.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/escape_percent_and_underscore_when_filter_by_component_name_or_key.xml @@ -2,24 +2,24 @@ <!-- java project --> <projects kee="java_project:org.sonar.bar" long_name="org.sonar.bar" scope="FIL" qualifier="CLA" name="org.sonar.bar" - id="1" root_id="[null]" uuid="ABCD" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" + id="1" root_uuid="ABCD" uuid="ABCD" + description="[null]" enabled="[true]" language="[null]" created_at="2008-12-19 00:00:00.00"/> <projects kee="java_project:org.sonar.foo" scope="FIL" qualifier="CLA" long_name="org.sonar.foo" name="org.sonar.foo" - id="2" root_id="1" uuid="BCDE" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + id="2" root_uuid="ABCD" uuid="BCDE" + description="[null]" enabled="[true]" language="java" created_at="2008-12-19 00:00:00.00"/> <projects kee="java project:org.sonar.foo.Big" scope="FIL" qualifier="CLA" long_name="org.sonar.foo.Big" name="Big" - id="3" root_id="1" uuid="CDEF" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + id="3" root_uuid="ABCD" uuid="CDEF" + description="[null]" enabled="[true]" language="java" created_at="2008-12-19 00:00:00.00"/> <projects kee="java project:org.sonar.foo.Tiny" scope="FIL" qualifier="CLA" long_name="org.sonar.foo.Tiny" name="Tiny" - id="4" root_id="1" uuid="DEFG" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + id="4" root_uuid="ABCD" uuid="DEFG" + description="[null]" enabled="[true]" language="java" created_at="2008-12-19 00:00:00.00"/> <snapshots id="101" component_uuid="ABCD" root_component_uuid="ABCD" root_snapshot_id="[null]" parent_snapshot_id="[null]" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml index 18a411ee2f8..99a098986c3 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml @@ -5,10 +5,11 @@ delete_historical_data="[null]"/> <projects kee="java_project" long_name="Java project" scope="PRJ" qualifier="TRK" name="Java project" - id="1" root_id="[null]" uuid="ABCD" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]"/> + id="1" root_uuid="UUID_JAVA_PROJECT" uuid="UUID_JAVA_PROJECT" + description="[null]" enabled="[true]" language="[null]" /> - <snapshots id="101" component_uuid="ABCD" root_component_uuid="ABCD" root_snapshot_id="[null]" parent_snapshot_id="[null]" + <snapshots id="101" component_uuid="UUID_JAVA_PROJECT" root_component_uuid="UUID_JAVA_PROJECT" + root_snapshot_id="[null]" parent_snapshot_id="[null]" scope="PRJ" qualifier="TRK" path="" depth="0" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml index f5befccaa1f..f0ccad26c09 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml @@ -5,10 +5,11 @@ delete_historical_data="[null]"/> <projects kee="java_project" long_name="Java project" scope="PRJ" qualifier="TRK" name="Java project" - id="1" root_id="[null]" uuid="ABCD" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]"/> + id="1" root_uuid="UUID_JAVA_PROJECT" uuid="UUID_JAVA_PROJECT" + description="[null]" enabled="[true]" language="[null]"/> - <snapshots id="101" component_uuid="ABCD" root_component_uuid="ABCD" root_snapshot_id="[null]" parent_snapshot_id="[null]" + <snapshots id="101" component_uuid="UUID_JAVA_PROJECT" root_component_uuid="UUID_JAVA_PROJECT" + root_snapshot_id="[null]" parent_snapshot_id="[null]" scope="PRJ" qualifier="TRK" path="" depth="0" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml index 8a1250ea2ba..0cbb579a254 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml @@ -24,27 +24,28 @@ <!-- java project --> <projects kee="java_project" long_name="Java project" scope="PRJ" qualifier="TRK" name="Java project" - id="1" root_id="[null]" uuid="ABCD" project_uuid="ABCD" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" + id="1" root_uuid="UUID_JAVA_PROJECT" uuid="UUID_JAVA_PROJECT" project_uuid="UUID_JAVA_PROJECT" + description="[null]" enabled="[true]" language="[null]" created_at="2008-12-19 00:00:00.00"/> <projects kee="java_project:org.sonar.foo" scope="DIR" qualifier="PAC" long_name="org.sonar.foo" name="org.sonar.foo" - id="2" root_id="1" uuid="BCDE" project_uuid="ABCD" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" + id="2" root_uuid="UUID_JAVA_PROJECT" uuid="BCDE" project_uuid="UUID_JAVA_PROJECT" + description="[null]" enabled="[true]" language="[null]" created_at="2008-12-19 00:00:00.00"/> <projects kee="java_project:org.sonar.foo.Big" scope="FIL" qualifier="CLA" long_name="org.sonar.foo.Big" name="Big" - id="3" root_id="1" uuid="CDEF" project_uuid="ABCD" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + id="3" root_uuid="UUID_JAVA_PROJECT" uuid="CDEF" project_uuid="UUID_JAVA_PROJECT" + description="[null]" enabled="[true]" language="java" created_at="2008-12-19 00:00:00.00"/> <projects kee="java_project:org.sonar.foo.Tiny" scope="FIL" qualifier="CLA" long_name="org.sonar.foo.Tiny" name="Tiny" - id="4" root_id="1" uuid="DEFG" project_uuid="ABCD" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + id="4" root_uuid="UUID_JAVA_PROJECT" uuid="DEFG" project_uuid="UUID_JAVA_PROJECT" + description="[null]" enabled="[true]" language="java" created_at="2008-12-19 00:00:00.00"/> - <snapshots id="101" component_uuid="ABCD" root_component_uuid="ABCD" root_snapshot_id="[null]" parent_snapshot_id="[null]" + <snapshots id="101" component_uuid="UUID_JAVA_PROJECT" root_component_uuid="UUID_JAVA_PROJECT" + root_snapshot_id="[null]" parent_snapshot_id="[null]" scope="PRJ" qualifier="TRK" path="" depth="0" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" @@ -53,7 +54,8 @@ created_at="1229727600000" build_date="1229727600000" version="1.0" status="P" islast="[true]"/> - <snapshots id="102" component_uuid="BCDE" root_component_uuid="ABCD" root_snapshot_id="101" parent_snapshot_id="101" + <snapshots id="102" component_uuid="BCDE" root_component_uuid="UUID_JAVA_PROJECT" root_snapshot_id="101" + parent_snapshot_id="101" scope="DIR" qualifier="PAC" path="101." depth="1" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" @@ -62,7 +64,8 @@ created_at="1229727600000" build_date="1229727600000" version="1.0" status="P" islast="[true]"/> - <snapshots id="103" component_uuid="CDEF" root_component_uuid="ABCD" root_snapshot_id="101" parent_snapshot_id="102" + <snapshots id="103" component_uuid="CDEF" root_component_uuid="UUID_JAVA_PROJECT" root_snapshot_id="101" + parent_snapshot_id="102" scope="FIL" qualifier="CLA" path="101.102." depth="2" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" @@ -71,7 +74,8 @@ created_at="1229727600000" build_date="1229727600000" version="1.0" status="P" islast="[true]"/> - <snapshots id="104" component_uuid="DEFG" root_component_uuid="ABCD" root_snapshot_id="101" parent_snapshot_id="102" + <snapshots id="104" component_uuid="DEFG" root_component_uuid="UUID_JAVA_PROJECT" root_snapshot_id="101" + parent_snapshot_id="102" scope="FIL" qualifier="CLA" path="101.102." depth="2" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" @@ -133,12 +137,13 @@ <!-- php project --> <projects kee="php_project" long_name="PHP project" scope="PRJ" qualifier="TRK" name="PHP project" - id="10" root_id="[null]" uuid="EFGH" project_uuid="EFGH" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" + id="10" root_uuid="UUID_JAVA_PROJECT" uuid="UUID_PHP_PROJECT" project_uuid="UUID_PHP_PROJECT" + description="[null]" enabled="[true]" language="[null]" created_at="2012-12-12 04:06:00.00"/> - <snapshots id="110" component_uuid="EFGH" root_component_uuid="EFGH" root_snapshot_id="[null]" parent_snapshot_id="[null]" + <snapshots id="110" component_uuid="UUID_PHP_PROJECT" root_component_uuid="UUID_PHP_PROJECT" root_snapshot_id="[null]" + parent_snapshot_id="[null]" scope="PRJ" qualifier="TRK" path="" depth="0" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" @@ -165,15 +170,23 @@ alert_status="[null]" description="[null]"/> - <resource_index id="1" kee="java project" position="0" name_size="12" component_uuid="ABCD" root_component_uuid="ABCD" qualifier="TRK"/> - <resource_index id="2" kee="java projec" position="1" name_size="12" component_uuid="ABCD" root_component_uuid="ABCD" qualifier="TRK"/> - <resource_index id="3" kee="java proje" position="2" name_size="12" component_uuid="ABCD" root_component_uuid="ABCD" qualifier="TRK"/> - <resource_index id="4" kee="java proj" position="3" name_size="12" component_uuid="ABCD" root_component_uuid="ABCD" qualifier="TRK"/> + <resource_index id="1" kee="java project" position="0" name_size="12" component_uuid="UUID_JAVA_PROJECT" + root_component_uuid="UUID_JAVA_PROJECT" qualifier="TRK"/> + <resource_index id="2" kee="java projec" position="1" name_size="12" component_uuid="UUID_JAVA_PROJECT" + root_component_uuid="UUID_JAVA_PROJECT" qualifier="TRK"/> + <resource_index id="3" kee="java proje" position="2" name_size="12" component_uuid="UUID_JAVA_PROJECT" + root_component_uuid="UUID_JAVA_PROJECT" qualifier="TRK"/> + <resource_index id="4" kee="java proj" position="3" name_size="12" component_uuid="UUID_JAVA_PROJECT" + root_component_uuid="UUID_JAVA_PROJECT" qualifier="TRK"/> <!-- etc --> - <resource_index id="5" kee="php project" position="0" name_size="11" component_uuid="EFGH" root_component_uuid="EFGH" qualifier="TRK"/> - <resource_index id="6" kee="php projec" position="1" name_size="11" component_uuid="EFGH" root_component_uuid="EFGH" qualifier="TRK"/> - <resource_index id="7" kee="php proje" position="2" name_size="11" component_uuid="EFGH" root_component_uuid="EFGH" qualifier="TRK"/> - <resource_index id="8" kee="php proj" position="3" name_size="11" component_uuid="EFGH" root_component_uuid="EFGH" qualifier="TRK"/> + <resource_index id="5" kee="php project" position="0" name_size="11" component_uuid="UUID_PHP_PROJECT" + root_component_uuid="UUID_PHP_PROJECT" qualifier="TRK"/> + <resource_index id="6" kee="php projec" position="1" name_size="11" component_uuid="UUID_PHP_PROJECT" + root_component_uuid="UUID_PHP_PROJECT" qualifier="TRK"/> + <resource_index id="7" kee="php proje" position="2" name_size="11" component_uuid="UUID_PHP_PROJECT" + root_component_uuid="UUID_PHP_PROJECT" qualifier="TRK"/> + <resource_index id="8" kee="php proj" position="3" name_size="11" component_uuid="UUID_PHP_PROJECT" + root_component_uuid="UUID_PHP_PROJECT" qualifier="TRK"/> <!-- etc --> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml index 3e944c47343..32941aa476c 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml @@ -7,11 +7,12 @@ <!-- java project --> <projects kee="java_project" long_name="Java project" scope="PRJ" qualifier="TRK" name="Java project" - id="1" root_id="[null]" uuid="ABCD" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" + id="1" root_uuid="UUID_JAVA_PROJECT" uuid="UUID_JAVA_PROJECT" + description="[null]" enabled="[true]" language="[null]" created_at="2008-12-19 00:00:00.00"/> - <snapshots id="101" component_uuid="ABCD" root_component_uuid="ABCD" root_snapshot_id="[null]" parent_snapshot_id="[null]" + <snapshots id="101" component_uuid="UUID_JAVA_PROJECT" root_component_uuid="UUID_JAVA_PROJECT" + root_snapshot_id="[null]" parent_snapshot_id="[null]" scope="PRJ" qualifier="TRK" path="" depth="0" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" @@ -32,12 +33,13 @@ <!-- php project --> <projects kee="php_project" long_name="PHP project" scope="PRJ" qualifier="TRK" name="PHP project" - id="10" root_id="[null]" uuid="BCDE" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" + id="10" root_uuid="UUID_PHP_PROJECT" uuid="UUID_PHP_PROJECT" + description="[null]" enabled="[true]" language="[null]" created_at="2012-12-12 04:06:00.00"/> - <snapshots id="110" component_uuid="BCDE" root_component_uuid="BCDE" root_snapshot_id="[null]" parent_snapshot_id="[null]" + <snapshots id="110" component_uuid="UUID_PHP_PROJECT" root_component_uuid="UUID_PHP_PROJECT" root_snapshot_id="[null]" + parent_snapshot_id="[null]" scope="PRJ" qualifier="TRK" path="" depth="0" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" @@ -57,8 +59,8 @@ <!-- js project --> <projects kee="js_project" long_name="JS project" scope="PRJ" qualifier="TRK" name="JS project" - id="20" root_id="[null]" uuid="CDEF" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" + id="20" root_uuid="CDEF" uuid="CDEF" + description="[null]" enabled="[true]" language="[null]" created_at="2012-12-12 04:06:00.00"/> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/platform/BackendCleanupMediumTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/platform/BackendCleanupMediumTest/shared.xml index dbe84a89137..5ceeba2fcee 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/platform/BackendCleanupMediumTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/platform/BackendCleanupMediumTest/shared.xml @@ -1,8 +1,8 @@ <dataset> <projects id="100" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" - uuid="JKLM" project_uuid="JKLM" module_uuid="[null]" module_uuid_path="." - enabled="[true]" copy_resource_id="[null]" path="[null]"/> + uuid="JKLM" root_uuid="JKLM" project_uuid="JKLM" module_uuid="[null]" module_uuid_path="." + enabled="[true]" path="[null]"/> <snapshots id="100" component_uuid="JKLM" parent_snapshot_id="[null]" root_component_uuid="JKLM" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/no_source.xml b/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/no_source.xml index 1b668bf1486..a706ac79ac0 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/no_source.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/no_source.xml @@ -1,7 +1,7 @@ <dataset> - <projects id="100" kee="struts" root_id="[null]" qualifier="TRK" scope="PRJ" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." path="[null]"/> - <projects id="101" kee="Action.java" root_id="100" qualifier="CLA" scope="PRJ" uuid="CDEF" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." + <projects id="100" kee="struts" root_uuid="ABCD" qualifier="TRK" scope="PRJ" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." path="[null]"/> + <projects id="101" kee="Action.java" root_uuid="ABCD" qualifier="CLA" scope="PRJ" uuid="CDEF" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." path="src/main/java/Action.java"/> </dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/shared.xml index 2c1b4111c26..9e072388a9d 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/shared.xml @@ -1,7 +1,7 @@ <dataset> - <projects id="100" kee="struts" root_id="[null]" qualifier="TRK" scope="PRJ" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." path="[null]"/> - <projects id="101" kee="Action.java" root_id="100" qualifier="CLA" scope="PRJ" uuid="CDEF" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." + <projects id="100" kee="struts" root_uuid="ABCD" qualifier="TRK" scope="PRJ" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." path="[null]"/> + <projects id="101" kee="Action.java" root_uuid="ABCD" qualifier="CLA" scope="PRJ" uuid="CDEF" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." path="src/main/java/Action.java"/> <file_sources id="101" project_uuid="ABCD" file_uuid="CDEF" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/show_hashes_on_test_file.xml b/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/show_hashes_on_test_file.xml index f577e371d76..5e1cedca4ff 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/show_hashes_on_test_file.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/source/ws/HashActionTest/show_hashes_on_test_file.xml @@ -1,7 +1,7 @@ <dataset> - <projects id="100" kee="struts" root_id="[null]" qualifier="TRK" scope="PRJ" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." path="[null]"/> - <projects id="101" kee="ActionTest.java" root_id="100" qualifier="CLA" scope="PRJ" uuid="CDEF" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." + <projects id="100" kee="struts" root_uuid="ABCD" qualifier="TRK" scope="PRJ" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." path="[null]"/> + <projects id="101" kee="ActionTest.java" root_uuid="ABCD" qualifier="CLA" scope="PRJ" uuid="CDEF" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." path="src/test/java/ActionTest.java"/> <file_sources id="100" project_uuid="ABCD" file_uuid="CDEF" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/view/index/ViewIndexerTest/index.xml b/server/sonar-server/src/test/resources/org/sonar/server/view/index/ViewIndexerTest/index.xml index 4f0c07b3f5b..d96e1157ea0 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/view/index/ViewIndexerTest/index.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/view/index/ViewIndexerTest/index.xml @@ -1,14 +1,14 @@ <dataset> <!-- Simple View --> - <projects id="10" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." copy_resource_id="[null]" enabled="[true]" + <projects id="10" uuid="ABCD" root_uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." copy_component_uuid="[null]" enabled="[true]" kee="MASTER_PROJECT" scope="PRJ" qualifier="VW" name="All projects" path="[null]"/> <snapshots id="10" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" depth="[null]" scope="PRJ" qualifier="VW" created_at="1228222680000" build_date="1228222680000" version="[null]" path=""/> - <projects id="110" uuid="BCDE" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." copy_resource_id="100" enabled="[true]" + <projects id="110" uuid="BCDE" root_uuid="ABCD" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." copy_component_uuid="JKLM" enabled="[true]" kee="MASTER_PROJECTorg.struts:struts" scope="FIL" qualifier="TRK" name="Struts" path="[null]"/> <snapshots id="110" component_uuid="BCDE" parent_snapshot_id="[null]" root_component_uuid="BCDE" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" @@ -16,13 +16,13 @@ version="[null]" path=""/> <!-- View with sub view --> - <projects id="11" uuid="EFGH" project_uuid="EFGH" module_uuid="[null]" module_uuid_path="." copy_resource_id="[null]" enabled="[true]" + <projects id="11" uuid="EFGH" root_uuid="EFGH" project_uuid="EFGH" module_uuid="[null]" module_uuid_path="." copy_component_uuid="[null]" enabled="[true]" kee="LANGUAGE_VIEW" scope="PRJ" qualifier="VW" name="By Language" path="[null]"/> <snapshots id="11" component_uuid="EFGH" parent_snapshot_id="[null]" root_component_uuid="EFGH" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" depth="[null]" scope="PRJ" qualifier="VW" created_at="1228222680000" build_date="1228222680000" version="[null]" path=""/> - <projects id="112" uuid="GHIJ" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_resource_id="101" enabled="[true]" + <projects id="112" uuid="GHIJ" root_uuid="EFGH" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_component_uuid="KLMN" enabled="[true]" kee="VIEW2org.elasticsearch:elasticsearch" scope="FIL" qualifier="TRK" name="SSLR" path="[null]"/> <snapshots id="112" component_uuid="GHIJ" parent_snapshot_id="[null]" root_component_uuid="GHIJ" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" @@ -30,14 +30,14 @@ version="[null]" path=""/> <!-- Sub view --> - <projects id="13" uuid="FGHI" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_resource_id="[null]" enabled="[true]" + <projects id="13" uuid="FGHI" root_uuid="EFGH" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_component_uuid="[null]" enabled="[true]" kee="JAVA_PROJECTS" scope="PRJ" qualifier="SVW" name="Java projects" path="[null]"/> <snapshots id="13" component_uuid="FGHI" parent_snapshot_id="[null]" root_component_uuid="FGHI" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" depth="[null]" scope="PRJ" qualifier="SVW" created_at="1228222680000" build_date="1228222680000" version="[null]" path=""/> - <projects id="113" uuid="HIJK" project_uuid="EFGH" module_uuid="FGHI" module_uuid_path=".EFGH.FGHI." copy_resource_id="100" enabled="[true]" + <projects id="113" uuid="HIJK" root_uuid="EFGH" project_uuid="EFGH" module_uuid="FGHI" module_uuid_path=".EFGH.FGHI." copy_component_uuid="JKLM" enabled="[true]" kee="VIEW2org.struts:struts" scope="FIL" qualifier="TRK" name="Struts" path="[null]"/> <snapshots id="113" component_uuid="HIJK" parent_snapshot_id="[null]" root_component_uuid="HIJK" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" @@ -45,7 +45,7 @@ version="[null]" path=""/> <!-- View without project --> - <projects id="14" uuid="IJKL" project_uuid="IJKL" module_uuid="[null]" module_uuid_path="." copy_resource_id="[null]" enabled="[true]" + <projects id="14" uuid="IJKL" root_uuid="IJKL" project_uuid="IJKL" module_uuid="[null]" module_uuid_path="." copy_component_uuid="[null]" enabled="[true]" kee="OTHER" scope="PRJ" qualifier="VW" name="Other projects" path="[null]"/> <snapshots id="14" component_uuid="IJKL" parent_snapshot_id="[null]" root_component_uuid="IJKL" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" @@ -55,16 +55,16 @@ <!-- Real projects --> <projects id="100" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" - uuid="JKLM" project_uuid="JKLM" module_uuid="[null]" module_uuid_path="." - enabled="[true]" copy_resource_id="[null]" path="[null]"/> + uuid="JKLM" root_uuid="JKLM" project_uuid="JKLM" module_uuid="[null]" module_uuid_path="." + enabled="[true]" copy_component_uuid="[null]" path="[null]"/> <snapshots id="100" component_uuid="JKLM" parent_snapshot_id="[null]" root_component_uuid="JKLM" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" build_date="1228222680000" version="[null]" path=""/> <projects id="101" scope="PRJ" qualifier="TRK" kee="org.elasticsearch:elasticsearch" name="Elasticsearch" - uuid="KLMN" project_uuid="KLMN" module_uuid="[null]" module_uuid_path="." - enabled="[true]" copy_resource_id="[null]" path="[null]"/> + uuid="KLMN" root_uuid="KLMN" project_uuid="KLMN" module_uuid="[null]" module_uuid_path="." + enabled="[true]" copy_component_uuid="[null]" path="[null]"/> <snapshots id="101" component_uuid="KLMN" parent_snapshot_id="[null]" root_component_uuid="KLMN" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" build_date="1228222680000" diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb index de02d22c9cd..6311b14a5e6 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/projects_controller.rb @@ -115,7 +115,7 @@ class Api::ProjectsController < Api::ApiController end # this is really an advanced optimization ! - select_columns='id,uuid,kee,name,language,long_name,scope,qualifier,root_id' + select_columns='id,uuid,kee,name,language,long_name,scope,qualifier,root_uuid' select_columns += ',description' if @show_description projects=Project.find(:all, :select => select_columns, :conditions => [conditions.join(' AND '), values], :order => 'name') diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb index 9be60b5114a..dfec74484a9 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb @@ -327,7 +327,6 @@ class Api::ResourcesController < Api::ApiController json['version']=snapshot.version if snapshot.version json['branch']=resource.branch if resource.branch json['description']=resource.description if resource.description - json['copy']=resource.copy_resource_id if resource.copy_resource_id if include_trends json[:p1]=snapshot.period1_mode if snapshot.period1_mode json[:p1p]=snapshot.period1_param if snapshot.period1_param @@ -402,7 +401,6 @@ class Api::ResourcesController < Api::ApiController xml.date(Api::Utils.format_datetime(snapshot.created_at)) xml.creationDate(Api::Utils.format_datetime(resource.created_at)) xml.description(resource.description) if include_descriptions && resource.description - xml.copy(resource.copy_resource_id) if resource.copy_resource_id if include_trends xml.period1(snapshot.period1_mode) if snapshot.period1_mode diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_controller.rb index 16fbb908651..62de84287c3 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/project_controller.rb @@ -85,9 +85,8 @@ class ProjectController < ApplicationController def profile require_parameters :id @project_id = Api::Utils.project_id(params[:id]) - access_denied unless (is_admin?(@project_id) || has_role?(:profileadmin)) - # Need to display breadcrumb @project = Project.by_key(@project_id) + access_denied unless (is_admin?(@project.uuid) || has_role?(:profileadmin)) call_backend do @all_quality_profiles = Internal.quality_profiles.allProfiles().to_a @@ -118,9 +117,8 @@ class ProjectController < ApplicationController def qualitygate require_parameters :id @project_id = Api::Utils.project_id(params[:id]) - access_denied unless (is_admin?(@project_id) || has_role?(:gateadmin)) - # Need to display breadcrumb @project = Project.by_key(@project_id) + access_denied unless (is_admin?(@project.uuid) || has_role?(:gateadmin)) call_backend do @all_quality_gates = Internal.quality_gates.list().to_a diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/measure_filter.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/measure_filter.rb index 2a24b78060e..97a4942536f 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/measure_filter.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/measure_filter.rb @@ -189,7 +189,7 @@ class MeasureFilter < ActiveRecord::Base def base_resource if criteria('base') - Project.first(:conditions => ['kee=? and copy_resource_id is null and person_id is null', criteria('base')]) + Project.first(:conditions => ['kee=? and copy_component_uuid is null and developer_uuid is null', criteria('base')]) end end @@ -241,9 +241,9 @@ class MeasureFilter < ActiveRecord::Base end def filter_authorized_snapshot_ids(rows, controller) - project_ids = rows.map { |row| row.getResourceRootId() }.compact.uniq - authorized_project_ids = controller.select_authorized(:user, project_ids) - snapshot_ids = rows.map { |row| row.getSnapshotId() if authorized_project_ids.include?(row.getResourceRootId()) }.compact + project_uuids = rows.map { |row| row.getRootComponentUuid() }.compact.uniq + authorized_project_uuids = controller.select_authorized(:user, project_uuids) + snapshot_ids = rows.map { |row| row.getSnapshotId() if authorized_project_uuids.include?(row.getRootComponentUuid()) }.compact @security_exclusions = (snapshot_ids.size<rows.size) @pagination = Api::Pagination.new @pagination.per_page=(criteria(:pageSize)||999999).to_i diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/project.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/project.rb index b3c0ec0dbc3..15d50e8682d 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/project.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/project.rb @@ -28,9 +28,9 @@ class Project < ActiveRecord::Base has_many :user_roles, :foreign_key => 'resource_id' has_many :group_roles, :foreign_key => 'resource_id' has_many :manual_measures, :foreign_key => 'component_uuid', :primary_key => 'uuid' - belongs_to :root, :class_name => 'Project', :foreign_key => 'root_id' - belongs_to :copy_resource, :class_name => 'Project', :foreign_key => 'copy_resource_id' - belongs_to :person, :class_name => 'Project', :foreign_key => 'person_id' + belongs_to :root, :class_name => 'Project', :foreign_key => 'root_uuid', :primary_key => 'uuid' + belongs_to :copy_resource, :class_name => 'Project', :foreign_key => 'copy_component_uuid', :primary_key => 'uuid' + belongs_to :person, :class_name => 'Project', :foreign_key => 'developer_uuid', :primary_key => 'uuid' has_many :authors, :foreign_key => 'person_id', :dependent => :delete_all has_one :index, :class_name => 'ResourceIndex', :foreign_key => 'component_uuid', :primary_key => 'uuid', :conditions => 'position=0', :select => 'kee' has_many :resource_index, :foreign_key => 'resource_id' @@ -79,7 +79,7 @@ class Project < ActiveRecord::Base def modules @modules ||= begin - Project.all(:conditions => {:root_id => self.id, :scope => 'PRJ'}) + Project.all(:conditions => ['root_uuid=? and uuid <> ? and scope=?', self.uuid, self.uuid, 'PRJ']) end end @@ -178,16 +178,16 @@ class Project < ActiveRecord::Base nil end - def resource_id_for_authorization + def component_uuid_for_authorization if library? # no security on libraries nil elsif set? - self.root_id || self.id + self.root_uuid || self.uuid elsif last_snapshot - last_snapshot.resource_id_for_authorization + last_snapshot.component_uuid_for_authorization else - nil + self.root_uuid end end @@ -217,7 +217,7 @@ class Project < ActiveRecord::Base end def parent_module(current_module) - current_module.root ? parent_module(current_module.root) : current_module + current_module.root.uuid = current_module.uuid ? current_module : parent_module(current_module.root) end end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/resource_index.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/resource_index.rb index 6d3bb81f7fe..3e7eadffecb 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/resource_index.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/resource_index.rb @@ -26,9 +26,8 @@ class ResourceIndex < ActiveRecord::Base MIN_SEARCH_SIZE=2 - def resource_id_for_authorization - # FIXME this generates a join for every resource - root_project.id + def component_uuid_for_authorization + root_component_uuid end end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/snapshot.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/snapshot.rb index 9d17cfe325e..535bc0e40b8 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/snapshot.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/snapshot.rb @@ -216,8 +216,8 @@ class Snapshot < ActiveRecord::Base (period1_mode || period2_mode || period3_mode || period4_mode || period5_mode) != nil end - def resource_id_for_authorization - root_project.id + def component_uuid_for_authorization + root_component_uuid end def path_name diff --git a/server/sonar-web/src/main/webapp/WEB-INF/lib/default_authorizer.rb b/server/sonar-web/src/main/webapp/WEB-INF/lib/default_authorizer.rb index 6a2330139dd..1350390f746 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/lib/default_authorizer.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/lib/default_authorizer.rb @@ -25,16 +25,16 @@ class DefaultAuthorizer global_roles(user).include?(role) end - def has_role_for_resources?(user, role, resource_ids) - return [] if resource_ids.empty? + def has_role_for_resources?(user, role, component_uuids) + return [] if component_uuids.empty? - compacted_resource_ids=resource_ids.compact + compacted_component_uuids=component_uuids.compact group_ids=user.groups.map(&:id) # Oracle is limited to 1000 elements in clause "IN" page_size=999 - page_count=(compacted_resource_ids.size/page_size) - page_count+=1 if (compacted_resource_ids.size % page_size)>0 + page_count=(compacted_component_uuids.size/page_size) + page_count+=1 if (compacted_component_uuids.size % page_size)>0 sanitized_role = ActiveRecord::Base.connection.quote_string(role.to_s) @@ -42,9 +42,9 @@ class DefaultAuthorizer if group_ids.empty? # Some databases do not support empty IN page_count.times do |page_index| - page_rids=compacted_resource_ids[page_index*page_size...(page_index+1)*page_size] + page_component_uuids=compacted_component_uuids[page_index*page_size...(page_index+1)*page_size] group_roles.concat( - ActiveRecord::Base.connection.execute("SELECT resource_id FROM group_roles WHERE role='#{sanitized_role}' and group_id is null and resource_id in (#{page_rids.join(',')})") + ActiveRecord::Base.connection.execute("SELECT p.uuid FROM group_roles gr INNER JOIN projects p ON p.id=gr.resource_id WHERE gr.role='#{sanitized_role}' and gr.group_id is null and p.uuid in (#{page_component_uuids.map{ |u| "'#{u}'" }.join(',')})") ) end else @@ -53,11 +53,11 @@ class DefaultAuthorizer gr_page_count+=1 if (compacted_group_ids.size % page_size)>0 page_count.times do |page_index| - page_rids=compacted_resource_ids[page_index*page_size...(page_index+1)*page_size] + page_component_uuids=compacted_component_uuids[page_index*page_size...(page_index+1)*page_size] gr_page_count.times do |gr_page_index| page_grids=compacted_group_ids[gr_page_index*page_size...(gr_page_index+1)*page_size] group_roles.concat( - ActiveRecord::Base.connection.execute("SELECT resource_id FROM group_roles WHERE role='#{sanitized_role}' and (group_id is null or group_id in(#{page_grids.join(',')})) and resource_id in (#{page_rids.join(',')})") + ActiveRecord::Base.connection.execute("SELECT p.uuid FROM group_roles gr INNER JOIN projects p ON p.id=gr.resource_id WHERE gr.role='#{sanitized_role}' and (gr.group_id is null or gr.group_id in(#{page_grids.join(',')})) and p.uuid in (#{page_component_uuids.map{ |u| "'#{u}'" }.join(',')})") ) end end @@ -66,21 +66,21 @@ class DefaultAuthorizer user_roles=[] if user.id page_count.times do |page_index| - page_rids=compacted_resource_ids[page_index*page_size...(page_index+1)*page_size] + page_component_uuids=compacted_component_uuids[page_index*page_size...(page_index+1)*page_size] user_roles.concat( - ActiveRecord::Base.connection.execute("SELECT resource_id FROM user_roles WHERE role='#{sanitized_role}' and user_id=#{user.id} and resource_id in (#{page_rids.join(',')})") + ActiveRecord::Base.connection.execute("SELECT p.uuid FROM user_roles ur INNER JOIN projects p ON p.id=ur.resource_id WHERE ur.role='#{sanitized_role}' and ur.user_id=#{user.id} and p.uuid in (#{page_component_uuids.map{ |u| "'#{u}'" }.join(',')})") ) end end - authorized_resource_ids={} + authorized_component_uuids={} (group_roles.concat(user_roles)).each do |x| - authorized_resource_ids[x['resource_id'].to_i]=true + authorized_component_uuids[x['uuid']]=true end - result=Array.new(resource_ids.size) - resource_ids.each_with_index do |rid,index| - result[index]=((authorized_resource_ids[rid]) || false) + result=Array.new(component_uuids.size) + component_uuids.each_with_index do |uuid,index| + result[index]=((authorized_component_uuids[uuid]) || false) end result end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/lib/need_authorization.rb b/server/sonar-web/src/main/webapp/WEB-INF/lib/need_authorization.rb index 08d1a327b71..9f4912d0673 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/lib/need_authorization.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/lib/need_authorization.rb @@ -75,21 +75,21 @@ module NeedAuthorization def has_role_for_resources?(role, objects) return [] if objects.nil? || objects.size==0 - resource_ids=[] + component_uuids=[] objects.each do |obj| - resource_ids<<to_resource_id(obj) + component_uuids<<to_component_uuid(obj) end - compacted_resource_ids=resource_ids.compact.uniq - compacted_booleans=AuthorizerFactory.authorizer.has_role_for_resources?(self, role.to_sym, compacted_resource_ids) - boolean_per_resource_id={} - compacted_resource_ids.each_with_index do |rid, index| - boolean_per_resource_id[rid]=compacted_booleans[index] + compacted_component_uuids=component_uuids.compact.uniq + compacted_booleans=AuthorizerFactory.authorizer.has_role_for_resources?(self, role.to_sym, compacted_component_uuids) + boolean_per_component_uuid={} + compacted_component_uuids.each_with_index do |uuid, index| + boolean_per_component_uuid[uuid]=compacted_booleans[index] end - result=Array.new(resource_ids.size) - resource_ids.each_with_index do |rid, index| - authorized=boolean_per_resource_id[rid] + result=Array.new(component_uuids.size) + component_uuids.each_with_index do |uuid, index| + authorized=boolean_per_component_uuid[uuid] # security is sometimes ignored (for example on libraries), so default value is true if no id to check authorized=true if authorized.nil? @@ -106,13 +106,15 @@ module NeedAuthorization end private - def to_resource_id(object) + def to_component_uuid(object) if object.is_a?(Fixnum) + raise 'Component ID is no more supported for checking of authorisation. UUID must be used' + elsif object.is_a?(String) object - elsif object.respond_to?(:resource_id_for_authorization) - object.resource_id_for_authorization + elsif object.respond_to?(:component_uuid_for_authorization) + object.component_uuid_for_authorization else - nil + raise 'Specified argument with type #{object.class} can not be converted to a component uuid' end end end @@ -178,19 +180,6 @@ module NeedAuthorization result end - def select_authorized(role, objects, resource_method=nil) - if resource_method - booleans=has_role?(role, objects.map{|obj| obj.send(resource_method)}) - else - booleans=has_role?(role, objects) - end - result=[] - objects.each_with_index do |obj, index| - result<<obj if booleans[index]==true - end - result - end - # # Filter method to enforce a login admin requirement. # diff --git a/sonar-db/src/main/java/org/sonar/db/component/ComponentDto.java b/sonar-db/src/main/java/org/sonar/db/component/ComponentDto.java index d1ba2e6b605..9df936cbf36 100644 --- a/sonar-db/src/main/java/org/sonar/db/component/ComponentDto.java +++ b/sonar-db/src/main/java/org/sonar/db/component/ComponentDto.java @@ -42,9 +42,9 @@ public class ComponentDto implements Component { private String projectUuid; private String moduleUuid; private String moduleUuidPath; - private Long parentProjectId; - private Long copyResourceId; - private Long developerId; + private String rootUuid; + private String copyComponentUuid; + private String developerUuid; private String path; private String deprecatedKey; @@ -197,13 +197,12 @@ public class ComponentDto implements Component { return this; } - @CheckForNull - public Long parentProjectId() { - return parentProjectId; + public String getRootUuid() { + return rootUuid; } - public ComponentDto setParentProjectId(@Nullable Long parentProjectId) { - this.parentProjectId = parentProjectId; + public ComponentDto setRootUuid(String rootUuid) { + this.rootUuid = rootUuid; return this; } @@ -216,21 +215,23 @@ public class ComponentDto implements Component { return this; } - public Long getCopyResourceId() { - return copyResourceId; + @CheckForNull + public String getCopyResourceUuid() { + return copyComponentUuid; } - public ComponentDto setCopyResourceId(Long copyResourceId) { - this.copyResourceId = copyResourceId; + public ComponentDto setCopyComponentUuid(@Nullable String copyComponentUuid) { + this.copyComponentUuid = copyComponentUuid; return this; } - public Long getDeveloperId() { - return developerId; + @CheckForNull + public String getDeveloperUuid() { + return developerUuid; } - public ComponentDto setDeveloperId(Long developerId) { - this.developerId = developerId; + public ComponentDto setDeveloperUuid(@Nullable String developerUuid) { + this.developerUuid = developerUuid; return this; } @@ -302,9 +303,9 @@ public class ComponentDto implements Component { .append("projectUuid", projectUuid) .append("moduleUuid", moduleUuid) .append("moduleUuidPath", moduleUuidPath) - .append("parentProjectId", parentProjectId) - .append("copyResourceId", copyResourceId) - .append("developerId", developerId) + .append("rootUuid", rootUuid) + .append("copyComponentUuid", copyComponentUuid) + .append("developerUuid", developerUuid) .append("path", path) .append("deprecatedKey", deprecatedKey) .append("name", name) diff --git a/sonar-db/src/main/java/org/sonar/db/component/ComponentDtoFunctions.java b/sonar-db/src/main/java/org/sonar/db/component/ComponentDtoFunctions.java index 39244259134..03cb1623eeb 100644 --- a/sonar-db/src/main/java/org/sonar/db/component/ComponentDtoFunctions.java +++ b/sonar-db/src/main/java/org/sonar/db/component/ComponentDtoFunctions.java @@ -46,10 +46,6 @@ public final class ComponentDtoFunctions { return ToUuid.INSTANCE; } - public static Function<ComponentDto, Long> toCopyResourceId() { - return ToCopyResourceId.INSTANCE; - } - private enum ToId implements Function<ComponentDto, Long> { INSTANCE; @@ -86,12 +82,4 @@ public final class ComponentDtoFunctions { } } - private enum ToCopyResourceId implements Function<ComponentDto, Long> { - INSTANCE; - - @Override - public Long apply(ComponentDto input) { - return input.getCopyResourceId(); - } - } } diff --git a/sonar-db/src/main/java/org/sonar/db/component/ResourceDao.java b/sonar-db/src/main/java/org/sonar/db/component/ResourceDao.java index d37fcd7da7b..9400dc07c2a 100644 --- a/sonar-db/src/main/java/org/sonar/db/component/ResourceDao.java +++ b/sonar-db/src/main/java/org/sonar/db/component/ResourceDao.java @@ -72,12 +72,17 @@ public class ResourceDao extends AbstractDao { public ResourceDto selectResource(String componentUuid) { SqlSession session = myBatis().openSession(false); try { - return session.getMapper(ResourceMapper.class).selectResourceByUuid(componentUuid); + return selectResource(componentUuid, session); } finally { MyBatis.closeQuietly(session); } } + @CheckForNull + private static ResourceDto selectResource(String componentUuid, SqlSession session) { + return session.getMapper(ResourceMapper.class).selectResourceByUuid(componentUuid); + } + public ResourceDto selectResource(long projectId, SqlSession session) { return session.getMapper(ResourceMapper.class).selectResource(projectId); } @@ -112,11 +117,11 @@ public class ResourceDao extends AbstractDao { private ResourceDto getRootProjectByComponentKey(DbSession session, String componentKey) { ResourceDto component = selectResource(ResourceQuery.create().setKey(componentKey), session); if (component != null) { - Long rootId = component.getRootId(); - if (rootId != null) { - return getParentModuleByComponentId(rootId, session); - } else { + String rootUuid = component.getRootUuid(); + if (rootUuid.equals(component.getUuid())) { return component; + } else { + return getParentModuleByComponentUuid(rootUuid, session); } } return null; @@ -133,14 +138,14 @@ public class ResourceDao extends AbstractDao { } @CheckForNull - private ResourceDto getParentModuleByComponentId(Long componentId, DbSession session) { - ResourceDto component = selectResource(componentId, session); + private static ResourceDto getParentModuleByComponentUuid(String componentUUid, DbSession session) { + ResourceDto component = selectResource(componentUUid, session); if (component != null) { - Long rootId = component.getRootId(); - if (rootId != null) { - return getParentModuleByComponentId(rootId, session); - } else { + String rootUuid = component.getRootUuid(); + if (rootUuid.equals(component.getUuid())) { return component; + } else { + return getParentModuleByComponentUuid(rootUuid, session); } } return null; @@ -227,11 +232,6 @@ public class ResourceDao extends AbstractDao { return newArrayList(Iterables.transform(resourceDto, ToComponent.INSTANCE)); } - public void insertUsingExistingSession(ResourceDto resourceDto, SqlSession session) { - ResourceMapper resourceMapper = session.getMapper(ResourceMapper.class); - resourceMapper.insert(resourceDto); - } - private enum ToComponent implements Function<ResourceDto, Component> { INSTANCE; diff --git a/sonar-db/src/main/java/org/sonar/db/component/ResourceDto.java b/sonar-db/src/main/java/org/sonar/db/component/ResourceDto.java index 84480314295..01aea4e456d 100644 --- a/sonar-db/src/main/java/org/sonar/db/component/ResourceDto.java +++ b/sonar-db/src/main/java/org/sonar/db/component/ResourceDto.java @@ -20,6 +20,8 @@ package org.sonar.db.component; import java.util.Date; +import javax.annotation.CheckForNull; +import javax.annotation.Nullable; import static org.sonar.db.component.ComponentValidator.checkComponentKey; import static org.sonar.db.component.ComponentValidator.checkComponentName; @@ -35,15 +37,15 @@ public class ResourceDto { private String deprecatedKey; private String name; private String longName; - private Long rootId; + private String rootUuid; private String path; private String scope; private String qualifier; private boolean enabled = true; private String description; private String language; - private Long copyResourceId; - private Long personId; + private String copyComponentUuid; + private String developerUuid; private Date createdAt; private Long authorizationUpdatedAt; @@ -119,12 +121,12 @@ public class ResourceDto { return this; } - public Long getRootId() { - return rootId; + public String getRootUuid() { + return rootUuid; } - public ResourceDto setRootId(Long rootId) { - this.rootId = rootId; + public ResourceDto setRootUuid(String rootUuid) { + this.rootUuid = rootUuid; return this; } @@ -191,21 +193,23 @@ public class ResourceDto { return this; } - public Long getCopyResourceId() { - return copyResourceId; + @CheckForNull + public String getCopyComponentUuid() { + return copyComponentUuid; } - public ResourceDto setCopyResourceId(Long copyResourceId) { - this.copyResourceId = copyResourceId; + public ResourceDto setCopyComponentUuid(@Nullable String copyComponentUuid) { + this.copyComponentUuid = copyComponentUuid; return this; } - public Long getPersonId() { - return personId; + @CheckForNull + public String getDeveloperUuid() { + return developerUuid; } - public ResourceDto setPersonId(Long personId) { - this.personId = personId; + public ResourceDto setDeveloperUuid(@Nullable String developerUuid) { + this.developerUuid = developerUuid; return this; } diff --git a/sonar-db/src/main/java/org/sonar/db/component/ResourceKeyUpdaterDao.java b/sonar-db/src/main/java/org/sonar/db/component/ResourceKeyUpdaterDao.java index a5b4f7db04d..c675163fc76 100644 --- a/sonar-db/src/main/java/org/sonar/db/component/ResourceKeyUpdaterDao.java +++ b/sonar-db/src/main/java/org/sonar/db/component/ResourceKeyUpdaterDao.java @@ -44,7 +44,7 @@ public class ResourceKeyUpdaterDao implements Dao { this.mybatis = mybatis; } - public void updateKey(long projectId, String newKey) { + public void updateKey(String projectUuid, String newKey) { DbSession session = mybatis.openSession(true); ResourceKeyUpdaterMapper mapper = session.getMapper(ResourceKeyUpdaterMapper.class); try { @@ -53,9 +53,9 @@ public class ResourceKeyUpdaterDao implements Dao { } // must SELECT first everything - ResourceDto project = mapper.selectProject(projectId); + ResourceDto project = mapper.selectProject(projectUuid); String projectOldKey = project.getKey(); - List<ResourceDto> resources = mapper.selectProjectResources(projectId); + List<ResourceDto> resources = mapper.selectProjectResources(projectUuid); resources.add(project); // and then proceed with the batch UPDATE at once @@ -67,12 +67,12 @@ public class ResourceKeyUpdaterDao implements Dao { } } - public Map<String, String> checkModuleKeysBeforeRenaming(long projectId, String stringToReplace, String replacementString) { + public Map<String, String> checkModuleKeysBeforeRenaming(String projectUuid, String stringToReplace, String replacementString) { SqlSession session = mybatis.openSession(false); ResourceKeyUpdaterMapper mapper = session.getMapper(ResourceKeyUpdaterMapper.class); Map<String, String> result = Maps.newHashMap(); try { - Set<ResourceDto> modules = collectAllModules(projectId, stringToReplace, mapper); + Set<ResourceDto> modules = collectAllModules(projectUuid, stringToReplace, mapper); for (ResourceDto module : modules) { String newKey = computeNewKey(module, stringToReplace, replacementString); if (mapper.countResourceByKey(newKey) > 0) { @@ -87,14 +87,14 @@ public class ResourceKeyUpdaterDao implements Dao { return result; } - public void bulkUpdateKey(DbSession session, long projectId, String stringToReplace, String replacementString) { + public void bulkUpdateKey(DbSession session, String projectUuid, String stringToReplace, String replacementString) { ResourceKeyUpdaterMapper mapper = session.getMapper(ResourceKeyUpdaterMapper.class); // must SELECT first everything - Set<ResourceDto> modules = collectAllModules(projectId, stringToReplace, mapper); + Set<ResourceDto> modules = collectAllModules(projectUuid, stringToReplace, mapper); checkNewNameOfAllModules(modules, stringToReplace, replacementString, mapper); Map<ResourceDto, List<ResourceDto>> allResourcesByModuleMap = Maps.newHashMap(); for (ResourceDto module : modules) { - allResourcesByModuleMap.put(module, mapper.selectProjectResources(module.getId())); + allResourcesByModuleMap.put(module, mapper.selectProjectResources(module.getUuid())); } // and then proceed with the batch UPDATE at once @@ -107,16 +107,6 @@ public class ResourceKeyUpdaterDao implements Dao { } } - public void bulkUpdateKey(long projectId, String stringToReplace, String replacementString) { - DbSession session = mybatis.openSession(true); - try { - bulkUpdateKey(session, projectId, stringToReplace, replacementString); - session.commit(); - } finally { - MyBatis.closeQuietly(session); - } - } - private static String computeNewKey(ResourceDto resource, String stringToReplace, String replacementString) { return resource.getKey().replaceAll(stringToReplace, replacementString); } @@ -135,14 +125,14 @@ public class ResourceKeyUpdaterDao implements Dao { } } - private static Set<ResourceDto> collectAllModules(long projectId, String stringToReplace, ResourceKeyUpdaterMapper mapper) { - ResourceDto project = mapper.selectProject(projectId); + private static Set<ResourceDto> collectAllModules(String projectUuid, String stringToReplace, ResourceKeyUpdaterMapper mapper) { + ResourceDto project = mapper.selectProject(projectUuid); Set<ResourceDto> modules = Sets.newHashSet(); if (project.getKey().contains(stringToReplace)) { modules.add(project); } - for (ResourceDto submodule : mapper.selectDescendantProjects(projectId)) { - modules.addAll(collectAllModules(submodule.getId(), stringToReplace, mapper)); + for (ResourceDto submodule : mapper.selectDescendantProjects(projectUuid)) { + modules.addAll(collectAllModules(submodule.getUuid(), stringToReplace, mapper)); } return modules; } diff --git a/sonar-db/src/main/java/org/sonar/db/component/ResourceKeyUpdaterMapper.java b/sonar-db/src/main/java/org/sonar/db/component/ResourceKeyUpdaterMapper.java index 6511e765202..c38ee177cf1 100644 --- a/sonar-db/src/main/java/org/sonar/db/component/ResourceKeyUpdaterMapper.java +++ b/sonar-db/src/main/java/org/sonar/db/component/ResourceKeyUpdaterMapper.java @@ -20,6 +20,7 @@ package org.sonar.db.component; import java.util.List; +import org.apache.ibatis.annotations.Param; /** * @since 3.2 @@ -28,11 +29,11 @@ public interface ResourceKeyUpdaterMapper { int countResourceByKey(String key); - ResourceDto selectProject(long projectId); + ResourceDto selectProject(@Param("uuid") String uuid); - List<ResourceDto> selectProjectResources(long projectId); + List<ResourceDto> selectProjectResources(@Param("rootUuid") String rootUuid); - List<ResourceDto> selectDescendantProjects(long projectId); + List<ResourceDto> selectDescendantProjects(@Param("rootUuid") String rootUuid); void update(ResourceDto resource); diff --git a/sonar-db/src/main/java/org/sonar/db/component/ResourceMapper.java b/sonar-db/src/main/java/org/sonar/db/component/ResourceMapper.java index a77f240dad3..86e1f747c27 100644 --- a/sonar-db/src/main/java/org/sonar/db/component/ResourceMapper.java +++ b/sonar-db/src/main/java/org/sonar/db/component/ResourceMapper.java @@ -62,10 +62,6 @@ public interface ResourceMapper { ResourceDto selectProvisionedProject(@Param("key") String key); - void insert(ResourceDto resource); - - void update(ResourceDto resource); - void updateAuthorizationDate(@Param("projectId") Long projectId, @Param("authorizationDate") Long authorizationDate); } diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueDao.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueDao.java index b2c521bfac7..d5a0eef5d9a 100644 --- a/sonar-db/src/main/java/org/sonar/db/issue/IssueDao.java +++ b/sonar-db/src/main/java/org/sonar/db/issue/IssueDao.java @@ -29,8 +29,6 @@ import java.util.Map; import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.apache.ibatis.session.ResultHandler; -import org.apache.ibatis.session.SqlSession; import org.sonar.db.Dao; import org.sonar.db.DbSession; import org.sonar.db.MyBatis; @@ -47,16 +45,6 @@ public class IssueDao implements Dao { this.mybatis = mybatis; } - public void selectNonClosedIssuesByModule(long componentId, ResultHandler handler) { - SqlSession session = mybatis.openSession(false); - try { - session.select("org.sonar.db.issue.IssueMapper.selectNonClosedIssuesByModule", componentId, handler); - - } finally { - MyBatis.closeQuietly(session); - } - } - public Optional<IssueDto> selectByKey(DbSession session, String key) { return Optional.fromNullable(mapper(session).selectByKey(key)); } diff --git a/sonar-db/src/main/java/org/sonar/db/purge/PurgeDao.java b/sonar-db/src/main/java/org/sonar/db/purge/PurgeDao.java index 403b991e530..6e77444075a 100644 --- a/sonar-db/src/main/java/org/sonar/db/purge/PurgeDao.java +++ b/sonar-db/src/main/java/org/sonar/db/purge/PurgeDao.java @@ -132,7 +132,7 @@ public class PurgeDao implements Dao { private void disableOrphanResources(final ResourceDto project, final SqlSession session, final PurgeMapper purgeMapper, final PurgeListener purgeListener) { final List<IdUuidPair> componentIdUuids = new ArrayList<>(); - session.select("org.sonar.db.purge.PurgeMapper.selectComponentIdUuidsToDisable", project.getId(), + session.select("org.sonar.db.purge.PurgeMapper.selectComponentIdUuidsToDisable", project.getUuid(), resultContext -> { IdUuidPair componentIdUuid = (IdUuidPair) resultContext.getResultObject(); if (componentIdUuid.getId() != null) { diff --git a/sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml b/sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml index 59d9e0397b3..5129d2e2681 100644 --- a/sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml @@ -16,11 +16,11 @@ p.qualifier as qualifier, p.scope as scope, p.language as language, - p.root_id as parentProjectId, + p.root_uuid as rootUuid, p.path as path, p.enabled as enabled, - p.copy_resource_id as copyResourceId, - p.person_id as developerId, + p.copy_component_uuid as copyComponentUuid, + p.developer_uuid as developerUuid, p.authorization_updated_at as authorizationUpdatedAt, p.created_at as createdAt </sql> @@ -32,7 +32,7 @@ p.kee as kee, p.qualifier as qualifier, p.scope as scope, - P.copy_resource_id as copyResourceId, + P.copy_component_uuid as copyComponentUuid, p.module_uuid as moduleUuid </sql> @@ -151,7 +151,7 @@ SELECT <include refid="componentColumns"/> FROM projects p - INNER JOIN projects child ON child.root_id=p.id AND child.enabled=${_true} + INNER JOIN projects child ON child.root_uuid=p.uuid AND child.enabled=${_true} <where> AND p.enabled=${_true} AND p.scope='PRJ' @@ -248,7 +248,7 @@ from projects p <where> AND p.enabled=${_true} - AND p.copy_resource_id is null + AND p.copy_component_uuid is null AND p.qualifier in <foreach collection="qualifiers" open="(" close=")" item="qualifier" separator=","> #{qualifier} @@ -279,7 +279,7 @@ from projects p <where> AND p.enabled=${_true} - AND p.copy_resource_id is null + AND p.copy_component_uuid is null <if test="query.qualifiers!=null"> AND p.qualifier in <foreach collection="query.qualifiers" item="qualifier" open="(" close=")" separator=","> @@ -373,11 +373,10 @@ WHERE ri.kee like #{query.nameOrKeyQueryToSqlForResourceIndex} ESCAPE '/' ) OR - p.copy_resource_id IN ( - SELECT p1.id - FROM resource_index ri, projects p1 + p.copy_component_uuid IN ( + SELECT ri.component_uuid + FROM resource_index ri WHERE ri.kee like #{query.nameOrKeyQueryToSqlForResourceIndex} ESCAPE '/' - and p1.uuid = ri.component_uuid ) ) </if> @@ -388,7 +387,7 @@ from projects p <where> p.enabled=${_true} - AND p.copy_resource_id is null + AND p.copy_component_uuid is null AND p.qualifier in <foreach collection="qualifiers" open="(" close=")" item="qualifier" separator=","> #{qualifier} @@ -413,7 +412,7 @@ <select id="selectProjectsFromView" resultType="String"> SELECT p.uuid FROM projects technical_projects - INNER JOIN projects p on p.id=technical_projects.copy_resource_id AND p.enabled=${_true} + INNER JOIN projects p on p.uuid=technical_projects.copy_component_uuid AND p.enabled=${_true} <where> technical_projects.enabled=${_true} AND technical_projects.project_uuid=#{projectViewUuid} AND technical_projects.module_uuid_path LIKE #{viewUuidLikeQuery} @@ -454,7 +453,7 @@ s.id is null and p.enabled=${_true} and p.qualifier=#{qualifier} - and p.copy_resource_id is null + and p.copy_component_uuid is null <if test="query!=null"> and ( UPPER(p.name) like #{query} @@ -482,7 +481,7 @@ where s2.id is null and p.qualifier=#{qualifier} - and p.copy_resource_id is null + and p.copy_component_uuid is null <if test="query!=null"> and ( UPPER(p.name) like #{query} @@ -493,14 +492,14 @@ <sql id="insertSql"> INSERT INTO projects (kee, deprecated_kee, uuid, project_uuid, module_uuid, module_uuid_path, name, long_name, - qualifier, scope, language, description, root_id, path, copy_resource_id, person_id, enabled, + qualifier, scope, language, description, root_uuid, path, copy_component_uuid, developer_uuid, enabled, created_at, authorization_updated_at) VALUES (#{kee,jdbcType=VARCHAR}, #{deprecatedKey,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}, #{projectUuid,jdbcType=VARCHAR}, #{moduleUuid,jdbcType=VARCHAR}, #{moduleUuidPath,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{longName,jdbcType=VARCHAR}, #{qualifier,jdbcType=VARCHAR}, #{scope,jdbcType=VARCHAR}, #{language,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, - #{parentProjectId,jdbcType=BIGINT}, #{path,jdbcType=VARCHAR}, #{copyResourceId,jdbcType=BIGINT}, - #{developerId,jdbcType=BIGINT}, + #{rootUuid,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR}, #{copyComponentUuid,jdbcType=VARCHAR}, + #{developerUuid,jdbcType=VARCHAR}, #{enabled,jdbcType=BOOLEAN}, #{createdAt,jdbcType=TIMESTAMP}, #{authorizationUpdatedAt,jdbcType=BIGINT}) </sql> @@ -526,10 +525,10 @@ scope=#{scope,jdbcType=VARCHAR}, language=#{language,jdbcType=VARCHAR}, description=#{description,jdbcType=VARCHAR}, - root_id=#{parentProjectId,jdbcType=BIGINT}, + root_uuid=#{rootUuid,jdbcType=VARCHAR}, path=#{path,jdbcType=VARCHAR}, - copy_resource_id=#{copyResourceId,jdbcType=BIGINT}, - person_id=#{developerId,jdbcType=BIGINT}, + copy_component_uuid=#{copyComponentUuid,jdbcType=VARCHAR}, + developer_uuid=#{developerUuid,jdbcType=VARCHAR}, enabled=#{enabled,jdbcType=BOOLEAN}, authorization_updated_at=#{authorizationUpdatedAt,jdbcType=BIGINT} WHERE uuid=#{uuid} diff --git a/sonar-db/src/main/resources/org/sonar/db/component/ResourceIndexMapper.xml b/sonar-db/src/main/resources/org/sonar/db/component/ResourceIndexMapper.xml index de993ded498..9e79c6417cb 100644 --- a/sonar-db/src/main/resources/org/sonar/db/component/ResourceIndexMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/component/ResourceIndexMapper.xml @@ -5,7 +5,7 @@ <select id="selectProjectIdsFromQueryAndViewOrSubViewUuid" parameterType="map" resultType="long"> SELECT original.id FROM resource_index r INNER JOIN projects original ON r.component_uuid = original.uuid - INNER JOIN projects copy ON original.id = copy.copy_resource_id + INNER JOIN projects copy ON original.uuid = copy.copy_component_uuid <where> AND copy.module_uuid_path LIKE #{viewUuidQuery} AND r.kee LIKE #{query} @@ -23,7 +23,7 @@ from projects p, projects root, snapshots s <where> p.enabled=${_true} - and p.copy_resource_id is null + and p.copy_component_uuid is null and p.uuid=s.component_uuid and s.islast=${_true} <if test="scopes != null"> diff --git a/sonar-db/src/main/resources/org/sonar/db/component/ResourceKeyUpdaterMapper.xml b/sonar-db/src/main/resources/org/sonar/db/component/ResourceKeyUpdaterMapper.xml index 463b3c06a62..0d6bd0f1b6c 100644 --- a/sonar-db/src/main/resources/org/sonar/db/component/ResourceKeyUpdaterMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/component/ResourceKeyUpdaterMapper.xml @@ -6,8 +6,9 @@ <resultMap id="resourceResultMap" type="Resource"> <id property="id" column="id"/> <result property="key" column="kee"/> + <result property="uuid" column="uuid"/> <result property="deprecatedKey" column="deprecated_kee"/> - <result property="rootId" column="root_id"/> + <result property="rootUuid" column="root_uuid"/> <result property="scope" column="scope"/> </resultMap> @@ -17,16 +18,16 @@ WHERE kee = #{key} </select> - <select id="selectProject" parameterType="long" resultMap="resourceResultMap"> - select * from projects where id=#{id} + <select id="selectProject" parameterType="String" resultMap="resourceResultMap"> + select * from projects where uuid=#{uuid} </select> - <select id="selectProjectResources" parameterType="long" resultMap="resourceResultMap"> - select * from projects where root_id=#{id} AND scope!='PRJ' + <select id="selectProjectResources" parameterType="String" resultMap="resourceResultMap"> + select * from projects where root_uuid=#{rootUuid} AND scope!='PRJ' </select> - <select id="selectDescendantProjects" parameterType="long" resultMap="resourceResultMap"> - select * from projects where scope='PRJ' and root_id=#{id} + <select id="selectDescendantProjects" parameterType="String" resultMap="resourceResultMap"> + select * from projects where scope='PRJ' and root_uuid=#{rootUuid} and uuid!=#{rootUuid} </select> <update id="update" parameterType="Resource"> diff --git a/sonar-db/src/main/resources/org/sonar/db/component/ResourceMapper.xml b/sonar-db/src/main/resources/org/sonar/db/component/ResourceMapper.xml index ef0fce32d24..4b317231e88 100644 --- a/sonar-db/src/main/resources/org/sonar/db/component/ResourceMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/component/ResourceMapper.xml @@ -47,14 +47,14 @@ <result property="path" column="path"/> <result property="name" column="name"/> <result property="longName" column="long_name"/> - <result property="rootId" column="root_id"/> + <result property="rootUuid" column="root_uuid"/> <result property="scope" column="scope"/> <result property="qualifier" column="qualifier"/> <result property="enabled" column="enabled"/> <result property="description" column="description"/> <result property="language" column="language"/> - <result property="copyResourceId" column="copy_resource_id"/> - <result property="personId" column="person_id"/> + <result property="copyComponentUuid" column="copy_component_uuid"/> + <result property="developerUuid" column="developer_uuid"/> <result property="createdAt" column="created_at"/> <result property="authorizationUpdatedAt" column="authorization_updated_at"/> </resultMap> @@ -111,7 +111,7 @@ <select id="selectLastSnapshotByResourceKey" parameterType="string" resultMap="snapshotResultMap"> SELECT s.* FROM snapshots s - INNER JOIN projects p on p.uuid=s.component_uuid AND p.enabled=${_true} AND p.copy_resource_id IS NULL + INNER JOIN projects p on p.uuid=s.component_uuid AND p.enabled=${_true} AND p.copy_component_uuid is null <where> AND p.kee=#{id} AND s.islast=${_true} @@ -120,7 +120,7 @@ <select id="selectLastSnapshotByResourceUuid" parameterType="string" resultMap="snapshotResultMap"> SELECT s.* from snapshots s - INNER JOIN projects p on p.uuid=s.component_uuid AND p.enabled=${_true} AND p.copy_resource_id IS NULL + INNER JOIN projects p on p.uuid=s.component_uuid AND p.enabled=${_true} AND p.copy_component_uuid is null <where> AND p.uuid=#{uuid} AND s.islast=${_true} @@ -147,7 +147,7 @@ </foreach> </if> and p.enabled=${_true} - and p.copy_resource_id is null + and p.copy_component_uuid is null </where> </select> @@ -166,7 +166,7 @@ </foreach> </if> and p.enabled=${_true} - and p.copy_resource_id is null + and p.copy_component_uuid is null and s.islast=${_true} </where> </sql> @@ -183,7 +183,7 @@ p.qualifier=#{qualifier} </foreach> </if> - and p.copy_resource_id is null + and p.copy_component_uuid is null </where> </select> @@ -198,7 +198,7 @@ p.qualifier=#{qualifier} </foreach> </if> - and p.copy_resource_id is null + and p.copy_component_uuid is null </where> </select> @@ -207,33 +207,9 @@ left join snapshots s on s.component_uuid=p.uuid where s.id is null and p.kee = #{key} - and p.copy_resource_id is null + and p.copy_component_uuid is null </select> - <insert id="insert" parameterType="Resource" keyColumn="id" useGeneratedKeys="true" keyProperty="id"> - insert into projects - (uuid, project_uuid, module_uuid, module_uuid_path, name, long_name, description, scope, qualifier, kee, - deprecated_kee, path, language, root_id, copy_resource_id, person_id, - enabled, authorization_updated_at, created_at) - values ( - #{uuid,jdbcType=VARCHAR}, #{projectUuid,jdbcType=VARCHAR}, #{moduleUuid,jdbcType=VARCHAR}, - #{moduleUuidPath,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, - #{longName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{scope,jdbcType=VARCHAR}, - #{qualifier,jdbcType=VARCHAR}, - #{key,jdbcType=VARCHAR}, #{deprecatedKey,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR}, #{language,jdbcType=VARCHAR}, - #{rootId,jdbcType=INTEGER}, #{copyResourceId,jdbcType=INTEGER}, - #{personId,jdbcType=INTEGER}, #{enabled,jdbcType=BOOLEAN}, #{authorizationUpdatedAt,jdbcType=BIGINT}, - #{createdAt,jdbcType=TIMESTAMP} - ) - </insert> - - <update id="update" parameterType="Resource"> - update projects set name=#{name}, long_name=#{longName}, description=#{description}, - scope=#{scope}, qualifier=#{qualifier}, kee=#{key}, deprecated_kee=#{deprecatedKey}, path=#{path}, - language=#{language}, root_id=#{rootId}, copy_resource_id=#{copyResourceId}, - person_id=#{personId}, enabled=#{enabled} where id=#{id} - </update> - <update id="updateAuthorizationDate" parameterType="map"> update projects set authorization_updated_at=#{authorizationDate} where id=#{projectId} diff --git a/sonar-db/src/main/resources/org/sonar/db/issue/IssueMapper.xml b/sonar-db/src/main/resources/org/sonar/db/issue/IssueMapper.xml index 2888c9aa272..909ba71449f 100644 --- a/sonar-db/src/main/resources/org/sonar/db/issue/IssueMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/issue/IssueMapper.xml @@ -162,45 +162,6 @@ i.status <> 'CLOSED' </select> - <select id="selectNonClosedIssuesByModule" parameterType="long" resultType="Issue"> - select - i.id, - i.kee as kee, - i.rule_id as ruleId, - i.component_uuid as componentUuid, - i.project_uuid as projectUuid, - i.severity as severity, - i.manual_severity as manualSeverity, - i.message as message, - i.line as line, - i.locations as locations, - i.gap as gap, - i.effort as effort, - i.status as status, - i.resolution as resolution, - i.checksum as checksum, - i.assignee as assignee, - i.author_login as authorLogin, - i.tags as tagsString, - i.issue_attributes as issueAttributes, - i.issue_creation_date as issueCreationTime, - i.issue_update_date as issueUpdateTime, - i.issue_close_date as issueCloseTime, - i.created_at as createdAt, - i.updated_at as updatedAt, - i.issue_type as type, - r.plugin_rule_key as ruleKey, - r.plugin_name as ruleRepo, - p.kee as componentKey, - root.kee as projectKey - from issues i - inner join (select p.id, p.uuid,p.kee from projects p where (p.root_id=#{id} and p.qualifier <> 'BRC') or - (p.id=#{id})) p on p.uuid=i.component_uuid - inner join rules r on r.id=i.rule_id - left outer join projects root on root.uuid=i.project_uuid - where i.status <> 'CLOSED' - </select> - <select id="selectComponentUuidsOfOpenIssuesForProjectUuid" parameterType="string" resultType="string"> select distinct(i.component_uuid) from issues i diff --git a/sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml b/sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml index 3b39f3fad05..8c4cce48c0d 100644 --- a/sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml @@ -72,9 +72,9 @@ not exists(select e.id from events e where e.snapshot_id=s.id) </select> - <select id="selectComponentIdUuidsToDisable" resultType="org.sonar.db.purge.IdUuidPair" parameterType="long"> + <select id="selectComponentIdUuidsToDisable" resultType="org.sonar.db.purge.IdUuidPair" parameterType="String"> select p.id, p.uuid from projects p - where (p.id=#{id} or p.root_id=#{id}) and p.enabled=${_true} + where p.root_uuid=#{uuid} and p.enabled=${_true} and not exists(select s.component_uuid from snapshots s where s.islast=${_true} and s.component_uuid=p.uuid) </select> diff --git a/sonar-db/src/main/resources/org/sonar/db/user/AuthorizationMapper.xml b/sonar-db/src/main/resources/org/sonar/db/user/AuthorizationMapper.xml index 12bef99c2fd..f670e71ecc8 100644 --- a/sonar-db/src/main/resources/org/sonar/db/user/AuthorizationMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/user/AuthorizationMapper.xml @@ -9,7 +9,20 @@ WHERE gr.role=#{role} and (gr.group_id is null or gr.group_id in (select gu.group_id from groups_users gu where gu.user_id=#{userId})) - and (gr.resource_id = p.root_id or gr.resource_id = p.id) and + and gr.resource_id = p.id + and + <foreach collection="componentKeys" open="(" close=")" item="element" index="index" separator=" or "> + p.kee=#{element} + </foreach> + UNION + SELECT p.kee + FROM group_roles gr, projects root, projects p + WHERE + gr.role=#{role} + and (gr.group_id is null or gr.group_id in (select gu.group_id from groups_users gu where gu.user_id=#{userId})) + and gr.resource_id = root.id + and p.root_uuid = root.uuid + and <foreach collection="componentKeys" open="(" close=")" item="element" index="index" separator=" or "> p.kee=#{element} </foreach> @@ -19,7 +32,8 @@ INNER JOIN projects p on p.id = ur.resource_id WHERE ur.role=#{role} - and ur.user_id=#{userId} and + and ur.user_id=#{userId} + and <foreach collection="componentKeys" open="(" close=")" item="element" index="index" separator=" or "> p.kee=#{element} </foreach> @@ -31,7 +45,20 @@ WHERE gr.role=#{role} and gr.group_id is null - and (gr.resource_id = p.root_id or gr.resource_id = p.id) and + and gr.resource_id = p.id + and + <foreach collection="componentKeys" open="(" close=")" item="element" index="index" separator=" or "> + p.kee=#{element} + </foreach> + UNION + SELECT p.kee + FROM group_roles gr, projects root, projects p + WHERE + gr.role=#{role} + and gr.group_id is null + and gr.resource_id = root.id + and p.root_uuid = root.uuid + and <foreach collection="componentKeys" open="(" close=")" item="element" index="index" separator=" or "> p.kee=#{element} </foreach> diff --git a/sonar-db/src/test/java/org/sonar/db/component/ComponentDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/ComponentDaoTest.java index c477dc064a3..2acc84c106d 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/ComponentDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/component/ComponentDaoTest.java @@ -68,7 +68,7 @@ public class ComponentDaoTest { assertThat(result.uuid()).isEqualTo("KLMN"); assertThat(result.moduleUuid()).isEqualTo("EFGH"); assertThat(result.moduleUuidPath()).isEqualTo(".ABCD.EFGH."); - assertThat(result.parentProjectId()).isEqualTo(2); + assertThat(result.getRootUuid()).isEqualTo("EFGH"); assertThat(result.projectUuid()).isEqualTo("ABCD"); assertThat(result.key()).isEqualTo("org.struts:struts-core:src/org/struts/RequestContext.java"); assertThat(result.path()).isEqualTo("src/org/struts/RequestContext.java"); @@ -77,7 +77,8 @@ public class ComponentDaoTest { assertThat(result.qualifier()).isEqualTo("FIL"); assertThat(result.scope()).isEqualTo("FIL"); assertThat(result.language()).isEqualTo("java"); - assertThat(result.getCopyResourceId()).isNull(); + assertThat(result.getCopyResourceUuid()).isNull(); + assertThat(result.getDeveloperUuid()).isNull(); assertThat(underTest.selectByUuid(dbSession, "UNKNOWN")).isAbsent(); } @@ -91,7 +92,7 @@ public class ComponentDaoTest { assertThat(result.uuid()).isEqualTo("STUV"); assertThat(result.moduleUuid()).isEqualTo("OPQR"); assertThat(result.moduleUuidPath()).isEqualTo(".OPQR."); - assertThat(result.parentProjectId()).isEqualTo(11); + assertThat(result.getRootUuid()).isEqualTo("OPQR"); assertThat(result.projectUuid()).isEqualTo("OPQR"); assertThat(result.key()).isEqualTo("DEV:anakin@skywalker.name:org.struts:struts"); assertThat(result.path()).isNull(); @@ -100,7 +101,8 @@ public class ComponentDaoTest { assertThat(result.qualifier()).isEqualTo("DEV_PRJ"); assertThat(result.scope()).isEqualTo("PRJ"); assertThat(result.language()).isNull(); - assertThat(result.getCopyResourceId()).isEqualTo(1L); + assertThat(result.getCopyResourceUuid()).isEqualTo("ABCD"); + assertThat(result.getDeveloperUuid()).isEqualTo("OPQR"); } @Test @@ -108,7 +110,7 @@ public class ComponentDaoTest { db.prepareDbUnit(getClass(), "shared.xml"); ComponentDto result = underTest.selectByUuid(dbSession, "STUV").get(); - assertThat(result.getDeveloperId()).isEqualTo(11L); + assertThat(result.getDeveloperUuid()).isEqualTo("OPQR"); } @Test @@ -144,7 +146,8 @@ public class ComponentDaoTest { assertThat(result.qualifier()).isEqualTo("FIL"); assertThat(result.scope()).isEqualTo("FIL"); assertThat(result.language()).isEqualTo("java"); - assertThat(result.parentProjectId()).isEqualTo(2); + assertThat(result.uuid()).isEqualTo("KLMN"); + assertThat(result.getRootUuid()).isEqualTo("EFGH"); assertThat(underTest.selectByKey(dbSession, "unknown")).isAbsent(); } @@ -180,7 +183,7 @@ public class ComponentDaoTest { assertThat(result.qualifier()).isEqualTo("TRK"); assertThat(result.scope()).isEqualTo("PRJ"); assertThat(result.language()).isNull(); - assertThat(result.parentProjectId()).isNull(); + assertThat(result.getRootUuid()).isEqualTo("ABCD"); assertThat(result.getAuthorizationUpdatedAt()).isEqualTo(123456789L); } @@ -200,7 +203,7 @@ public class ComponentDaoTest { assertThat(result.qualifier()).isEqualTo("FIL"); assertThat(result.scope()).isEqualTo("FIL"); assertThat(result.language()).isEqualTo("java"); - assertThat(result.parentProjectId()).isEqualTo(2); + assertThat(result.getRootUuid()).isEqualTo("EFGH"); assertThat(underTest.selectByKeys(dbSession, singletonList("unknown"))).isEmpty(); } @@ -221,7 +224,7 @@ public class ComponentDaoTest { assertThat(result.qualifier()).isEqualTo("FIL"); assertThat(result.scope()).isEqualTo("FIL"); assertThat(result.language()).isEqualTo("java"); - assertThat(result.parentProjectId()).isEqualTo(2); + assertThat(result.getRootUuid()).isEqualTo("EFGH"); assertThat(underTest.selectByIds(dbSession, newArrayList(555L))).isEmpty(); } @@ -238,7 +241,7 @@ public class ComponentDaoTest { assertThat(result.uuid()).isEqualTo("KLMN"); assertThat(result.moduleUuid()).isEqualTo("EFGH"); assertThat(result.moduleUuidPath()).isEqualTo(".ABCD.EFGH."); - assertThat(result.parentProjectId()).isEqualTo(2); + assertThat(result.getRootUuid()).isEqualTo("EFGH"); assertThat(result.projectUuid()).isEqualTo("ABCD"); assertThat(result.key()).isEqualTo("org.struts:struts-core:src/org/struts/RequestContext.java"); assertThat(result.path()).isEqualTo("src/org/struts/RequestContext.java"); @@ -358,7 +361,7 @@ public class ComponentDaoTest { assertThat(results.get(0).getKey()).isEqualTo("org.struts:struts"); // Sub project of a project - assertThat(underTest.selectSubProjectsByComponentUuids(dbSession, newArrayList("ABCD"))).isEmpty(); + assertThat(underTest.selectSubProjectsByComponentUuids(dbSession, newArrayList("ABCD"))).extracting("uuid").containsOnly("ABCD"); // SUb projects of a component and a sub module assertThat(underTest.selectSubProjectsByComponentUuids(dbSession, newArrayList("HIJK", "FGHI"))).hasSize(2); @@ -569,9 +572,9 @@ public class ComponentDaoTest { .setLanguage("java") .setDescription("description") .setPath("src/org/struts/RequestContext.java") - .setParentProjectId(3L) - .setCopyResourceId(5L) - .setDeveloperId(7L) + .setRootUuid("uuid_3") + .setCopyComponentUuid("uuid_5") + .setDeveloperUuid("uuid_7") .setEnabled(true) .setCreatedAt(DateUtils.parseDate("2014-06-18")) .setAuthorizationUpdatedAt(123456789L); @@ -602,9 +605,9 @@ public class ComponentDaoTest { .setLanguage("java") .setDescription("description") .setPath("src/org/struts/RequestContext.java") - .setParentProjectId(3L) - .setCopyResourceId(5L) - .setDeveloperId(7L) + .setRootUuid("uuid_3") + .setCopyComponentUuid("uuid_5") + .setDeveloperUuid("uuid_7") .setEnabled(true) .setCreatedAt(DateUtils.parseDate("2014-06-18")) .setAuthorizationUpdatedAt(123456789L); @@ -634,7 +637,7 @@ public class ComponentDaoTest { .setScope("FIL") .setLanguage("java") .setPath("src/org/struts/RequestContext.java") - .setParentProjectId(3L) + .setRootUuid("uuid_3") .setEnabled(false) .setCreatedAt(DateUtils.parseDate("2014-06-18")) .setAuthorizationUpdatedAt(123456789L); @@ -664,9 +667,9 @@ public class ComponentDaoTest { .setLanguage("java2") .setDescription("description2") .setPath("src/org/struts/RequestContext2.java") - .setParentProjectId(4L) - .setCopyResourceId(6L) - .setDeveloperId(9L) + .setRootUuid("uuid_4") + .setCopyComponentUuid("uuid_6") + .setDeveloperUuid("uuid_9") .setEnabled(false) .setAuthorizationUpdatedAt(12345678910L); diff --git a/sonar-db/src/test/java/org/sonar/db/component/ComponentDtoTest.java b/sonar-db/src/test/java/org/sonar/db/component/ComponentDtoTest.java index 836149e3277..09b1ffc597b 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/ComponentDtoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/component/ComponentDtoTest.java @@ -40,8 +40,9 @@ public class ComponentDtoTest { .setLanguage("java") .setDescription("desc") .setPath("src/org/struts/RequestContext.java") - .setCopyResourceId(5L) - .setParentProjectId(3L) + .setCopyComponentUuid("uuid_5") + .setRootUuid("uuid_3") + .setDeveloperUuid("uuid_6") .setAuthorizationUpdatedAt(123456789L); assertThat(componentDto.getId()).isEqualTo(1L); @@ -54,8 +55,9 @@ public class ComponentDtoTest { assertThat(componentDto.path()).isEqualTo("src/org/struts/RequestContext.java"); assertThat(componentDto.language()).isEqualTo("java"); assertThat(componentDto.description()).isEqualTo("desc"); - assertThat(componentDto.parentProjectId()).isEqualTo(3L); - assertThat(componentDto.getCopyResourceId()).isEqualTo(5L); + assertThat(componentDto.getRootUuid()).isEqualTo("uuid_3"); + assertThat(componentDto.getCopyResourceUuid()).isEqualTo("uuid_5"); + assertThat(componentDto.getDeveloperUuid()).isEqualTo("uuid_6"); assertThat(componentDto.getAuthorizationUpdatedAt()).isEqualTo(123456789L); } diff --git a/sonar-db/src/test/java/org/sonar/db/component/ComponentTesting.java b/sonar-db/src/test/java/org/sonar/db/component/ComponentTesting.java index 90b42a41772..cc5904b0b5e 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/ComponentTesting.java +++ b/sonar-db/src/test/java/org/sonar/db/component/ComponentTesting.java @@ -94,7 +94,7 @@ public class ComponentTesting { .setUuid(uuid) .setProjectUuid(uuid) .setModuleUuidPath(MODULE_UUID_PATH_SEP + uuid + MODULE_UUID_PATH_SEP) - .setParentProjectId(null) + .setRootUuid(uuid) .setKey("KEY_" + uuid) .setName("NAME_" + uuid) .setLongName("LONG_NAME_" + uuid) @@ -111,7 +111,7 @@ public class ComponentTesting { .setUuid(uuid) .setProjectUuid(uuid) .setModuleUuidPath(MODULE_UUID_PATH_SEP + uuid + MODULE_UUID_PATH_SEP) - .setParentProjectId(null) + .setRootUuid(uuid) .setKey(uuid) .setName(name) .setLongName(name) @@ -141,7 +141,7 @@ public class ComponentTesting { .setKey(view.key() + project.key()) .setName(project.name()) .setLongName(project.longName()) - .setCopyResourceId(project.getId()) + .setCopyComponentUuid(project.uuid()) .setScope(Scopes.FILE) .setQualifier(Qualifiers.PROJECT) .setPath(null) @@ -155,7 +155,7 @@ public class ComponentTesting { .setKey(developer.key() + ":" + project.key()) .setName(project.name()) .setLongName(project.longName()) - .setCopyResourceId(project.getId()) + .setCopyComponentUuid(project.uuid()) .setScope(Scopes.PROJECT) .setQualifier("DEV_PRJ") .setPath(null) @@ -168,7 +168,7 @@ public class ComponentTesting { .setProjectUuid(module.projectUuid()) .setModuleUuid(module.uuid()) .setModuleUuidPath(module.moduleUuidPath()) - .setParentProjectId(module.getId()) + .setRootUuid(module.uuid()) .setCreatedAt(new Date()) .setEnabled(true); } diff --git a/sonar-db/src/test/java/org/sonar/db/component/ResourceDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/ResourceDaoTest.java index 0c13476bde8..60bd033b741 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/ResourceDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/component/ResourceDaoTest.java @@ -27,8 +27,6 @@ import javax.annotation.Nullable; import org.junit.Rule; import org.junit.Test; import org.sonar.api.component.Component; -import org.sonar.api.resources.Qualifiers; -import org.sonar.api.resources.Scopes; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; @@ -88,27 +86,6 @@ public class ResourceDaoTest { } @Test - public void should_insert_using_existing_session() { - dbTester.prepareDbUnit(getClass(), "insert.xml"); - - ResourceDto file1 = new ResourceDto().setUuid("ABCD") - .setKey("org.struts:struts:/src/main/java/org/struts/Action.java") - .setDeprecatedKey("org.struts:struts:org.struts.Action").setScope(Scopes.FILE).setQualifier(Qualifiers.FILE) - .setLanguage("java").setName("Action").setLongName("org.struts.Action"); - ResourceDto file2 = new ResourceDto().setUuid("BCDE") - .setKey("org.struts:struts:/src/main/java/org/struts/Filter.java") - .setDeprecatedKey("org.struts:struts:org.struts.Filter").setScope(Scopes.FILE).setQualifier(Qualifiers.FILE) - .setLanguage("java").setName("Filter").setLongName("org.struts.Filter"); - - underTest.insertUsingExistingSession(file1, dbTester.getSession()); - underTest.insertUsingExistingSession(file2, dbTester.getSession()); - - dbTester.getSession().rollback(); - - assertThat(dbTester.countRowsOfTable("projects")).isZero(); - } - - @Test public void should_find_component_by_key() { dbTester.prepareDbUnit(getClass(), "fixture.xml"); diff --git a/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java index cdcce31fb4b..ecf6a506df5 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java @@ -147,7 +147,7 @@ public class ResourceIndexDaoTest { @Test public void restrict_indexed_combinations_to_400_characters() { String longName = repeat("a", 2_000); - ComponentDto project = new ComponentDto().setUuid(ROOT_UUID).setKey("the_key").setName(longName).setScope(Scopes.PROJECT).setQualifier(Qualifiers.PROJECT); + ComponentDto project = new ComponentDto().setUuid(ROOT_UUID).setRootUuid(ROOT_UUID).setKey("the_key").setName(longName).setScope(Scopes.PROJECT).setQualifier(Qualifiers.PROJECT); DbSession session = dbTester.getSession(); dbTester.getDbClient().componentDao().insert(session, project); dbTester.getDbClient().snapshotDao().insert(session, new SnapshotDto().setComponentUuid(project.uuid()).setRootComponentUuid(project.uuid()).setLast(true)); diff --git a/sonar-db/src/test/java/org/sonar/db/component/ResourceKeyUpdaterDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/ResourceKeyUpdaterDaoTest.java index c44ee35e9e4..971aab92c4d 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/ResourceKeyUpdaterDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/component/ResourceKeyUpdaterDaoTest.java @@ -25,6 +25,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; +import org.sonar.db.DbSession; import org.sonar.db.DbTester; import static org.assertj.core.api.Assertions.assertThat; @@ -38,6 +39,7 @@ public class ResourceKeyUpdaterDaoTest { @Rule public DbTester db = DbTester.create(System2.INSTANCE); + private DbSession dbSession = db.getSession(); ComponentDbTester componentDb = new ComponentDbTester(db); ResourceKeyUpdaterDao underTest = db.getDbClient().resourceKeyUpdaterDao(); @@ -46,7 +48,7 @@ public class ResourceKeyUpdaterDaoTest { public void shouldUpdateKey() { db.prepareDbUnit(getClass(), "shared.xml"); - underTest.updateKey(2, "struts:core"); + underTest.updateKey("B", "struts:core"); db.assertDbUnit(getClass(), "shouldUpdateKey-result.xml", "projects"); } @@ -58,14 +60,15 @@ public class ResourceKeyUpdaterDaoTest { thrown.expect(IllegalStateException.class); thrown.expectMessage("Impossible to update key: a resource with \"org.struts:struts-ui\" key already exists."); - underTest.updateKey(2, "org.struts:struts-ui"); + underTest.updateKey("B", "org.struts:struts-ui"); } @Test public void shouldBulkUpdateKey() { db.prepareDbUnit(getClass(), "shared.xml"); - underTest.bulkUpdateKey(1, "org.struts", "org.apache.struts"); + underTest.bulkUpdateKey(dbSession, "A", "org.struts", "org.apache.struts"); + dbSession.commit(); db.assertDbUnit(getClass(), "shouldBulkUpdateKey-result.xml", "projects"); } @@ -74,7 +77,8 @@ public class ResourceKeyUpdaterDaoTest { public void shouldBulkUpdateKeyOnOnlyOneSubmodule() { db.prepareDbUnit(getClass(), "shared.xml"); - underTest.bulkUpdateKey(1, "struts-ui", "struts-web"); + underTest.bulkUpdateKey(dbSession, "A", "struts-ui", "struts-web"); + dbSession.commit(); db.assertDbUnit(getClass(), "shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml", "projects"); } @@ -86,14 +90,16 @@ public class ResourceKeyUpdaterDaoTest { thrown.expect(IllegalStateException.class); thrown.expectMessage("Impossible to update key: a resource with \"foo:struts-core\" key already exists."); - underTest.bulkUpdateKey(1, "org.struts", "foo"); + underTest.bulkUpdateKey(dbSession, "A", "org.struts", "foo"); + dbSession.commit(); } @Test public void shouldNotUpdateAllSubmodules() { db.prepareDbUnit(getClass(), "shouldNotUpdateAllSubmodules.xml"); - underTest.bulkUpdateKey(1, "org.struts", "org.apache.struts"); + underTest.bulkUpdateKey(dbSession, "A", "org.struts", "org.apache.struts"); + dbSession.commit(); db.assertDbUnit(getClass(), "shouldNotUpdateAllSubmodules-result.xml", "projects"); } @@ -107,14 +113,14 @@ public class ResourceKeyUpdaterDaoTest { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Component key length (405) is longer than the maximum authorized (400). '" + newLongProjectKey + ":file' was provided."); - underTest.updateKey(project.getId(), newLongProjectKey); + underTest.updateKey(project.uuid(), newLongProjectKey); } @Test public void shouldCheckModuleKeysBeforeRenaming() { db.prepareDbUnit(getClass(), "shared.xml"); - Map<String, String> checkResults = underTest.checkModuleKeysBeforeRenaming(1, "org.struts", "foo"); + Map<String, String> checkResults = underTest.checkModuleKeysBeforeRenaming("A", "org.struts", "foo"); assertThat(checkResults.size()).isEqualTo(3); assertThat(checkResults.get("org.struts:struts")).isEqualTo("foo:struts"); assertThat(checkResults.get("org.struts:struts-core")).isEqualTo("#duplicate_key#"); diff --git a/sonar-db/src/test/java/org/sonar/db/issue/IssueDaoTest.java b/sonar-db/src/test/java/org/sonar/db/issue/IssueDaoTest.java index 4b48ebbce04..9fe992fd17e 100644 --- a/sonar-db/src/test/java/org/sonar/db/issue/IssueDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/issue/IssueDaoTest.java @@ -20,7 +20,6 @@ package org.sonar.db.issue; import java.util.List; -import org.apache.ibatis.executor.result.DefaultResultHandler; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -52,52 +51,6 @@ public class IssueDaoTest { IssueDao underTest = dbTester.getDbClient().issueDao(); @Test - public void select_non_closed_issues_by_module() { - dbTester.prepareDbUnit(getClass(), "shared.xml", "should_select_non_closed_issues_by_module.xml"); - - // 400 is a non-root module, we should find 2 issues from classes and one on itself - DefaultResultHandler handler = new DefaultResultHandler(); - underTest.selectNonClosedIssuesByModule(400, handler); - assertThat(handler.getResultList()).hasSize(3); - - IssueDto issue = (IssueDto) handler.getResultList().get(0); - assertThat(issue.getRuleRepo()).isNotNull(); - assertThat(issue.getRule()).isNotNull(); - assertThat(issue.getComponentKey()).isNotNull(); - assertThat(issue.getProjectKey()).isEqualTo("struts"); - - // 399 is the root module, we should only find 1 issue on itself - handler = new DefaultResultHandler(); - underTest.selectNonClosedIssuesByModule(399, handler); - assertThat(handler.getResultList()).hasSize(1); - - issue = (IssueDto) handler.getResultList().get(0); - assertThat(issue.getComponentKey()).isEqualTo("struts"); - assertThat(issue.getProjectKey()).isEqualTo("struts"); - } - - /** - * SONAR-5218 - */ - @Test - public void select_non_closed_issues_by_module_on_removed_project() { - // All issues are linked on a project that is not existing anymore - - dbTester.prepareDbUnit(getClass(), "shared.xml", "should_select_non_closed_issues_by_module_on_removed_project.xml"); - - // 400 is a non-root module, we should find 2 issues from classes and one on itself - DefaultResultHandler handler = new DefaultResultHandler(); - underTest.selectNonClosedIssuesByModule(400, handler); - assertThat(handler.getResultList()).hasSize(3); - - IssueDto issue = (IssueDto) handler.getResultList().get(0); - assertThat(issue.getRuleRepo()).isNotNull(); - assertThat(issue.getRule()).isNotNull(); - assertThat(issue.getComponentKey()).isNotNull(); - assertThat(issue.getProjectKey()).isNull(); - } - - @Test public void selectByKeyOrFail() { prepareTables(); diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/insert-result.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/insert-result.xml index 3097967ba2b..8d70ce24e52 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/insert-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/insert-result.xml @@ -3,8 +3,8 @@ <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" deprecated_kee="org.struts:struts-core:src/org/struts/RequestContext.java" name="RequestContext.java" long_name="org.struts.RequestContext" uuid="GHIJ" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." - qualifier="FIL" scope="FIL" language="java" path="src/org/struts/RequestContext.java" root_id="3" - description="description" enabled="[true]" copy_resource_id="5" person_id="7" + qualifier="FIL" scope="FIL" language="java" path="src/org/struts/RequestContext.java" root_uuid="uuid_3" + description="description" enabled="[true]" copy_component_uuid="uuid_5" developer_uuid="uuid_7" authorization_updated_at="123456789" created_at="2014-06-18" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/insert_disabled_component-result.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/insert_disabled_component-result.xml index a7021383b33..3fe7c2f0512 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/insert_disabled_component-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/insert_disabled_component-result.xml @@ -2,8 +2,8 @@ <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" name="RequestContext.java" long_name="org.struts.RequestContext" uuid="GHIJ" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." - qualifier="FIL" scope="FIL" language="java" path="src/org/struts/RequestContext.java" root_id="3" - description="[null]" enabled="[false]" copy_resource_id="[null]" person_id="[null]" deprecated_kee="[null]" + qualifier="FIL" scope="FIL" language="java" path="src/org/struts/RequestContext.java" root_uuid="uuid_3" + description="[null]" enabled="[false]" copy_component_uuid="[null]" developer_uuid="[null]" deprecated_kee="[null]" authorization_updated_at="123456789" created_at="2014-06-18" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/multi-modules.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/multi-modules.xml index 81f5bde319d..a60d785a90a 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/multi-modules.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/multi-modules.xml @@ -1,57 +1,57 @@ <dataset> <!-- root project --> - <projects id="1" root_id="[null]" kee="org.struts:struts" name="Struts" + <projects id="1" root_uuid="ABCD" kee="org.struts:struts" name="Struts" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." scope="PRJ" qualifier="TRK" long_name="Apache Struts" description="the description" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="[null]"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="[null]"/> <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" islast="[true]" scope="PRJ" qualifier="TRK"/> <snapshots id="10" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" islast="[false]" scope="PRJ" qualifier="TRK"/> <!-- module --> - <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" + <projects id="2" root_uuid="ABCD" kee="org.struts:struts-core" name="Struts Core" uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD.EFGH." scope="PRJ" qualifier="BRC" long_name="Struts Core" description="[null]" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="2" component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1" islast="[true]" scope="PRJ" qualifier="BRC"/> <!-- sub module --> - <projects id="3" root_id="1" kee="org.struts:struts-data" name="Struts Data" + <projects id="3" root_uuid="ABCD" kee="org.struts:struts-data" name="Struts Data" uuid="FGHI" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH.FGHI." scope="PRJ" qualifier="BRC" long_name="Struts Data" description="[null]" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="3" component_uuid="FGHI" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1" islast="[true]" scope="PRJ" qualifier="BRC"/> <!-- directory --> - <projects id="4" root_id="3" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts" + <projects id="4" root_uuid="FGHI" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts" uuid="GHIJ" project_uuid="ABCD" module_uuid="FGHI" module_uuid_path=".ABCD.EFGH.FGHI." name="src/org/struts" long_name="org.struts" description="[null]" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="src/org/struts" authorization_updated_at="[null]"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts" authorization_updated_at="[null]"/> <snapshots id="4" component_uuid="GHIJ" parent_snapshot_id="3" root_component_uuid="ABCD" root_snapshot_id="1" islast="[true]" scope="DIR" qualifier="DIR"/> <!-- file --> - <projects id="5" root_id="3" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java" + <projects id="5" root_uuid="FGHI" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java" uuid="HIJK" project_uuid="ABCD" module_uuid="FGHI" module_uuid_path=".ABCD.EFGH.FGHI." name="RequestContext.java" long_name="org.struts.RequestContext" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> <snapshots id="5" component_uuid="HIJK" parent_snapshot_id="4" root_component_uuid="ABCD" root_snapshot_id="1" islast="[true]" scope="FIL" qualifier="FIL"/> <!-- removed sub module --> - <projects id="10" root_id="1" kee="org.struts:struts-data-removed" name="Struts Data Removed" + <projects id="10" root_uuid="ABCD" kee="org.struts:struts-data-removed" name="Struts Data Removed" uuid="IHGF" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH.IHGF." scope="PRJ" qualifier="BRC" long_name="Struts Data" description="[null]" - enabled="[false]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> + enabled="[false]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <!-- removed directory --> - <projects id="11" root_id="10" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts-removed" + <projects id="11" root_uuid="IHGF" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts-removed" uuid="JIHG" project_uuid="ABCD" module_uuid="FGHI" module_uuid_path=".ABCD.EFGH.IHGF." name="src/org/struts" long_name="org.struts" description="[null]" - enabled="[false]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="src/org/struts" authorization_updated_at="[null]"/> + enabled="[false]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts" authorization_updated_at="[null]"/> <!-- removed file --> - <projects id="12" root_id="10" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContextRemoved.java" + <projects id="12" root_uuid="IHGF" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContextRemoved.java" uuid="KJIH" project_uuid="ABCD" module_uuid="FGHI" module_uuid_path=".ABCD.EFGH.IHGF." name="RequestContext.java" long_name="org.struts.RequestContext" description="[null]" - enabled="[false]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> + enabled="[false]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_ghost_projects.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_ghost_projects.xml index c7ad5d723ec..934d4757f1f 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_ghost_projects.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_ghost_projects.xml @@ -4,16 +4,16 @@ <group_roles id="1" group_id="[null]" resource_id="1" role="user"/> <!-- Ghost project --> - <projects id="42" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.ghost.project" name="Ghost Project" + <projects id="42" root_uuid="PPAA" scope="PRJ" qualifier="TRK" kee="org.ghost.project" name="Ghost Project" uuid="PPAA" project_uuid="PPAA" module_uuid="[null]" module_uuid_path="." description="the description" long_name="Ghost Project" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> <!-- root project --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" deprecated_kee="org.struts:struts" name="Struts" + <projects id="1" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="org.struts:struts" deprecated_kee="org.struts:struts" name="Struts" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." description="the description" long_name="Apache Struts" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -43,10 +43,10 @@ version="[null]" path=""/> <!-- module --> - <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" + <projects id="2" root_uuid="ABCD" kee="org.struts:struts-core" name="Struts Core" uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD.EFGH." scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> + description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="2" component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -60,9 +60,9 @@ <!-- directory --> <projects long_name="org.struts" id="3" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts" uuid="GHIJ" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." - name="src/org/struts" root_id="2" + name="src/org/struts" root_uuid="EFGH" description="[null]" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="src/org/struts" authorization_updated_at="[null]"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts" authorization_updated_at="[null]"/> <snapshots id="3" component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -76,9 +76,9 @@ <!-- file --> <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java" uuid="KLMN" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." - name="RequestContext.java" root_id="2" + name="RequestContext.java" root_uuid="EFGH" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> <snapshots id="4" component_uuid="KLMN" parent_snapshot_id="3" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" @@ -91,19 +91,19 @@ version="[null]" path="1.2.3."/> <!-- Disabled projects --> - <projects id="10" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.disabled.project" name="Disabled Project" + <projects id="10" root_uuid="DCBA" scope="PRJ" qualifier="TRK" kee="org.disabled.project" name="Disabled Project" uuid="DCBA" project_uuid="DCBA" module_uuid="[null]" module_uuid_path="." description="the description" long_name="Disabled project" - enabled="[false]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/> + enabled="[false]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> <!-- Developer and technical project copy --> - <projects id="11" root_id="[null]" scope="PRJ" qualifier="DEV" kee="DEV:anakin@skywalker.name" name="Anakin Skywalker" + <projects id="11" root_uuid="OPQR" scope="PRJ" qualifier="DEV" kee="DEV:anakin@skywalker.name" name="Anakin Skywalker" uuid="OPQR" project_uuid="OPQR" module_uuid="[null]" module_uuid_path=".OPQR." description="the description" long_name="Anakin Skywalker" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/> - <projects id="12" root_id="11" scope="PRJ" qualifier="DEV_PRJ" kee="DEV:anakin@skywalker.name:org.struts:struts" name="Apache Struts" + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> + <projects id="12" root_uuid="OPQR" scope="PRJ" qualifier="DEV_PRJ" kee="DEV:anakin@skywalker.name:org.struts:struts" name="Apache Struts" uuid="STUV" project_uuid="OPQR" module_uuid="OPQR" module_uuid_path=".OPQR." description="the description" long_name="Apache Struts" - enabled="[true]" language="[null]" copy_resource_id="1" person_id="11" path="[null]" authorization_updated_at="123456789"/> + enabled="[true]" language="[null]" copy_component_uuid="ABCD" developer_uuid="OPQR" path="[null]" authorization_updated_at="123456789"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_module_files_tree.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_module_files_tree.xml index 703f88968ac..7aab8b98265 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_module_files_tree.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_module_files_tree.xml @@ -1,23 +1,23 @@ <dataset> <!-- root project --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="1" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." description="the description" long_name="Apache Struts" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="[null]"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="[null]"/> <!-- module --> - <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" + <projects id="2" root_uuid="ABCD" kee="org.struts:struts-core" name="Struts Core" uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD.EFGH." scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> + description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <!-- file attached directly on module --> <projects id="3" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:pom.xml" uuid="EFGHI" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." - name="pom.xml" long_name="pom.xml" root_id="3" + name="pom.xml" long_name="pom.xml" root_uuid="EFGHI" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/pom.xml" authorization_updated_at="[null]"/> + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts/pom.xml" authorization_updated_at="[null]"/> <file_sources id="101" project_uuid="ABCD" file_uuid="EFGHI" binary_data=",,,,,,,,,,,,,,,unchanged ,,,,,,,,,,,,,,,content " @@ -27,24 +27,24 @@ created_at="1412952242000" updated_at="1412952242000" data_type="SOURCE"/> <!-- sub module --> - <projects id="4" root_id="1" kee="org.struts:struts-data" name="Struts Data" + <projects id="4" root_uuid="ABCD" kee="org.struts:struts-data" name="Struts Data" uuid="FGHI" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH.FGHI." scope="PRJ" qualifier="BRC" long_name="Struts Data" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> + description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <!-- directory --> <projects id="5" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts" uuid="GHIJ" project_uuid="ABCD" module_uuid="FGHI" module_uuid_path=".ABCD.EFGH.FGHI." - name="src/org/struts" long_name="org.struts" root_id="3" + name="src/org/struts" long_name="org.struts" root_uuid="EFGHI" description="[null]" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="src/org/struts" authorization_updated_at="[null]"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts" authorization_updated_at="[null]"/> <!-- file --> <projects id="6" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java" uuid="HIJK" project_uuid="ABCD" module_uuid="FGHI" module_uuid_path=".ABCD.EFGH.FGHI." - name="RequestContext.java" long_name="org.struts.RequestContext" root_id="3" + name="RequestContext.java" long_name="org.struts.RequestContext" root_uuid="EFGHI" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> <file_sources id="102" project_uuid="ABCD" file_uuid="HIJK" binary_data=",,,,,,,,,,,,,,,unchanged ,,,,,,,,,,,,,,,content " diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_provisioned_projects.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_provisioned_projects.xml index 2e2ae8bad5c..cae57657d27 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_provisioned_projects.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_provisioned_projects.xml @@ -4,16 +4,16 @@ <group_roles id="1" group_id="[null]" resource_id="1" role="user"/> <!-- Provisioned project --> - <projects id="42" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.provisioned.project" name="Provisioned Project" + <projects id="42" root_uuid="PPAA" scope="PRJ" qualifier="TRK" kee="org.provisioned.project" name="Provisioned Project" uuid="PPAA" project_uuid="PPAA" module_uuid="[null]" module_uuid_path="." description="the description" long_name="Provisioned Project" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> <!-- root project --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" deprecated_kee="org.struts:struts" name="Struts" + <projects id="1" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="org.struts:struts" deprecated_kee="org.struts:struts" name="Struts" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." description="the description" long_name="Apache Struts" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -34,10 +34,10 @@ version="[null]" path=""/> <!-- module --> - <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" + <projects id="2" root_uuid="ABCD" kee="org.struts:struts-core" name="Struts Core" uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD.EFGH." scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> + description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="2" component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -51,9 +51,9 @@ <!-- directory --> <projects long_name="org.struts" id="3" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts" uuid="GHIJ" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." - name="src/org/struts" root_id="2" + name="src/org/struts" root_uuid="EFGH" description="[null]" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="src/org/struts" authorization_updated_at="[null]"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts" authorization_updated_at="[null]"/> <snapshots id="3" component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -67,9 +67,9 @@ <!-- file --> <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java" uuid="KLMN" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." - name="RequestContext.java" root_id="2" + name="RequestContext.java" root_uuid="EFGH" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> <snapshots id="4" component_uuid="KLMN" parent_snapshot_id="3" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" @@ -82,19 +82,19 @@ version="[null]" path="1.2.3."/> <!-- Disabled projects --> - <projects id="10" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.disabled.project" name="Disabled Project" + <projects id="10" root_uuid="DCBA" scope="PRJ" qualifier="TRK" kee="org.disabled.project" name="Disabled Project" uuid="DCBA" project_uuid="DCBA" module_uuid="[null]" module_uuid_path="." description="the description" long_name="Disabled project" - enabled="[false]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/> + enabled="[false]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> <!-- Developer and technical project copy --> - <projects id="11" root_id="[null]" scope="PRJ" qualifier="DEV" kee="DEV:anakin@skywalker.name" name="Anakin Skywalker" + <projects id="11" root_uuid="OPQR" scope="PRJ" qualifier="DEV" kee="DEV:anakin@skywalker.name" name="Anakin Skywalker" uuid="OPQR" project_uuid="OPQR" module_uuid="[null]" module_uuid_path=".OPQR." description="the description" long_name="Anakin Skywalker" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/> - <projects id="12" root_id="11" scope="PRJ" qualifier="DEV_PRJ" kee="DEV:anakin@skywalker.name:org.struts:struts" name="Apache Struts" + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> + <projects id="12" root_uuid="OPQR" scope="PRJ" qualifier="DEV_PRJ" kee="DEV:anakin@skywalker.name:org.struts:struts" name="Apache Struts" uuid="STUV" project_uuid="OPQR" module_uuid="OPQR" module_uuid_path=".OPQR." description="the description" long_name="Apache Struts" - enabled="[true]" language="[null]" copy_resource_id="1" person_id="11" path="[null]" authorization_updated_at="123456789"/> + enabled="[true]" language="[null]" copy_component_uuid="ABCD" developer_uuid="OPQR" path="[null]" authorization_updated_at="123456789"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared.xml index adaa8d388ef..5fd182fab66 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared.xml @@ -5,10 +5,10 @@ <!-- root project --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" deprecated_kee="org.struts:struts" name="Struts" + <projects id="1" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="org.struts:struts" deprecated_kee="org.struts:struts" name="Struts" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." description="the description" long_name="Apache Struts" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -29,10 +29,10 @@ version="[null]" path=""/> <!-- module --> - <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" + <projects id="2" root_uuid="ABCD" kee="org.struts:struts-core" name="Struts Core" uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD.EFGH." scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/> + description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="2" component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -46,9 +46,9 @@ <!-- directory --> <projects long_name="org.struts" id="3" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts" uuid="GHIJ" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." - name="src/org/struts" root_id="2" + name="src/org/struts" root_uuid="EFGH" description="[null]" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="src/org/struts" authorization_updated_at="[null]"/> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts" authorization_updated_at="[null]"/> <snapshots id="3" component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -62,9 +62,9 @@ <!-- file --> <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java" uuid="KLMN" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." - name="RequestContext.java" root_id="2" + name="RequestContext.java" root_uuid="EFGH" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> <snapshots id="4" component_uuid="KLMN" parent_snapshot_id="3" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" @@ -77,19 +77,19 @@ version="[null]" path="1.2.3."/> <!-- Disabled projects --> - <projects id="10" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.disabled.project" name="Disabled Project" + <projects id="10" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="org.disabled.project" name="Disabled Project" uuid="DCBA" project_uuid="DCBA" module_uuid="[null]" module_uuid_path="." description="the description" long_name="Disabled project" - enabled="[false]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/> + enabled="[false]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> <!-- Developer and technical project copy --> - <projects id="11" root_id="[null]" scope="PRJ" qualifier="DEV" kee="DEV:anakin@skywalker.name" name="Anakin Skywalker" + <projects id="11" root_uuid="OPQR" scope="PRJ" qualifier="DEV" kee="DEV:anakin@skywalker.name" name="Anakin Skywalker" uuid="OPQR" project_uuid="OPQR" module_uuid="[null]" module_uuid_path=".OPQR." description="the description" long_name="Anakin Skywalker" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="123456789"/> - <projects id="12" root_id="11" scope="PRJ" qualifier="DEV_PRJ" kee="DEV:anakin@skywalker.name:org.struts:struts" name="Apache Struts" + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> + <projects id="12" root_uuid="OPQR" scope="PRJ" qualifier="DEV_PRJ" kee="DEV:anakin@skywalker.name:org.struts:struts" name="Apache Struts" uuid="STUV" project_uuid="OPQR" module_uuid="OPQR" module_uuid_path=".OPQR." description="the description" long_name="Apache Struts" - enabled="[true]" language="[null]" copy_resource_id="1" person_id="11" path="[null]" authorization_updated_at="123456789"/> + enabled="[true]" language="[null]" copy_component_uuid="ABCD" developer_uuid="OPQR" path="[null]" authorization_updated_at="123456789"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared_views.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared_views.xml index 1eca3522d69..3f62fc3ad78 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared_views.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared_views.xml @@ -1,35 +1,35 @@ <dataset> <!-- Simple View --> - <projects id="10" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." copy_resource_id="[null]" enabled="[true]" + <projects id="10" uuid="ABCD" root_uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." copy_component_uuid="[null]" enabled="[true]" kee="MASTER_PROJECT" scope="PRJ" qualifier="VW" name="All projects" path="[null]"/> - <projects id="110" uuid="BCDE" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." copy_resource_id="100" enabled="[true]" + <projects id="110" uuid="BCDE" root_uuid="ABCD" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." copy_component_uuid="JKLM" enabled="[true]" kee="MASTER_PROJECTorg.struts:struts" scope="FIL" qualifier="TRK" name="Struts" path="[null]"/> <!-- View with sub view --> - <projects id="11" uuid="EFGH" project_uuid="EFGH" module_uuid="[null]" module_uuid_path=".EFGH." copy_resource_id="[null]" enabled="[true]" + <projects id="11" uuid="EFGH" root_uuid="EFGH" project_uuid="EFGH" module_uuid="[null]" module_uuid_path=".EFGH." copy_component_uuid="[null]" enabled="[true]" kee="LANGUAGE_VIEW" scope="PRJ" qualifier="VW" name="By Language" path="[null]"/> - <projects id="112" uuid="GHIJ" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_resource_id="101" enabled="[true]" + <projects id="112" uuid="GHIJ" root_uuid="EFGH" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_component_uuid="KLMN" enabled="[true]" kee="VIEW2org.elasticsearch:elasticsearch" scope="FIL" qualifier="TRK" name="SSLR" path="[null]"/> <!-- Sub view --> - <projects id="13" uuid="FGHI" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH.FGHI." copy_resource_id="[null]" enabled="[true]" + <projects id="13" uuid="FGHI" root_uuid="FGHI" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH.FGHI." copy_component_uuid="[null]" enabled="[true]" kee="JAVA_PROJECTS" scope="PRJ" qualifier="SVW" name="Java projects" path="[null]"/> - <projects id="113" uuid="HIJK" project_uuid="EFGH" module_uuid="FGHI" module_uuid_path=".EFGH.FGHI." copy_resource_id="100" enabled="[true]" + <projects id="113" uuid="HIJK" root_uuid="EFGH" project_uuid="EFGH" module_uuid="FGHI" module_uuid_path=".EFGH.FGHI." copy_component_uuid="JKLM" enabled="[true]" kee="VIEW2org.struts:struts" scope="FIL" qualifier="TRK" name="Struts" path="[null]"/> <!-- View without project --> - <projects id="14" uuid="IJKL" project_uuid="IJKL" module_uuid="[null]" module_uuid_path=".IJKL." copy_resource_id="[null]" enabled="[true]" + <projects id="14" uuid="IJKL" root_uuid="IJKL" project_uuid="IJKL" module_uuid="[null]" module_uuid_path=".IJKL." copy_component_uuid="[null]" enabled="[true]" kee="OTHER" scope="PRJ" qualifier="VW" name="Other projects" path="[null]"/> <!-- Real projects --> - <projects id="100" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" - uuid="JKLM" project_uuid="JKLM" module_uuid="[null]" module_uuid_path=".JKLM." - enabled="[true]" copy_resource_id="[null]" path="[null]"/> - <projects id="101" scope="PRJ" qualifier="TRK" kee="org.elasticsearch:elasticsearch" name="Elasticsearch" - uuid="KLMN" project_uuid="KLMN" module_uuid="[null]" module_uuid_path=".KLMN." - enabled="[true]" copy_resource_id="[null]" path="[null]"/> + <projects id="100" uuid="JKLM" root_uuid="JKLM" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + project_uuid="JKLM" module_uuid="[null]" module_uuid_path=".JKLM." + enabled="[true]" copy_component_uuid="[null]" path="[null]"/> + <projects id="101" uuid="KLMN" root_uuid="KLMN" scope="PRJ" qualifier="TRK" kee="org.elasticsearch:elasticsearch" name="Elasticsearch" + project_uuid="KLMN" module_uuid="[null]" module_uuid_path=".KLMN." + enabled="[true]" copy_component_uuid="[null]" path="[null]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/update-result.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/update-result.xml index 62196600389..6a23654e9ff 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/update-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/update-result.xml @@ -3,8 +3,8 @@ <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext2.java" deprecated_kee="org.struts:struts-core:src/org/struts/RequestContext2.java" name="RequestContext2.java" long_name="org.struts.RequestContext2" uuid="GHIJ" project_uuid="DCBA" module_uuid="HGFE" module_uuid_path=".DCBA.HGFE." - qualifier="LIF" scope="LIF" language="java2" path="src/org/struts/RequestContext2.java" root_id="4" - description="description2" enabled="[false]" copy_resource_id="6" person_id="9" + qualifier="LIF" scope="LIF" language="java2" path="src/org/struts/RequestContext2.java" root_uuid="uuid_4" + description="description2" enabled="[false]" copy_component_uuid="uuid_6" developer_uuid="uuid_9" authorization_updated_at="12345678910" created_at="2014-06-18" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/update.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/update.xml index fe171ca4441..68b1156822d 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/update.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/update.xml @@ -3,8 +3,8 @@ <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" deprecated_kee="org.struts:struts-core:src/org/struts/RequestContext.java" name="RequestContext.java" long_name="org.struts.RequestContext" uuid="GHIJ" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." - qualifier="FIL" scope="FIL" language="java" path="src/org/struts/RequestContext.java" root_id="3" - description="description" enabled="[true]" copy_resource_id="5" person_id="[null]" + qualifier="FIL" scope="FIL" language="java" path="src/org/struts/RequestContext.java" root_uuid="uuid_3" + description="description" enabled="[true]" copy_component_uuid="uuid_5" developer_uuid="[null]" authorization_updated_at="123456789" created_at="2014-06-18" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoWithDuplicatedKeysTest/schema.sql b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoWithDuplicatedKeysTest/schema.sql index 5b314d137e7..7a309ca3e32 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoWithDuplicatedKeysTest/schema.sql +++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoWithDuplicatedKeysTest/schema.sql @@ -1,12 +1,12 @@ CREATE TABLE "PROJECTS" ( "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), "KEE" VARCHAR(400), - "ROOT_ID" INTEGER, - "UUID" VARCHAR(50), + "UUID" VARCHAR(50) NOT NULL, + "ROOT_UUID" VARCHAR(50) NOT NULL, "PROJECT_UUID" VARCHAR(50), "MODULE_UUID" VARCHAR(50), "MODULE_UUID_PATH" VARCHAR(4000), - "NAME" VARCHAR(256), + "NAME" VARCHAR(2000), "DESCRIPTION" VARCHAR(2000), "ENABLED" BOOLEAN NOT NULL DEFAULT TRUE, "SCOPE" VARCHAR(3), @@ -14,16 +14,16 @@ CREATE TABLE "PROJECTS" ( "DEPRECATED_KEE" VARCHAR(400), "PATH" VARCHAR(2000), "LANGUAGE" VARCHAR(20), - "COPY_RESOURCE_ID" INTEGER, - "LONG_NAME" VARCHAR(256), - "PERSON_ID" INTEGER, + "COPY_COMPONENT_UUID" VARCHAR(50), + "LONG_NAME" VARCHAR(2000), + "DEVELOPER_UUID" VARCHAR(50), "CREATED_AT" TIMESTAMP, "AUTHORIZATION_UPDATED_AT" BIGINT ); CREATE INDEX "PROJECTS_KEE" ON "PROJECTS" ("KEE"); -CREATE INDEX "PROJECTS_ROOT_ID" ON "PROJECTS" ("ROOT_ID"); +CREATE INDEX "PROJECTS_ROOT_UUID" ON "PROJECTS" ("ROOT_UUID"); CREATE UNIQUE INDEX "PROJECTS_UUID" ON "PROJECTS" ("UUID"); diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture-including-ghost-projects-and-technical-project.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture-including-ghost-projects-and-technical-project.xml index 490e8fa0cbe..958c16c1150 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture-including-ghost-projects-and-technical-project.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture-including-ghost-projects-and-technical-project.xml @@ -1,10 +1,10 @@ <dataset> <!-- root project --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="1" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" description="the description" long_name="Apache Struts" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" @@ -26,10 +26,10 @@ version="[null]" path=""/> <!-- project --> - <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" + <projects id="2" root_uuid="ABCD" kee="org.struts:struts-core" name="Struts Core" scope="PRJ" qualifier="BRC" long_name="Struts Core" uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + description="[null]" enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="2" component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" @@ -43,10 +43,10 @@ <!-- directory --> <projects long_name="org.struts" id="3" scope="DIR" qualifier="PAC" kee="org.struts:struts:org.struts" - name="org.struts" root_id="1" + name="org.struts" root_uuid="ABCD" description="[null]" uuid="GHIJ" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="3" component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" @@ -61,10 +61,10 @@ <!-- file --> <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="CLA" kee="org.struts:struts:org.struts.RequestContext" - name="RequestContext" root_id="1" + name="RequestContext" root_uuid="ABCD" uuid="KLMN" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="4" component_uuid="KLMN" parent_snapshot_id="3" root_component_uuid="ABCD" root_snapshot_id="1" @@ -78,16 +78,16 @@ version="[null]" path="1.2.3."/> <!-- technical project --> - <projects id="5" root_id="[null]" scope="PRJ" qualifier="TRK" kee="COPYorg.struts:struts" name="Struts" + <projects id="5" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="COPYorg.struts:struts" name="Struts" uuid="TECHPROJECT" project_uuid="[null]" module_uuid="[null]" module_uuid_path="." description="the description" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="1" person_id="[null]" authorization_updated_at="[null]"/> + enabled="[true]" language="java" copy_component_uuid="ABCD" developer_uuid="[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" + <projects id="6" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="org.apache.shindig" name="Shinding" uuid="ONLYERRORS" project_uuid="[null]" module_uuid="[null]" module_uuid_path="." description="the description" long_name="Shinding" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"/> <snapshots id="6" component_uuid="ONLYERRORS" parent_snapshot_id="[null]" root_component_uuid="ONLYERRORS" root_snapshot_id="[null]" status="U" islast="[false]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -109,17 +109,17 @@ <!-- project without snapshot --> - <projects id="7" root_id="[null]" kee="org.sample:sample" name="Sample" + <projects id="7" root_uuid="ABCD" kee="org.sample:sample" name="Sample" scope="PRJ" qualifier="TRK" long_name="Sample" uuid="NOSNAPSHOT" project_uuid="[null]" module_uuid="[null]" module_uuid_path="." - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + description="[null]" enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <!-- project not enabled --> - <projects id="8" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.apache:tika" name="Tika" + <projects id="8" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="org.apache:tika" name="Tika" description="the description" long_name="Tika" uuid="DISABLED" project_uuid="[null]" module_uuid="[null]" module_uuid_path="." - enabled="[false]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[false]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"/> <snapshots id="8" component_uuid="DISABLED" parent_snapshot_id="[null]" root_component_uuid="DISABLED" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture.xml index 98acd8645c7..d4133fab3b5 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture.xml @@ -5,10 +5,10 @@ <!-- root project --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="1" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" created_at="2008-12-02" authorization_updated_at="123456789"/> <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" @@ -30,10 +30,10 @@ version="[null]" path=""/> <!-- module --> - <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" + <projects id="2" root_uuid="ABCD" kee="org.struts:struts-core" name="Struts Core" uuid="BCDE" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." 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_component_uuid="[null]" developer_uuid="[null]" created_at="2008-12-02" authorization_updated_at="[null]"/> <snapshots id="2" component_uuid="BCDE" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" @@ -48,9 +48,9 @@ <!-- directory --> <projects long_name="org.struts" id="3" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts" uuid="CDEF" project_uuid="ABCD" module_uuid="BCDE" module_uuid_path=".ABCD.BCDE." - name="src/org/struts" root_id="2" + name="src/org/struts" root_uuid="BCDE" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts" created_at="2008-12-02" authorization_updated_at="[null]"/> <snapshots id="3" component_uuid="CDEF" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[true]" purge_status="[null]" @@ -66,9 +66,9 @@ <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java" uuid="DEFG" project_uuid="ABCD" module_uuid="BCDE" module_uuid_path=".ABCD.BCDE." - name="RequestContext.java" root_id="2" + name="RequestContext.java" root_uuid="BCDE" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts/RequestContext.java" created_at="2008-12-02" authorization_updated_at="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/update_authorization_date-result.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/update_authorization_date-result.xml index a6abf2fab1b..95b4c5b19cc 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/update_authorization_date-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/update_authorization_date-result.xml @@ -1,9 +1,9 @@ <dataset> - <projects id="1" root_id="200" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." + <projects id="1" root_uuid="uuid_200" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." 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" + enabled="[false]" language="old" copy_component_uuid="uuid_2" developer_uuid="uuid_3" created_at="[null]" path="/old/foo/bar" deprecated_kee="old deprecated key" authorization_updated_at="987654321"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/update_authorization_date.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/update_authorization_date.xml index 69e73cdb6df..239dcf719b1 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/update_authorization_date.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/update_authorization_date.xml @@ -1,9 +1,9 @@ <dataset> - <projects id="1" root_id="200" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." + <projects id="1" root_uuid="uuid_200" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." 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" + enabled="[false]" language="old" copy_component_uuid="uuid_2" developer_uuid="uuid_3" created_at="[null]" path="/old/foo/bar" deprecated_kee="old deprecated key" authorization_updated_at="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/select_project_ids_from_query_and_view_or_sub_view_uuid.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/select_project_ids_from_query_and_view_or_sub_view_uuid.xml index e0cc9bc51f3..221eb458280 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/select_project_ids_from_query_and_view_or_sub_view_uuid.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/select_project_ids_from_query_and_view_or_sub_view_uuid.xml @@ -1,15 +1,15 @@ <dataset>IncreasePrecisionOfNumericsTest.update_column_types:48 <!-- Real projects --> - <projects id="1" uuid="ABCD" project_uuid="ABCD" module_uuid_path=".ABCD." kee="project-one" copy_resource_id="[null]" name="Project One" qualifier="TRK" scope="PRJ"/> - <projects id="2" uuid="BCDE" project_uuid="BCDE" module_uuid_path=".BCDE." kee="project-two" copy_resource_id="[null]" name="Project Two" qualifier="TRK" scope="PRJ"/> + <projects id="1" uuid="ABCD" root_uuid="ABCD" project_uuid="ABCD" module_uuid_path=".ABCD." kee="project-one" copy_component_uuid="[null]" name="Project One" qualifier="TRK" scope="PRJ"/> + <projects id="2" uuid="BCDE" root_uuid="BCDE" project_uuid="BCDE" module_uuid_path=".BCDE." kee="project-two" copy_component_uuid="[null]" name="Project Two" qualifier="TRK" scope="PRJ"/> <!-- Copy projects --> - <projects id="3" uuid="CDEF" project_uuid="EFGH" module_uuid_path=".EFGH." kee="copy-project-one" copy_resource_id="1" name="Copy Project One" qualifier="TRK" scope="FIL"/> - <projects id="4" uuid="DEFG" project_uuid="EFGH" module_uuid_path=".EFGH." kee="copy-project-two" copy_resource_id="2" name="Copy Project One" qualifier="TRK" scope="FIL"/> + <projects id="3" uuid="CDEF" root_uuid="EFGH" project_uuid="EFGH" module_uuid_path=".EFGH." kee="copy-project-one" copy_component_uuid="ABCD" name="Copy Project One" qualifier="TRK" scope="FIL"/> + <projects id="4" uuid="DEFG" root_uuid="EFGH" project_uuid="EFGH" module_uuid_path=".EFGH." kee="copy-project-two" copy_component_uuid="BCDE" name="Copy Project One" qualifier="TRK" scope="FIL"/> <!-- View containing all projects --> - <projects id="5" uuid="EFGH" project_uuid="EFGH" module_uuid_path=".EFGH." kee="all-projects" copy_resource_id="[null]" name="All projects" qualifier="VW" scope="PRJ"/> + <projects id="5" uuid="EFGH" root_uuid="EFGH" project_uuid="EFGH" module_uuid_path=".EFGH." kee="all-projects" copy_component_uuid="[null]" name="All projects" qualifier="VW" scope="PRJ"/> <resource_index id="1" kee="project one" component_uuid="ABCD" root_component_uuid="ABCD" position="0" name_size="11" qualifier="TRK"/> <resource_index id="2" kee="roject one" component_uuid="ABCD" root_component_uuid="ABCD" position="1" name_size="11" qualifier="TRK"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject.xml index d88fef9f1b4..ff0f36d95e6 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject.xml @@ -3,29 +3,29 @@ <!-- project "struts" -> module "struts-core" -> package org.struts -> file "RequestContext" --> <projects long_name="[null]" id="1" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." - root_id="[null]" + root_uuid="ABCD" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" /> <projects long_name="[null]" id="2" scope="PRJ" qualifier="BRC" kee="org.struts:struts-core" name="Struts Core" uuid="BCDE" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." - root_id="1" + root_uuid="ABCD" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" /> <!-- note that the root_id of package/file is wrong. It references the module but not the root project --> <projects long_name="org.struts" id="3" scope="DIR" qualifier="PAC" kee="org.struts:struts-core:org.struts" uuid="CDEF" project_uuid="ABCD" module_uuid="BCDE" module_uuid_path=".ABCD.BCDE" - name="org.struts" root_id="2" + name="org.struts" root_uuid="BCDE" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" /> <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="CLA" uuid="DEFG" project_uuid="ABCD" module_uuid="BCDE" module_uuid_path=".ABCD.BCDE" kee="org.struts:struts-core:org.struts.RequestContext" - name="RequestContext" root_id="2" + name="RequestContext" root_uuid="BCDE" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" /> <snapshots purge_status="[null]" id="1" islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD"/> <snapshots purge_status="[null]" id="2" islast="[true]" root_component_uuid="ABCD" component_uuid="BCDE"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldNotIndexPackages.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldNotIndexPackages.xml index 1072f211a68..7e76208a0ee 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldNotIndexPackages.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldNotIndexPackages.xml @@ -3,24 +3,24 @@ <!-- project --> <projects long_name="[null]" id="1" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." - root_id="[null]" + root_uuid="ABCD" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" /> <!-- directory --> <projects long_name="org.struts" id="2" scope="DIR" qualifier="PAC" kee="org.struts:struts:org.struts" uuid="BCDE" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." - name="org.struts" root_id="1" + name="org.struts" root_uuid="ABCD" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" /> <!-- file --> <projects long_name="org.struts.RequestContext" id="3" scope="FIL" qualifier="CLA" kee="org.struts:struts:org.struts.RequestContext" uuid="CDEF" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." - name="RequestContext" root_id="1" + name="RequestContext" root_uuid="1" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" /> <snapshots purge_status="[null]" id="1" islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD" scope="PRJ" qualifier="TRK"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReIndexNewTwoLettersLongResource.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReIndexNewTwoLettersLongResource.xml index 268953293f7..1c7036cd095 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReIndexNewTwoLettersLongResource.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReIndexNewTwoLettersLongResource.xml @@ -2,9 +2,9 @@ <projects long_name="[null]" id="1" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="AS" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." - root_id="[null]" + root_uuid="ABCD" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java"/> <snapshots purge_status="[null]" id="1" islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD" scope="PRJ" qualifier="TRK"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReIndexTwoLettersLongResource.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReIndexTwoLettersLongResource.xml index 5b1c5fa7a1a..c7faa7de4ce 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReIndexTwoLettersLongResource.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReIndexTwoLettersLongResource.xml @@ -2,9 +2,9 @@ <projects long_name="[null]" id="1" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="AS" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." - root_id="[null]" + root_uuid="ABCD" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" /> <snapshots purge_status="[null]" id="1" islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD" scope="PRJ" qualifier="TRK"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReindexProjectAfterRenaming.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReindexProjectAfterRenaming.xml index e00a7602607..6b1066004b3 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReindexProjectAfterRenaming.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReindexProjectAfterRenaming.xml @@ -2,9 +2,9 @@ <projects long_name="[null]" id="1" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Apache Struts" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." - root_id="[null]" + root_uuid="ABCD" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" /> <snapshots purge_status="[null]" id="1" islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD" scope="PRJ" qualifier="TRK"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shared.xml index 400243b4d19..9e8d45b55c0 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shared.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shared.xml @@ -1,71 +1,71 @@ <dataset> <!-- root project --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="A" + <projects id="1" root_uuid="A" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="A" project_uuid="A" module_uuid="[null]" module_uuid_path="." description="[null]" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="B" project_uuid="A" + <projects id="2" root_uuid="A" kee="org.struts:struts-core" name="Struts Core" uuid="B" project_uuid="A" module_uuid="[null]" module_uuid_path=".A." 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" 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" uuid="C" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." + name="org.struts" root_uuid="B" uuid="C" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="D" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." + name="RequestContext" root_uuid="B" uuid="D" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="E" project_uuid="[null]" + <projects id="5" root_uuid="A" kee="org.struts:struts-ui" name="Struts UI" uuid="E" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." scope="PRJ" qualifier="BRC" long_name="Struts UI" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + description="[null]" enabled="[true]" language="java" 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" uuid="F" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." + name="org.struts" root_uuid="E" uuid="F" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="G" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." + name="RequestContext" root_uuid="E" uuid="G" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="H" project_uuid="[null]" + <projects id="8" root_uuid="A" kee="foo:struts-core" name="Foo Struts Core" uuid="H" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".H." scope="PRJ" qualifier="BRC" long_name="Foo Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + description="[null]" enabled="[true]" language="java" created_at="[null]" path="[null]" deprecated_kee="foo:struts-core" authorization_updated_at="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKey-result.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKey-result.xml index 962995f42b6..6227c606fc2 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKey-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKey-result.xml @@ -1,72 +1,72 @@ <dataset> <!-- root project --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.apache.struts:struts" name="Struts" uuid="A" + <projects id="1" root_uuid="A" scope="PRJ" qualifier="TRK" kee="org.apache.struts:struts" name="Struts" uuid="A" project_uuid="A" module_uuid="[null]" module_uuid_path="." description="[null]" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[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" uuid="B" project_uuid="A" + <projects id="2" root_uuid="A" kee="org.apache.struts:struts-core" name="Struts Core" uuid="B" project_uuid="A" module_uuid="[null]" module_uuid_path=".A." 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_component_uuid="[null]" developer_uuid="[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" uuid="C" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." + name="org.struts" root_uuid="B" uuid="C" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[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" uuid="D" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." + name="RequestContext" root_uuid="B" uuid="D" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[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" uuid="E" project_uuid="[null]" + <projects id="5" root_uuid="A" kee="org.apache.struts:struts-ui" name="Struts UI" uuid="E" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." scope="PRJ" qualifier="BRC" long_name="Struts UI" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + description="[null]" enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[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" uuid="F" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." + name="org.struts" root_uuid="E" uuid="F" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[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" uuid="G" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." + name="RequestContext" root_uuid="E" uuid="G" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[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" uuid="H" project_uuid="[null]" + <projects id="8" root_uuid="A" kee="foo:struts-core" name="Foo Struts Core" uuid="H" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".H." scope="PRJ" qualifier="BRC" long_name="Foo Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + description="[null]" enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-core" authorization_updated_at="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml index 81e4290832e..1f15cb2d042 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml @@ -1,71 +1,71 @@ <dataset> <!-- root project --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="A" + <projects id="1" root_uuid="A" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="A" project_uuid="A" module_uuid="[null]" module_uuid_path="." description="[null]" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[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" uuid="B" project_uuid="A" + <projects id="2" root_uuid="A" kee="org.struts:struts-core" name="Struts Core" uuid="B" project_uuid="A" module_uuid="[null]" module_uuid_path=".A." 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_component_uuid="[null]" developer_uuid="[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" uuid="C" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." + name="org.struts" root_uuid="B" uuid="C" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[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" uuid="D" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." + name="RequestContext" root_uuid="B" uuid="D" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[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" uuid="E" project_uuid="[null]" + <projects id="5" root_uuid="A" kee="org.struts:struts-web" name="Struts UI" uuid="E" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." scope="PRJ" qualifier="BRC" long_name="Struts UI" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + description="[null]" enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[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" uuid="F" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." + name="org.struts" root_uuid="E" uuid="F" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[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" uuid="G" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." + name="RequestContext" root_uuid="E" uuid="G" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[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" uuid="H" project_uuid="[null]" + <projects id="8" root_uuid="A" kee="foo:struts-core" name="Foo Struts Core" uuid="H" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".H." scope="PRJ" qualifier="BRC" long_name="Foo Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + description="[null]" enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" created_at="[null]" path="[null]" deprecated_kee="foo:struts-core" authorization_updated_at="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules-result.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules-result.xml index 83686f2ba90..85e1a75fe6c 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules-result.xml @@ -1,63 +1,63 @@ <dataset> <!-- root project --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.apache.struts:struts" name="Struts" uuid="A" + <projects id="1" root_uuid="A" scope="PRJ" qualifier="TRK" kee="org.apache.struts:struts" name="Struts" uuid="A" project_uuid="A" module_uuid="[null]" module_uuid_path="." description="[null]" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[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" uuid="B" project_uuid="A" + <projects id="2" root_uuid="A" kee="org.apache.struts:struts-core" name="Struts Core" uuid="B" project_uuid="A" module_uuid="[null]" module_uuid_path=".A." 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" 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" uuid="C" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." + name="org.struts" root_uuid="B" uuid="C" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="D" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." + name="RequestContext" root_uuid="B" uuid="D" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="E" project_uuid="[null]" module_uuid="[null]" + <projects id="5" root_uuid="A" kee="foo:struts-ui" name="Struts UI" uuid="E" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." scope="PRJ" qualifier="BRC" long_name="Struts UI" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + description="[null]" enabled="[true]" language="java" 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" uuid="F" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." + name="org.struts" root_uuid="E" uuid="F" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="G" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." + name="RequestContext" root_uuid="E" uuid="G" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui:org.struts.RequestContext" authorization_updated_at="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules.xml index 5021b0c56bc..226d5faaa08 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules.xml @@ -1,62 +1,62 @@ <dataset> <!-- root project --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="A" + <projects id="1" root_uuid="A" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="A" project_uuid="A" module_uuid="[null]" module_uuid_path="." description="[null]" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="B" project_uuid="A" + <projects id="2" root_uuid="A" kee="org.struts:struts-core" name="Struts Core" uuid="B" project_uuid="A" module_uuid="[null]" module_uuid_path=".A." 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" 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" uuid="C" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." + name="org.struts" root_uuid="B" uuid="C" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="D" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." + name="RequestContext" root_uuid="B" uuid="D" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="E" project_uuid="[null]" module_uuid="[null]" + <projects id="5" root_uuid="A" kee="foo:struts-ui" name="Struts UI" uuid="E" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." scope="PRJ" qualifier="BRC" long_name="Struts UI" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + description="[null]" enabled="[true]" language="java" 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" uuid="F" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." + name="org.struts" root_uuid="E" uuid="F" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="G" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." + name="RequestContext" root_uuid="E" uuid="G" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" created_at="[null]" path="[null]" deprecated_kee="foo:struts-ui:org.struts.RequestContext" authorization_updated_at="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldUpdateKey-result.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldUpdateKey-result.xml index a7a9d68d42a..b5e560f47e5 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldUpdateKey-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldUpdateKey-result.xml @@ -1,10 +1,10 @@ <dataset> <!-- root project --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="A" + <projects id="1" root_uuid="A" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="A" project_uuid="A" module_uuid="[null]" module_uuid_path="." description="[null]" long_name="Apache Struts" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" created_at="[null]" path="[null]" deprecated_kee="org.struts:struts" authorization_updated_at="[null]"/> @@ -12,62 +12,62 @@ <!-- **************** First sub project **************** --> <!-- ONLY THIS PROJECT MUST HAVE BEEN UPDATED --> <!-- --> - <projects id="2" root_id="1" kee="struts:core" name="Struts Core" uuid="B" project_uuid="A" module_uuid="[null]" + <projects id="2" root_uuid="A" kee="struts:core" name="Struts Core" uuid="B" project_uuid="A" module_uuid="[null]" module_uuid_path=".A." 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" 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" uuid="C" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." + name="org.struts" root_uuid="B" uuid="C" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="D" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." + name="RequestContext" root_uuid="B" uuid="D" project_uuid="A" module_uuid="B" module_uuid_path=".A.B." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="E" project_uuid="[null]" + <projects id="5" root_uuid="A" kee="org.struts:struts-ui" name="Struts UI" uuid="E" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." scope="PRJ" qualifier="BRC" long_name="Struts UI" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + description="[null]" enabled="[true]" language="java" 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" uuid="F" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." + name="org.struts" root_uuid="E" uuid="F" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="G" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." + name="RequestContext" root_uuid="E" uuid="G" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".E." description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="[null]" + enabled="[true]" language="java" 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" uuid="H" project_uuid="[null]" + <projects id="8" root_uuid="A" kee="foo:struts-core" name="Foo Struts Core" uuid="H" project_uuid="[null]" module_uuid="[null]" module_uuid_path=".H." scope="PRJ" qualifier="BRC" long_name="Foo Struts Core" - description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + description="[null]" enabled="[true]" language="java" created_at="[null]" path="[null]" deprecated_kee="foo:struts-core" authorization_updated_at="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/has_last_snapshot_by_component_uuid.xml b/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/has_last_snapshot_by_component_uuid.xml index 3a4404377a3..84aeaa27387 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/has_last_snapshot_by_component_uuid.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/has_last_snapshot_by_component_uuid.xml @@ -1,10 +1,10 @@ <dataset> <!-- Has last snapshot --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="1" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." description="the description" long_name="Apache Struts" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="[null]" /> + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="[null]" /> <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" status="P" islast="[true]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" @@ -25,16 +25,16 @@ version="[null]" path=""/> <!-- No snapshot --> - <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" + <projects id="2" root_uuid="ABCD" kee="org.struts:struts-core" name="Struts Core" uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." scope="PRJ" qualifier="BRC" long_name="Struts Core" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]" /> + description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]" /> <!-- No last snapshot --> - <projects id="3" root_id="1" kee="org.struts:struts-data" name="Struts Data" + <projects id="3" root_uuid="ABCD" kee="org.struts:struts-data" name="Struts Data" uuid="FGHI" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." scope="PRJ" qualifier="BRC" long_name="Struts Data" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]" /> + description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]" /> <snapshots id="3" component_uuid="FGHI" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1" status="P" islast="[false]" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" diff --git a/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_previous_version_snapshots.xml b/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_previous_version_snapshots.xml index 2c4dad9044c..8a2c1fb2f95 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_previous_version_snapshots.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_previous_version_snapshots.xml @@ -1,9 +1,9 @@ <dataset> <projects long_name="[null]" id="1" scope="PRJ" qualifier="TRK" kee="project" name="project" - root_id="[null]" uuid="ABCD" + root_uuid="ABCD" uuid="ABCD" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/> + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"/> <!-- version 1.0 --> <snapshots id="1000" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" diff --git a/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_snapshots_by_query.xml b/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_snapshots_by_query.xml index 8b4cba62605..d0d026f6e4a 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_snapshots_by_query.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_snapshots_by_query.xml @@ -1,10 +1,10 @@ <dataset> <!-- PROJECT_ID = 1 --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="1" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="[null]"/> <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1" @@ -36,10 +36,10 @@ version="2.2-SNAPSHOT" path="1.2."/> <!-- PROJECT_ID = 2 --> - <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" + <projects id="2" root_uuid="ABCD" kee="org.struts:struts-core" name="Struts Core" uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="4" component_uuid="EFGH" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="3" @@ -63,10 +63,10 @@ version="2.1-SNAPSHOT" path="1.2."/> <!-- PROJECT_ID = 3 - no last snapshot --> - <projects id="3" root_id="1" kee="org.struts:struts-data" name="Struts Data" + <projects id="3" root_uuid="ABCD" kee="org.struts:struts-data" name="Struts Data" uuid="FGHI" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="6" component_uuid="FGHI" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="3" @@ -80,10 +80,10 @@ version="2.1-SNAPSHOT" path="1.2."/> <!-- PROJECT_ID = 4 - no snapshot --> - <projects id="4" root_id="1" kee="org.struts:struts-deprecated" name="Struts Deprecated" + <projects id="4" root_uuid="ABCD" kee="org.struts:struts-deprecated" name="Struts Deprecated" uuid="GHIJ" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." scope="PRJ" qualifier="BRC" long_name="Struts Deprecated" - description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" + description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/duplication/DuplicationDaoTest/insert.xml b/sonar-db/src/test/resources/org/sonar/db/duplication/DuplicationDaoTest/insert.xml index 1a168293765..02a6e33afa7 100644 --- a/sonar-db/src/test/resources/org/sonar/db/duplication/DuplicationDaoTest/insert.xml +++ b/sonar-db/src/test/resources/org/sonar/db/duplication/DuplicationDaoTest/insert.xml @@ -2,6 +2,6 @@ <snapshots purge_status="[null]" id="1" status="U" islast="0" component_uuid="0" root_component_uuid="0"/> <snapshots purge_status="[null]" id="2" status="U" islast="0" component_uuid="uuid_1" root_component_uuid="uuid_1"/> - <projects id="1" uuid="uuid_1" kee="foo" enabled="1" scope="FIL" qualifier="CLA"/> + <projects id="1" uuid="uuid_1" root_uuid="uuid_root" kee="foo" enabled="1" scope="FIL" qualifier="CLA"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/duplication/DuplicationDaoTest/select_candidates.xml b/sonar-db/src/test/resources/org/sonar/db/duplication/DuplicationDaoTest/select_candidates.xml index e03ca58794e..d2eca360488 100644 --- a/sonar-db/src/test/resources/org/sonar/db/duplication/DuplicationDaoTest/select_candidates.xml +++ b/sonar-db/src/test/resources/org/sonar/db/duplication/DuplicationDaoTest/select_candidates.xml @@ -2,26 +2,26 @@ <snapshots id="1" component_uuid="uuid_1" status="P" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/> <snapshots id="2" component_uuid="uuid_1" status="P" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/> - <projects id="1" uuid="uuid_1" kee="bar-old" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/> + <projects id="1" uuid="uuid_1" root_uuid="uuid_root" kee="bar-old" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/> <snapshots id="3" component_uuid="uuid_2" status="P" islast="[true]" purge_status="[null]" root_component_uuid="uuid_1"/> <snapshots id="4" component_uuid="uuid_2" status="P" islast="[true]" purge_status="[null]" root_component_uuid="uuid_1"/> - <projects id="2" uuid="uuid_2" kee="bar-last" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/> + <projects id="2" uuid="uuid_2" root_uuid="uuid_root" kee="bar-last" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/> <snapshots id="5" component_uuid="uuid_3" status="P" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/> <snapshots id="6" component_uuid="uuid_3" status="P" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/> - <projects id="3" uuid="uuid_3" kee="foo-old" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/> + <projects id="3" uuid="uuid_3" root_uuid="uuid_root" kee="foo-old" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/> <snapshots id="7" component_uuid="uuid_4" status="P" islast="[true]" purge_status="[null]" root_component_uuid="uuid_1"/> <snapshots id="8" component_uuid="uuid_4" status="P" islast="[true]" purge_status="[null]" root_component_uuid="uuid_1"/> - <projects id="4" uuid="uuid_4" kee="foo-last" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/> + <projects id="4" uuid="uuid_4" root_uuid="uuid_root" kee="foo-last" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/> <snapshots id="9" component_uuid="uuid_5" status="U" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/> <snapshots id="10" component_uuid="uuid_5" status="U" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/> - <projects id="5" uuid="uuid_5" kee="foo" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/> + <projects id="5" uuid="uuid_5" root_uuid="uuid_root" kee="foo" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/> <snapshots id="11" component_uuid="uuid_6" purge_status="[null]" status="P" islast="1" root_component_uuid="uuid_1"/> - <projects id="6" uuid="uuid_6" kee="baz" enabled="[true]" scope="FIL" qualifier="CLA" language="grvy"/> + <projects id="6" uuid="uuid_6" root_uuid="uuid_root" kee="baz" enabled="[true]" scope="FIL" qualifier="CLA" language="grvy"/> <!-- Old snapshot of another project --> <!-- bar-old --> diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/shared.xml index f6825ce7056..306aa5b1217 100644 --- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/shared.xml +++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/shared.xml @@ -2,14 +2,14 @@ <group_roles id="1" group_id="[null]" resource_id="399" role="user"/> - <projects id="399" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." kee="struts" - root_id="[null]" qualifier="TRK" scope="PRJ"/> - <projects id="400" uuid="BCDE" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." kee="struts-core" - root_id="399" qualifier="BRC" scope="PRJ"/> - <projects id="401" uuid="CDEF" project_uuid="ABCD" module_uuid="BCDE" module_uuid_path=".ABCD.BCDE." kee="Action.java" - root_id="400" qualifier="CLA" scope="PRJ"/> - <projects id="402" uuid="DEFG" project_uuid="ABCD" module_uuid="BCDE" module_uuid_path=".ABCD.BCDE." kee="Filter.java" - root_id="400" qualifier="CLA" scope="PRJ"/> + <projects id="399" uuid="ABCD" root_uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." kee="struts" + qualifier="TRK" scope="PRJ"/> + <projects id="400" uuid="BCDE" root_uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." kee="struts-core" + qualifier="BRC" scope="PRJ"/> + <projects id="401" uuid="CDEF" root_uuid="BCDE" project_uuid="ABCD" module_uuid="BCDE" module_uuid_path=".ABCD.BCDE." kee="Action.java" + qualifier="CLA" scope="PRJ"/> + <projects id="402" uuid="DEFG" root_uuid="CDEF" project_uuid="ABCD" module_uuid="BCDE" module_uuid_path=".ABCD.BCDE." kee="Filter.java" + qualifier="CLA" scope="PRJ"/> <snapshots id="100" component_uuid="ABCD" root_snapshot_id="[null]" parent_snapshot_id="[null]" root_component_uuid="ABCD" path="" islast="[true]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml index db64cefe322..ab4473adb1b 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml @@ -15,17 +15,17 @@ <!-- project --> <projects long_name="[null]" id="1" scope="PRJ" qualifier="TRK" kee="project" name="project" - root_id="[null]" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." + root_uuid="ABCD" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." enabled="[true]"/> <!-- package --> <projects long_name="[null]" id="2" scope="DIR" qualifier="PAC" kee="project:org.foo" name="org.foo" - root_id="1" uuid="BCDE" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." + root_uuid="ABCD" uuid="BCDE" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." enabled="[true]"/> <!-- file --> <projects long_name="org.foo.Bar" id="3" scope="FIL" qualifier="CLA" kee="project:org.foo.Bar" - name="Bar" root_id="[null]" uuid="CDEF" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." + name="Bar" root_uuid="ABCD" uuid="CDEF" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." enabled="[true]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml index cc554e9e486..55744741a7f 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml @@ -4,7 +4,7 @@ <!-- project --> <projects long_name="[null]" id="1" scope="PRJ" qualifier="TRK" kee="project" name="project" - root_id="[null]" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." + root_uuid="ABCD" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." enabled="[true]"/> <!-- snapshots --> diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml index cf3af96ea09..67e00418372 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml @@ -4,7 +4,7 @@ <metrics id="11" name="coverage_line_hits_data"/> <metrics id="12" name="ncloc"/> - <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" enabled="[true]" uuid="FILE1"/> + <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" enabled="[true]" uuid="FILE1" root_uuid="ABCD"/> <snapshots id="5" component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml index c9e5417e180..08a654e1d89 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml @@ -4,7 +4,7 @@ <metrics id="11" name="coverage_line_hits_data"/> <metrics id="12" name="ncloc"/> - <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" enabled="[true]" uuid="ABCD"/> + <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" enabled="[true]" uuid="ABCD" root_uuid="ABCD"/> <snapshots id="5" component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]" /> diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml index d1fe38a34ee..d58ef14ab2e 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml @@ -4,8 +4,8 @@ <metrics id="11" name="coverage_line_hits_data"/> <metrics id="12" name="ncloc"/> - <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" enabled="[true]" uuid="uuid_1"/> - <projects id="333" kee="dev:John-Doe" enabled="[true]" uuid="333"/> + <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" enabled="[true]" uuid="uuid_1" root_uuid="uuid_1"/> + <projects id="333" kee="dev:John-Doe" enabled="[true]" uuid="333" root_uuid="333"/> <snapshots id="5" component_uuid="uuid_1" islast="[true]" root_component_uuid="uuid_1"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template.xml index f990d2158f9..0ed1f2d089b 100644 --- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template.xml +++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template.xml @@ -1,8 +1,8 @@ <dataset> - <projects id="123" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="123" uuid="A" root_uuid="A" 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> <groups id="100" name="sonar-administrators"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_add_user_permission-result.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_add_user_permission-result.xml index 793d16b3bae..242b2056066 100644 --- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_add_user_permission-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_add_user_permission-result.xml @@ -7,7 +7,7 @@ <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]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_add_user_permission.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_add_user_permission.xml index 8f079ec590c..62435ee6f13 100644 --- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_add_user_permission.xml +++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_add_user_permission.xml @@ -4,9 +4,9 @@ <user_roles id="1" user_id="200" resource_id="123" role="user"/> - <projects id="123" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="123" uuid="A" root_uuid="A" 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template.xml index ef9212b8087..bf79d01e3e2 100644 --- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template.xml +++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template.xml @@ -1,8 +1,8 @@ <dataset> - <projects id="123" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="123" uuid="A" root_uuid="A" 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> <groups id="100" name="sonar-administrators"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission-result.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission-result.xml index e77f558dc36..4cb4facedaf 100644 --- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission-result.xml @@ -4,9 +4,9 @@ <group_roles id="1" group_id="100" resource_id="123" role="admin"/> - <projects id="123" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="123" uuid="A" root_uuid="A" 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission.xml index 9c3bcfce197..e577bd2633d 100644 --- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission.xml +++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission.xml @@ -5,9 +5,9 @@ <group_roles id="1" group_id="100" resource_id="123" role="admin"/> <group_roles id="2" group_id="100" resource_id="123" role="user"/> - <projects id="123" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" +<projects id="123" uuid="A" root_uuid="A" 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_user_permission-result.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_user_permission-result.xml index 8f079ec590c..62435ee6f13 100644 --- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_user_permission-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_user_permission-result.xml @@ -4,9 +4,9 @@ <user_roles id="1" user_id="200" resource_id="123" role="user"/> - <projects id="123" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="123" uuid="A" root_uuid="A" 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_user_permission.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_user_permission.xml index fe3e01186db..0150227ccee 100644 --- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_user_permission.xml +++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_user_permission.xml @@ -5,9 +5,9 @@ <user_roles id="1" user_id="200" resource_id="123" role="user"/> <user_roles id="2" user_id="200" resource_id="123" role="admin"/> - <projects id="123" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="123" uuid="A" root_uuid="A" 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_anyone_group_permission-result.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_anyone_group_permission-result.xml index 276e8d7da3f..b94f939bf09 100644 --- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_anyone_group_permission-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_anyone_group_permission-result.xml @@ -5,9 +5,9 @@ <group_roles id="1" group_id="100" resource_id="123" role="admin"/> <group_roles id="2" group_id="[null]" resource_id="123" role="user"/> - <projects id="123" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="123" uuid="A" root_uuid="A" 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_anyone_group_permission.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_anyone_group_permission.xml index 4552a5339ee..92fe2f87d9b 100644 --- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_anyone_group_permission.xml +++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_anyone_group_permission.xml @@ -4,9 +4,9 @@ <group_roles id="1" group_id="100" resource_id="123" role="admin"/> - <projects id="123" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="123" uuid="A" root_uuid="A" 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_group_permission-result.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_group_permission-result.xml index 9c3bcfce197..574e36a9a6d 100644 --- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_group_permission-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_group_permission-result.xml @@ -5,9 +5,9 @@ <group_roles id="1" group_id="100" resource_id="123" role="admin"/> <group_roles id="2" group_id="100" resource_id="123" role="user"/> - <projects id="123" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="123" uuid="A" root_uuid="A" 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_group_permission.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_group_permission.xml index e77f558dc36..4cb4facedaf 100644 --- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_group_permission.xml +++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_insert_group_permission.xml @@ -4,9 +4,9 @@ <group_roles id="1" group_id="100" resource_id="123" role="admin"/> - <projects id="123" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="123" uuid="A" root_uuid="A" 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/delete_project_property.xml b/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/delete_project_property.xml index 99bd75917c1..f6e6099a954 100644 --- a/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/delete_project_property.xml +++ b/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/delete_project_property.xml @@ -16,7 +16,7 @@ <properties id="7" prop_key="commonslang.one" text_value="one" resource_id="12" user_id="[null]"/> - <projects id="10" uuid="A" kee="org.struts:struts"/> - <projects id="11" uuid="B" kee="org.apache:commons-lang"/> - <projects id="12" uuid="C" kee="other"/> + <projects id="10" uuid="A" root_uuid="A" kee="org.struts:struts"/> + <projects id="11" uuid="B" root_uuid="B" kee="org.apache:commons-lang"/> + <projects id="12" uuid="C" root_uuid="C" kee="other"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/findNotificationSubscribers.xml b/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/findNotificationSubscribers.xml index 9bfd1dc3001..08568ad0eee 100644 --- a/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/findNotificationSubscribers.xml +++ b/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/findNotificationSubscribers.xml @@ -10,7 +10,7 @@ login="simon" /> - <projects id="42" uuid="PROJECT_A" kee="org.apache:struts"/> + <projects id="42" uuid="PROJECT_A" root_uuid="PROJECT_A" kee="org.apache:struts"/> <!-- global subscription --> <properties diff --git a/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/selectProjectProperties.xml b/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/selectProjectProperties.xml index 99bd75917c1..f6e6099a954 100644 --- a/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/selectProjectProperties.xml +++ b/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/selectProjectProperties.xml @@ -16,7 +16,7 @@ <properties id="7" prop_key="commonslang.one" text_value="one" resource_id="12" user_id="[null]"/> - <projects id="10" uuid="A" kee="org.struts:struts"/> - <projects id="11" uuid="B" kee="org.apache:commons-lang"/> - <projects id="12" uuid="C" kee="other"/> + <projects id="10" uuid="A" root_uuid="A" kee="org.struts:struts"/> + <projects id="11" uuid="B" root_uuid="B" kee="org.apache:commons-lang"/> + <projects id="12" uuid="C" root_uuid="C" kee="other"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/select_module_properties_tree.xml b/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/select_module_properties_tree.xml index 938910a0e01..5dd05ae8a5a 100644 --- a/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/select_module_properties_tree.xml +++ b/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/select_module_properties_tree.xml @@ -20,41 +20,41 @@ <!-- root project --> - <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" + <projects id="1" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." 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_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="[null]"/> <!-- module --> - <projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" + <projects id="2" root_uuid="ABCD" kee="org.struts:struts-core" name="Struts Core" uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD." 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <!-- sub module --> - <projects id="3" root_id="1" kee="org.struts:struts-data" name="Struts Data" + <projects id="3" root_uuid="ABCD" kee="org.struts:struts-data" name="Struts Data" uuid="FGHI" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH." 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <!-- directory --> <projects long_name="org.struts" id="4" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts" uuid="GHIJ" project_uuid="ABCD" module_uuid="FGHI" module_uuid_path=".ABCD.EFGH.FGHI." - name="src/org/struts" root_id="3" + name="src/org/struts" root_uuid="FGHI" description="[null]" - enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="src/org/struts" + enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts" authorization_updated_at="[null]"/> <!-- file --> <projects long_name="org.struts.RequestContext" id="5" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java" uuid="HIJK" project_uuid="ABCD" module_uuid="GHIJ" module_uuid_path=".ABCD.EFGH.FGHI." - name="RequestContext.java" root_id="3" + name="RequestContext.java" root_uuid="FGHI" description="[null]" - enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" + enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/shouldFindUsersForNotification.xml b/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/shouldFindUsersForNotification.xml index 63c723d4f57..b6926426ff1 100644 --- a/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/shouldFindUsersForNotification.xml +++ b/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/shouldFindUsersForNotification.xml @@ -1,7 +1,7 @@ <dataset> - <projects id="45" uuid="uuid_45" kee="45"/> - <projects id="56" uuid="uuid_56" kee="46"/> + <projects id="45" uuid="uuid_45" root_uuid="uuid_45" kee="45"/> + <projects id="56" uuid="uuid_56" root_uuid="uuid_56" kee="46"/> <properties id="1" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteResource.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteResource.xml index 2230f63a43b..fa242513c85 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteResource.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteResource.xml @@ -1,8 +1,8 @@ <dataset> - <projects id="1" uuid="uuid_1" enabled="[true]" root_id="[null]" + <projects id="1" uuid="uuid_1" enabled="[true]" root_uuid="uuid_1" 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_component_uuid="[null]" developer_uuid="[null]"/> <snapshots id="1" component_uuid="uuid_1" parent_snapshot_id="[null]" root_component_uuid="uuid_1" root_snapshot_id="[null]" status="P" islast="[false]" purge_status="[null]" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml index 00546fd11e7..01da01c229e 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml @@ -1,30 +1,30 @@ <dataset> <!-- the project --> - <projects id="1" enabled="[true]" root_id="[null]" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" + <projects id="1" enabled="[true]" root_uuid="ABCD" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the directory --> - <projects id="2" enabled="[true]" root_id="1" uuid="EFGH" project_uuid="ABCD" module_uuid="ABCD" + <projects id="2" enabled="[true]" root_uuid="ABCD" uuid="EFGH" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path="." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the files --> - <projects id="3" enabled="[true]" root_id="1" uuid="GHIJ" project_uuid="ABCD" module_uuid="ABCD" + <projects id="3" enabled="[true]" root_uuid="ABCD" uuid="GHIJ" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> - <projects id="4" enabled="[true]" root_id="1" uuid="KLMN" project_uuid="ABCD" module_uuid="ABCD" + <projects id="4" enabled="[true]" root_uuid="ABCD" uuid="KLMN" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." created_at="[null]" long_name="[null]" scope="FIL" qualifier="FIL" kee="project:my/dir/DeletedFile.java" name="my/dir/DeletedFile.java" - description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <snapshots id="1" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_project_in_ce_activity_when_deleting_project.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_project_in_ce_activity_when_deleting_project.xml index b357e0afd7b..14aab1abc4e 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_project_in_ce_activity_when_deleting_project.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_project_in_ce_activity_when_deleting_project.xml @@ -4,7 +4,7 @@ <projects id="1" enabled="[true]" root_id="[null]" uuid="A" project_uuid="A" module_uuid="[null]" module_uuid_path=".A." 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml index e9a7fbb175c..157ac6440f9 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml @@ -9,24 +9,24 @@ What has been changed : <dataset> <!-- the project --> - <projects id="1" enabled="[false]" root_id="[null]" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" + <projects id="1" enabled="[false]" root_uuid="ABCD" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the directory --> - <projects id="2" enabled="[false]" root_id="1" uuid="EFGH" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path="." + <projects id="2" enabled="[false]" root_uuid="ABCD" uuid="EFGH" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path="." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the file --> - <projects id="3" enabled="[false]" root_id="1" uuid="GHIJ" project_uuid="ABCD" module_uuid="ABCD" + <projects id="3" enabled="[false]" root_uuid="ABCD" uuid="GHIJ" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <snapshots id="1" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml index c229efccb3b..e252c3f9689 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml @@ -1,24 +1,24 @@ <dataset> <!-- the project --> - <projects id="1" enabled="[true]" root_id="[null]" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" + <projects id="1" enabled="[true]" root_uuid="ABCD" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the directory --> - <projects id="2" enabled="[true]" root_id="1" uuid="EFGH" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path="." + <projects id="2" enabled="[true]" root_uuid="ABCD" uuid="EFGH" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path="." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the file --> - <projects id="3" enabled="[true]" root_id="1" uuid="GHIJ" project_uuid="ABCD" module_uuid="ABCD" + <projects id="3" enabled="[true]" root_uuid="ABCD" uuid="GHIJ" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <snapshots id="1" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml index 1165b2514bf..ade3fd7d21e 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml @@ -9,7 +9,7 @@ Snapshot 2 has been deleted <projects id="1" enabled="[true]" root_id="[null]" uuid="projectUUID" project_uuid="projectUUID" 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <!-- past snapshot with status "processed" and already purged --> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml index d80f257666d..9d795b7ea83 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml @@ -1,10 +1,10 @@ <dataset> <!-- the project --> - <projects id="1" enabled="[true]" root_id="[null]" + <projects id="1" enabled="[true]" root_uuid="projectUUID" uuid="projectUUID" project_uuid="projectUUID" 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <!-- past snapshot with status "processed" and already purged --> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml index 763a93149ce..13c04211962 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml @@ -7,24 +7,24 @@ What has been changed : purge_status=1 on snapshot 4 (PRJ) and snapshots 5 and 6 <dataset> <!-- the project --> - <projects id="1" enabled="[true]" root_id="[null]" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" + <projects id="1" enabled="[true]" root_uuid="ABCD" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the directory --> - <projects id="2" enabled="[true]" root_id="1" uuid="EFGH" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path="." + <projects id="2" enabled="[true]" root_uuid="ABCD" uuid="EFGH" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path="." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the file --> - <projects id="3" enabled="[true]" root_id="1" uuid="GHIJ" project_uuid="ABCD" module_uuid="ABCD" + <projects id="3" enabled="[true]" root_uuid="ABCD" uuid="GHIJ" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- do not purge last snapshots --> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml index 1a20054a9cd..52ea5d63dee 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml @@ -1,24 +1,24 @@ <dataset> <!-- the project --> - <projects id="1" enabled="[true]" root_id="[null]" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" + <projects id="1" enabled="[true]" root_uuid="ABCD" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the directory --> - <projects id="2" enabled="[true]" root_id="1" uuid="EFGH" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path="." + <projects id="2" enabled="[true]" root_uuid="ABCD" uuid="EFGH" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path="." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- the file --> - <projects id="3" enabled="[true]" root_id="1" uuid="GHIJ" project_uuid="ABCD" module_uuid="ABCD" + <projects id="3" enabled="[true]" root_uuid="ABCD" uuid="GHIJ" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." 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]" + description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> <!-- do not purge last snapshots --> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml index 492010d763a..fb03c68f429 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml @@ -1,10 +1,10 @@ <dataset> <!-- root --> - <projects id="1" enabled="[true]" root_id="[null]" + <projects id="1" enabled="[true]" root_uuid="A" uuid="A" project_uuid="A" module_uuid="[null]" module_uuid_path=".A." 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="1" component_uuid="A" parent_snapshot_id="[null]" root_component_uuid="A" root_snapshot_id="[null]" @@ -52,10 +52,10 @@ change_type="comment" change_data="abc"/> <!-- modules --> - <projects id="2" enabled="[true]" root_id="1" + <projects id="2" enabled="[true]" root_uuid="A" uuid="B" project_uuid="A" module_uuid="A" module_uuid_path=".A.B." 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="2" component_uuid="B" parent_snapshot_id="1" root_component_uuid="A" root_snapshot_id="1" @@ -70,10 +70,10 @@ version="[null]" path="[null]"/> - <projects id="3" enabled="[false]" root_id="1" + <projects id="3" enabled="[false]" root_uuid="A" uuid="C" project_uuid="A" module_uuid="A" module_uuid_path=".A.C." 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="3" component_uuid="C" parent_snapshot_id="1" root_component_uuid="A" root_snapshot_id="1" @@ -88,10 +88,10 @@ version="[null]" path="[null]"/> <!-- file of module 2--> - <projects id="4" enabled="[false]" root_id="3" + <projects id="4" enabled="[false]" root_uuid="C" uuid="D" project_uuid="A" module_uuid="C" module_uuid_path=".A.C." 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="4" component_uuid="D" parent_snapshot_id="3" root_component_uuid="A" root_snapshot_id="1" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject-result.xml index 59212cb0831..3f85b38406c 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject-result.xml @@ -4,7 +4,7 @@ <projects id="1" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." 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]" + root_uuid="ABCD" description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject.xml index c4b9ccba430..6d59eb0ff86 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject.xml @@ -4,7 +4,7 @@ <projects id="1" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." 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]" + root_uuid="ABCD" description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml index ae336142fdf..89d73329dca 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml @@ -7,7 +7,7 @@ <projects id="1" uuid="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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="1" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues.xml index 348c6520e65..9e92f34618b 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues.xml @@ -1,8 +1,8 @@ <dataset> - <projects id="1" uuid="1" enabled="[true]" root_id="[null]" created_at="[null]" + <projects id="1" uuid="1" enabled="[true]" root_uuid="1" 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="1" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml index 4dad1831f6c..ab94caed6e5 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml @@ -2,7 +2,7 @@ <projects id="1" uuid="P1" 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="1" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues.xml index 17230f4310e..7735736555a 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues.xml @@ -1,8 +1,8 @@ <dataset> - <projects id="1" uuid="P1" enabled="[true]" root_id="[null]" created_at="[null]" + <projects id="1" uuid="P1" enabled="[true]" root_uuid="P1" 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_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <snapshots id="1" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/view_sub_view_and_tech_project.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/view_sub_view_and_tech_project.xml index f2e519eb559..db564d7da73 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/view_sub_view_and_tech_project.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/view_sub_view_and_tech_project.xml @@ -1,30 +1,30 @@ <dataset> <!-- view --> - <projects id="1" enabled="[true]" root_id="[null]" + <projects id="1" enabled="[true]" root_uuid="A" uuid="A" project_uuid="A" module_uuid="[null]" module_uuid_path=".A." long_name="[null]" scope="PRJ" qualifier="VW" kee="view" name="view" - description="[null]" language="[null]" copy_resource_id="[null]" person_id="[null]" + description="[null]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <!-- sub views --> - <projects id="2" enabled="[true]" root_id="1" + <projects id="2" enabled="[true]" root_uuid="A" uuid="B" project_uuid="A" module_uuid="A" module_uuid_path=".A.B." long_name="[null]" scope="PRJ" qualifier="SVW" kee="subview1" name="subview2" - description="[null]" language="[null]" copy_resource_id="[null]" person_id="[null]" + description="[null]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> - <projects id="3" enabled="[false]" root_id="1" + <projects id="3" enabled="[false]" root_uuid="A" uuid="C" project_uuid="A" module_uuid="A" module_uuid_path=".A.C." long_name="[null]" scope="PRJ" qualifier="SVW" kee="subview2" name="subview2" - description="[null]" language="[null]" copy_resource_id="[null]" person_id="[null]" + description="[null]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> <!-- technical project of module 2--> - <projects id="4" enabled="[false]" root_id="3" + <projects id="4" enabled="[false]" root_uuid="C" uuid="D" project_uuid="A" module_uuid="C" module_uuid_path=".A.C." long_name="[null]" scope="FIL" qualifier="TRK" kee="TechProject" name="TechProject" - description="[null]" language="[null]" copy_resource_id="[null]" person_id="[null]" + description="[null]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/qualitygate/ProjectQgateAssociationDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/qualitygate/ProjectQgateAssociationDaoTest/shared.xml index c58db5391e2..8f719037338 100644 --- a/sonar-db/src/test/resources/org/sonar/db/qualitygate/ProjectQgateAssociationDaoTest/shared.xml +++ b/sonar-db/src/test/resources/org/sonar/db/qualitygate/ProjectQgateAssociationDaoTest/shared.xml @@ -3,13 +3,13 @@ <quality_gates id="42" name="Golden"/> <quality_gates id="43" name="Ninth"/> - <projects id="1" uuid="A" kee="project-one" name="Project One" qualifier="TRK" scope="PRJ"/> - <projects id="2" uuid="B" kee="project-two" name="Project Two" qualifier="TRK" scope="PRJ"/> - <projects id="3" uuid="C" kee="project-three" name="Project Three" qualifier="TRK" scope="PRJ"/> - <projects id="4" uuid="D" kee="project-four" name="Project Four" qualifier="TRK" scope="PRJ"/> - <projects id="5" uuid="E" kee="project-five" name="Project Five" qualifier="TRK" scope="PRJ"/> - <projects id="6" uuid="F" kee="view-six" name="View Six" qualifier="VW" scope="PRJ"/> - <projects id="7" uuid="G" kee="file-one" name="File One" qualifier="TRK" scope="FIL"/> + <projects id="1" uuid="A" root_uuid="A" kee="project-one" name="Project One" qualifier="TRK" scope="PRJ"/> + <projects id="2" uuid="B" root_uuid="B" kee="project-two" name="Project Two" qualifier="TRK" scope="PRJ"/> + <projects id="3" uuid="C" root_uuid="C" kee="project-three" name="Project Three" qualifier="TRK" scope="PRJ"/> + <projects id="4" uuid="D" root_uuid="D" kee="project-four" name="Project Four" qualifier="TRK" scope="PRJ"/> + <projects id="5" uuid="E" root_uuid="E" kee="project-five" name="Project Five" qualifier="TRK" scope="PRJ"/> + <projects id="6" uuid="F" root_uuid="F" kee="view-six" name="View Six" qualifier="VW" scope="PRJ"/> + <projects id="7" uuid="G" root_uuid="G" kee="file-one" name="File One" qualifier="TRK" scope="FIL"/> <resource_index id="1" kee="project one" component_uuid="A" root_component_uuid="A" position="0" name_size="11" qualifier="TRK"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/qualityprofile/QualityProfileDaoTest/projects.xml b/sonar-db/src/test/resources/org/sonar/db/qualityprofile/QualityProfileDaoTest/projects.xml index 94df8ad98ee..32f6c7c7262 100644 --- a/sonar-db/src/test/resources/org/sonar/db/qualityprofile/QualityProfileDaoTest/projects.xml +++ b/sonar-db/src/test/resources/org/sonar/db/qualityprofile/QualityProfileDaoTest/projects.xml @@ -5,9 +5,9 @@ <rules_profiles id="2" name="Sonar Way" language="js" parent_kee="[null]" kee="js_sonar_way" is_default="[true]" rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> - <projects id="1" uuid="A" kee="org.codehaus.sonar:sonar" name="SonarQube" enabled="[true]"/> - <projects id="2" uuid="B" kee="org.codehaus.sonar-plugins.java:java" name="SonarQube Java" enabled="[true]"/> - <projects id="3" uuid="C" kee="disabled:project" name="Disabled Project" enabled="[false]"/> + <projects id="1" uuid="A" root_uuid="A" kee="org.codehaus.sonar:sonar" name="SonarQube" enabled="[true]"/> + <projects id="2" uuid="B" root_uuid="B" kee="org.codehaus.sonar-plugins.java:java" name="SonarQube Java" enabled="[true]"/> + <projects id="3" uuid="C" root_uuid="C" kee="disabled:project" name="Disabled Project" enabled="[false]"/> <project_qprofiles id="1" project_uuid="A" profile_key="java_sonar_way"/> <project_qprofiles id="2" project_uuid="B" profile_key="java_sonar_way"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/anonymous_should_be_authorized.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/anonymous_should_be_authorized.xml index f5730087a21..47b03de71a5 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/anonymous_should_be_authorized.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/anonymous_should_be_authorized.xml @@ -5,10 +5,10 @@ <group_roles id="1" group_id="[null]" resource_id="300" role="user"/> <group_roles id="2" group_id="[null]" resource_id="400" role="user"/> - <projects id="301" kee="pj-w-snapshot:package" root_id="300" uuid="ABCD" module_uuid="EDFG"/> - <projects id="302" kee="pj-w-snapshot:file" root_id="300" uuid="BCDE" module_uuid="EDFG"/> - <projects id="303" kee="pj-w-snapshot:other" root_id="300" uuid="CDEF" module_uuid="EDFG"/> - <projects id="300" kee="pj-w-snapshot" uuid="EDFG" module_uuid="[null]"/> - <projects id="400" kee="pj-wo-snapshot" uuid="FGHI" project_uuid="FGHI"/> + <projects id="301" kee="pj-w-snapshot:package" root_uuid="EDFG" uuid="ABCD" module_uuid="EDFG"/> + <projects id="302" kee="pj-w-snapshot:file" root_uuid="EDFG" uuid="BCDE" module_uuid="EDFG"/> + <projects id="303" kee="pj-w-snapshot:other" root_uuid="EDFG" uuid="CDEF" module_uuid="EDFG"/> + <projects id="300" kee="pj-w-snapshot" uuid="EDFG" root_uuid="EDFG" module_uuid="[null]"/> + <projects id="400" kee="pj-wo-snapshot" uuid="FGHI" root_uuid="FGHI" project_uuid="FGHI"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/group_should_be_authorized.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/group_should_be_authorized.xml index 7ffca0d6f5e..07ae52a0cc8 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/group_should_be_authorized.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/group_should_be_authorized.xml @@ -7,10 +7,10 @@ <group_roles id="1" group_id="200" resource_id="300" role="user"/> <group_roles id="2" group_id="200" resource_id="400" role="user"/> - <projects id="301" kee="pj-w-snapshot:package" root_id="300" uuid="ABCD" module_uuid="DEFG"/> - <projects id="302" kee="pj-w-snapshot:file" root_id="300" uuid="BCDE" module_uuid="DEFG"/> - <projects id="303" kee="pj-w-snapshot:other" root_id="300" uuid="CDEF" module_uuid="DEFG"/> - <projects id="300" kee="pj-w-snapshot" uuid="DEFG" module_uuid="[null]"/> - <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" module_uuid="[null]"/> + <projects id="301" kee="pj-w-snapshot:package" root_uuid="DEFG" uuid="ABCD" module_uuid="DEFG"/> + <projects id="302" kee="pj-w-snapshot:file" root_uuid="DEFG" uuid="BCDE" module_uuid="DEFG"/> + <projects id="303" kee="pj-w-snapshot:other" root_uuid="DEFG" uuid="CDEF" module_uuid="DEFG"/> + <projects id="300" kee="pj-w-snapshot" uuid="DEFG" root_uuid="DEFG" module_uuid="[null]"/> + <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" root_uuid="EFGH" module_uuid="[null]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_project_ids_for_anonymous.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_project_ids_for_anonymous.xml index 1c21104a7b6..e02308c9bc1 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_project_ids_for_anonymous.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_project_ids_for_anonymous.xml @@ -4,7 +4,7 @@ <group_roles id="1" group_id="[null]" resource_id="300" role="user"/> <group_roles id="2" group_id="200" resource_id="400" role="codeviewer"/> - <projects id="300" kee="pj-w-snapshot" uuid="DEFG" module_uuid="[null]" enabled="[true]"/> - <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" module_uuid="[null]" enabled="[true]"/> + <projects id="300" kee="pj-w-snapshot" uuid="DEFG" root_uuid="DEFG" module_uuid="[null]" enabled="[true]"/> + <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" root_uuid="EFGH" module_uuid="[null]" enabled="[true]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_project_ids_for_group.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_project_ids_for_group.xml index 17e6323ccd6..593f2936ac6 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_project_ids_for_group.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_project_ids_for_group.xml @@ -4,7 +4,7 @@ <group_roles id="1" group_id="200" resource_id="300" role="user"/> <group_roles id="2" group_id="200" resource_id="400" role="codeviewer"/> - <projects id="300" kee="pj-w-snapshot" uuid="DEFG" module_uuid="[null]" enabled="[true]"/> - <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" module_uuid="[null]" enabled="[true]"/> + <projects id="300" kee="pj-w-snapshot" uuid="DEFG" root_uuid="DEFG" module_uuid="[null]" enabled="[true]"/> + <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" root_uuid="EFGH" module_uuid="[null]" enabled="[true]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_project_ids_for_user.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_project_ids_for_user.xml index 515adaa8f48..e2994285531 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_project_ids_for_user.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_project_ids_for_user.xml @@ -4,7 +4,7 @@ <user_roles id="1" user_id="100" resource_id="300" role="user"/> <user_roles id="2" user_id="100" resource_id="400" role="codeviewer"/> - <projects id="300" kee="pj-w-snapshot" uuid="DEFG" module_uuid="[null]" enabled="[true]"/> - <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" module_uuid="[null]" enabled="[true]"/> + <projects id="300" kee="pj-w-snapshot" uuid="DEFG" root_uuid="DEFG" module_uuid="[null]" enabled="[true]"/> + <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" root_uuid="EFGH" module_uuid="[null]" enabled="[true]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_users_for_role_and_project_for_anonymous.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_users_for_role_and_project_for_anonymous.xml index 4de4f328925..b7b48ed7ea9 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_users_for_role_and_project_for_anonymous.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_users_for_role_and_project_for_anonymous.xml @@ -12,7 +12,7 @@ <group_roles id="1" group_id="[null]" resource_id="300" role="user"/> <group_roles id="2" group_id="201" resource_id="400" role="user"/> - <projects id="300" kee="pj-w-snapshot" uuid="DEFG" module_uuid="[null]"/> - <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" module_uuid="[null]"/> + <projects id="300" kee="pj-w-snapshot" uuid="DEFG" root_uuid="DEFG" module_uuid="[null]"/> + <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" root_uuid="EFGH" module_uuid="[null]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_users_for_role_and_project_for_group.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_users_for_role_and_project_for_group.xml index c813b02e6f8..a354439d560 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_users_for_role_and_project_for_group.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_users_for_role_and_project_for_group.xml @@ -12,7 +12,7 @@ <group_roles id="1" group_id="200" resource_id="300" role="user"/> <group_roles id="2" group_id="201" resource_id="400" role="user"/> - <projects id="300" kee="pj-w-snapshot" uuid="DEFG" module_uuid="[null]"/> - <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" module_uuid="[null]"/> + <projects id="300" kee="pj-w-snapshot" uuid="DEFG" root_uuid="DEFG" module_uuid="[null]"/> + <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" root_uuid="EFGH" module_uuid="[null]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_users_for_role_and_project_for_user.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_users_for_role_and_project_for_user.xml index e6328ec9654..0fa56c9ee59 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_users_for_role_and_project_for_user.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/keep_authorized_users_for_role_and_project_for_user.xml @@ -9,7 +9,7 @@ <groups_users user_id="100" group_id="200"/> <group_roles id="1" group_id="200" resource_id="400" role="user"/> - <projects id="300" kee="pj-w-snapshot" uuid="DEFG" module_uuid="[null]"/> - <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" module_uuid="[null]"/> + <projects id="300" kee="pj-w-snapshot" uuid="DEFG" root_uuid="DEFG" module_uuid="[null]"/> + <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" root_uuid="EFGH" module_uuid="[null]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/should_return_root_project_keys_for_anonymous.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/should_return_root_project_keys_for_anonymous.xml index a1aa1f05a76..7db6a43c676 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/should_return_root_project_keys_for_anonymous.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/should_return_root_project_keys_for_anonymous.xml @@ -4,13 +4,13 @@ <groups_users user_id="100" group_id="200"/> <group_roles id="1" group_id="[null]" resource_id="300" role="user"/> - <projects id="300" uuid="ABCD" module_uuid="[null]" kee="pj-w-snapshot" scope="PRJ" qualifier="TRK" enabled="[true]"/> - <projects id="301" uuid="BCDE" module_uuid="[null]" kee="pj-w-snapshot1" scope="PRJ" qualifier="TRK" + <projects id="300" uuid="ABCD" root_uuid="ABCD" module_uuid="[null]" kee="pj-w-snapshot" scope="PRJ" qualifier="TRK" enabled="[true]"/> + <projects id="301" uuid="BCDE" root_uuid="BCDE" module_uuid="[null]" kee="pj-w-snapshot1" scope="PRJ" qualifier="TRK" enabled="[true]"/> - <projects id="302" uuid="CDEF" module_uuid="[null]" kee="pj-w-snapshot2" scope="PRJ" qualifier="TRK" + <projects id="302" uuid="CDEF" root_uuid="CDEF" module_uuid="[null]" kee="pj-w-snapshot2" scope="PRJ" qualifier="TRK" enabled="[true]"/> - <projects id="303" uuid="DEFG" module_uuid="[null]" kee="pj-w-snapshot3" scope="PRJ" qualifier="TRK" + <projects id="303" uuid="DEFG" root_uuid="DEFG" module_uuid="[null]" kee="pj-w-snapshot3" scope="PRJ" qualifier="TRK" enabled="[true]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/should_return_root_project_keys_for_group.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/should_return_root_project_keys_for_group.xml index 93682166701..bf24717a9b9 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/should_return_root_project_keys_for_group.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/should_return_root_project_keys_for_group.xml @@ -6,13 +6,13 @@ <groups_users user_id="100" group_id="200"/> <group_roles id="1" group_id="200" resource_id="300" role="user"/> - <projects id="300" uuid="ABCD" module_uuid="[null]" kee="pj-w-snapshot" scope="PRJ" qualifier="TRK" enabled="[true]"/> - <projects id="301" uuid="BCDE" module_uuid="[null]" kee="pj-w-snapshot1" scope="PRJ" qualifier="TRK" + <projects id="300" uuid="ABCD" root_uuid="ABCD" module_uuid="[null]" kee="pj-w-snapshot" scope="PRJ" qualifier="TRK" enabled="[true]"/> + <projects id="301" uuid="BCDE" root_uuid="BCDE" module_uuid="[null]" kee="pj-w-snapshot1" scope="PRJ" qualifier="TRK" enabled="[true]"/> - <projects id="302" uuid="CDEF" module_uuid="[null]" kee="pj-w-snapshot2" scope="PRJ" qualifier="TRK" + <projects id="302" uuid="CDEF" root_uuid="CDEF" module_uuid="[null]" kee="pj-w-snapshot2" scope="PRJ" qualifier="TRK" enabled="[true]"/> - <projects id="303" uuid="DEFG" module_uuid="[null]" kee="pj-w-snapshot3" scope="PRJ" qualifier="TRK" + <projects id="303" uuid="DEFG" root_uuid="DEFG" module_uuid="[null]" kee="pj-w-snapshot3" scope="PRJ" qualifier="TRK" enabled="[true]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/should_return_root_project_keys_for_user.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/should_return_root_project_keys_for_user.xml index 060223cdfbd..6ddf4cd5cda 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/should_return_root_project_keys_for_user.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/should_return_root_project_keys_for_user.xml @@ -5,13 +5,13 @@ <groups_users user_id="100" group_id="200"/> <group_roles id="1" group_id="200" resource_id="999" role="user"/> - <projects id="300" uuid="ABCD" module_uuid="[null]" kee="pj-w-snapshot" scope="PRJ" qualifier="TRK" enabled="[true]"/> - <projects id="301" uuid="BCDE" module_uuid="[null]" kee="pj-w-snapshot1" scope="PRJ" qualifier="TRK" + <projects id="300" uuid="ABCD" root_uuid="ABCD" module_uuid="[null]" kee="pj-w-snapshot" scope="PRJ" qualifier="TRK" enabled="[true]"/> + <projects id="301" uuid="BCDE" root_uuid="BCDE" module_uuid="[null]" kee="pj-w-snapshot1" scope="PRJ" qualifier="TRK" enabled="[true]"/> - <projects id="302" uuid="CDEF" module_uuid="[null]" kee="pj-w-snapshot2" scope="PRJ" qualifier="TRK" + <projects id="302" uuid="CDEF" root_uuid="CDEF" module_uuid="[null]" kee="pj-w-snapshot2" scope="PRJ" qualifier="TRK" enabled="[true]"/> - <projects id="303" uuid="DEFG" module_uuid="[null]" kee="pj-w-snapshot3" scope="PRJ" qualifier="TRK" + <projects id="303" uuid="DEFG" root_uuid="DEFG" module_uuid="[null]" kee="pj-w-snapshot3" scope="PRJ" qualifier="TRK" enabled="[true]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/user_should_be_authorized.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/user_should_be_authorized.xml index 3771e09738d..5bed484123e 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/user_should_be_authorized.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorizationDaoTest/user_should_be_authorized.xml @@ -6,6 +6,6 @@ <groups_users user_id="100" group_id="200"/> <group_roles id="1" group_id="200" resource_id="999" role="user"/> - <projects id="300" kee="pj-w-snapshot" uuid="DEFG" module_uuid="[null]"/> - <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" module_uuid="[null]"/> + <projects id="300" kee="pj-w-snapshot" uuid="DEFG" root_uuid="DEFG" module_uuid="[null]"/> + <projects id="400" kee="pj-wo-snapshot" uuid="EFGH" root_uuid="EFGH" module_uuid="[null]"/> </dataset> |