]> source.dussan.org Git - sonarqube.git/commitdiff
Rename ResourceKeyUpdaterDao to ComponentKeyUpdaterDao 1132/head
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Thu, 4 Aug 2016 15:45:59 +0000 (17:45 +0200)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 5 Aug 2016 13:42:45 +0000 (15:42 +0200)
25 files changed:
server/sonar-server/src/main/java/org/sonar/server/component/ComponentService.java
server/sonar-server/src/main/java/org/sonar/server/component/ws/BulkUpdateKeyAction.java
sonar-db/src/main/java/org/sonar/db/DaoModule.java
sonar-db/src/main/java/org/sonar/db/DbClient.java
sonar-db/src/main/java/org/sonar/db/MyBatis.java
sonar-db/src/main/java/org/sonar/db/component/ComponentKeyUpdaterDao.java [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/db/component/ComponentKeyUpdaterMapper.java [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/db/component/ResourceKeyUpdaterDao.java [deleted file]
sonar-db/src/main/java/org/sonar/db/component/ResourceKeyUpdaterMapper.java [deleted file]
sonar-db/src/main/resources/org/sonar/db/component/ComponentKeyUpdaterMapper.xml [new file with mode: 0644]
sonar-db/src/main/resources/org/sonar/db/component/ResourceKeyUpdaterMapper.xml [deleted file]
sonar-db/src/test/java/org/sonar/db/component/ComponentKeyUpdaterDaoTest.java [new file with mode: 0644]
sonar-db/src/test/java/org/sonar/db/component/ResourceKeyUpdaterDaoTest.java [deleted file]
sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shared.xml [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldBulkUpdateKey-result.xml [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules-result.xml [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules.xml [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldUpdateKey-result.xml [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shared.xml [deleted file]
sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKey-result.xml [deleted file]
sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml [deleted file]
sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules-result.xml [deleted file]
sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules.xml [deleted file]
sonar-db/src/test/resources/org/sonar/db/component/ResourceKeyUpdaterDaoTest/shouldUpdateKey-result.xml [deleted file]

index d2c3bd8b7304c72eae49dfea7f467a4497546a81..59aa3d0b31fb96d8dc4f9b446ec5bec494583765 100644 (file)
@@ -123,7 +123,7 @@ public class ComponentService {
     checkIsProjectOrModule(component);
     checkProjectOrModuleKeyFormat(newKey);
 
-    dbClient.resourceKeyUpdaterDao().updateKey(component.uuid(), newKey);
+    dbClient.componentKeyUpdaterDao().updateKey(component.uuid(), newKey);
   }
 
   public Map<String, String> checkModuleKeysBeforeRenaming(String projectKey, String stringToReplace, String replacementString) {
@@ -131,7 +131,7 @@ public class ComponentService {
     try {
       ComponentDto project = getByKey(projectKey);
       userSession.checkComponentUuidPermission(UserRole.ADMIN, project.projectUuid());
-      return dbClient.resourceKeyUpdaterDao().checkModuleKeysBeforeRenaming(project.uuid(), stringToReplace, replacementString);
+      return dbClient.componentKeyUpdaterDao().checkModuleKeysBeforeRenaming(project.uuid(), stringToReplace, replacementString);
     } finally {
       session.close();
     }
@@ -141,7 +141,7 @@ public class ComponentService {
     ComponentDto project = getByKey(dbSession, projectKey);
     userSession.checkComponentUuidPermission(UserRole.ADMIN, project.projectUuid());
     checkIsProjectOrModule(project);
-    dbClient.resourceKeyUpdaterDao().bulkUpdateKey(dbSession, project.uuid(), stringToReplace, replacementString);
+    dbClient.componentKeyUpdaterDao().bulkUpdateKey(dbSession, project.uuid(), stringToReplace, replacementString);
   }
 
   public void bulkUpdateKey(String projectKey, String stringToReplace, String replacementString) {
index fe403a77f2a1af0c9109a32f16e926a36c1bda98..f3ee2b81a1d63aa74dba2503b4f7918aab7acc3f 100644 (file)
@@ -55,7 +55,7 @@ public class BulkUpdateKeyAction implements ComponentsWsAction {
 
   public BulkUpdateKeyAction(DbClient dbClient, ComponentFinder componentFinder, UserSession userSession) {
     this.dbClient = dbClient;
-    this.componentKeyUpdater = dbClient.resourceKeyUpdaterDao();
+    this.componentKeyUpdater = dbClient.componentKeyUpdaterDao();
     this.componentFinder = componentFinder;
     this.userSession = userSession;
   }
index 9eb8fcad164afba6693fe5dc20cb2d8c79d2a8c3..4649f70ecc2e17f0f051064281123c34364040d0 100644 (file)
@@ -29,7 +29,7 @@ import org.sonar.db.component.ComponentDao;
 import org.sonar.db.component.ComponentLinkDao;
 import org.sonar.db.component.ResourceDao;
 import org.sonar.db.component.ResourceIndexDao;
-import org.sonar.db.component.ResourceKeyUpdaterDao;
+import org.sonar.db.component.ComponentKeyUpdaterDao;
 import org.sonar.db.component.SnapshotDao;
 import org.sonar.db.dashboard.ActiveDashboardDao;
 import org.sonar.db.dashboard.DashboardDao;
@@ -109,7 +109,7 @@ public class DaoModule extends Module {
     ActiveRuleDao.class,
     ResourceIndexDao.class,
     ResourceDao.class,
-    ResourceKeyUpdaterDao.class,
+    ComponentKeyUpdaterDao.class,
     RoleDao.class,
     SnapshotDao.class,
     UserDao.class,
index e909f36c3d0dbf9f79bd6c98e1b30474d1c1858f..e883d1cb62b68232bfcca024316246bdbaad8391 100644 (file)
@@ -29,7 +29,7 @@ import org.sonar.db.component.ComponentDao;
 import org.sonar.db.component.ComponentLinkDao;
 import org.sonar.db.component.ResourceDao;
 import org.sonar.db.component.ResourceIndexDao;
-import org.sonar.db.component.ResourceKeyUpdaterDao;
+import org.sonar.db.component.ComponentKeyUpdaterDao;
 import org.sonar.db.component.SnapshotDao;
 import org.sonar.db.dashboard.ActiveDashboardDao;
 import org.sonar.db.dashboard.DashboardDao;
@@ -79,7 +79,7 @@ public class DbClient {
   private final SnapshotDao snapshotDao;
   private final ComponentDao componentDao;
   private final ResourceDao resourceDao;
-  private final ResourceKeyUpdaterDao resourceKeyUpdaterDao;
+  private final ComponentKeyUpdaterDao componentKeyUpdaterDao;
   private final MeasureDao measureDao;
   private final MeasureFilterDao measureFilterDao;
   private final MeasureFilterFavouriteDao measureFilterFavouriteDao;
@@ -134,7 +134,7 @@ public class DbClient {
     snapshotDao = getDao(map, SnapshotDao.class);
     componentDao = getDao(map, ComponentDao.class);
     resourceDao = getDao(map, ResourceDao.class);
-    resourceKeyUpdaterDao = getDao(map, ResourceKeyUpdaterDao.class);
+    componentKeyUpdaterDao = getDao(map, ComponentKeyUpdaterDao.class);
     measureDao = getDao(map, MeasureDao.class);
     measureFilterDao = getDao(map, MeasureFilterDao.class);
     measureFilterFavouriteDao = getDao(map, MeasureFilterFavouriteDao.class);
@@ -234,8 +234,8 @@ public class DbClient {
     return resourceDao;
   }
 
-  public ResourceKeyUpdaterDao resourceKeyUpdaterDao() {
-    return resourceKeyUpdaterDao;
+  public ComponentKeyUpdaterDao componentKeyUpdaterDao() {
+    return componentKeyUpdaterDao;
   }
 
   public MeasureDao measureDao() {
index 4bd7fe55fd1a236b74256c4a4db8dca81b231333..45a675457b3b2e33a83f9d4cdf20b1b9db510b35 100644 (file)
@@ -42,7 +42,7 @@ import org.sonar.db.component.FilePathWithHashDto;
 import org.sonar.db.component.ResourceDto;
 import org.sonar.db.component.ResourceIndexDto;
 import org.sonar.db.component.ResourceIndexMapper;
-import org.sonar.db.component.ResourceKeyUpdaterMapper;
+import org.sonar.db.component.ComponentKeyUpdaterMapper;
 import org.sonar.db.component.ResourceMapper;
 import org.sonar.db.component.SnapshotDto;
 import org.sonar.db.component.SnapshotMapper;
@@ -225,7 +225,7 @@ public class MyBatis {
       IsAliveMapper.class,
       LoadedTemplateMapper.class, MeasureFilterMapper.class, MeasureFilterFavouriteMapper.class,
       PermissionTemplateMapper.class, PermissionTemplateCharacteristicMapper.class,
-      PropertiesMapper.class, PurgeMapper.class, ResourceKeyUpdaterMapper.class, ResourceIndexMapper.class, RoleMapper.class, RuleMapper.class,
+      PropertiesMapper.class, PurgeMapper.class, ComponentKeyUpdaterMapper.class, ResourceIndexMapper.class, RoleMapper.class, RuleMapper.class,
       SchemaMigrationMapper.class, WidgetMapper.class, WidgetPropertyMapper.class,
       UserMapper.class, GroupMapper.class, UserGroupMapper.class, UserTokenMapper.class,
       FileSourceMapper.class,
diff --git a/sonar-db/src/main/java/org/sonar/db/component/ComponentKeyUpdaterDao.java b/sonar-db/src/main/java/org/sonar/db/component/ComponentKeyUpdaterDao.java
new file mode 100644 (file)
index 0000000..a57b673
--- /dev/null
@@ -0,0 +1,185 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.db.component;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import org.apache.commons.lang.StringUtils;
+import org.apache.ibatis.session.SqlSession;
+import org.sonar.api.resources.Qualifiers;
+import org.sonar.db.Dao;
+import org.sonar.db.DbSession;
+import org.sonar.db.MyBatis;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static org.sonar.core.component.ComponentKeys.isValidModuleKey;
+
+/**
+ * Class used to rename the key of a project and its resources.
+ *
+ * @since 3.2
+ */
+public class ComponentKeyUpdaterDao implements Dao {
+  private static final Set<String> PROJECT_OR_MODULE_QUALIFIERS = ImmutableSet.of(Qualifiers.PROJECT, Qualifiers.MODULE);
+
+  private MyBatis mybatis;
+
+  public ComponentKeyUpdaterDao(MyBatis mybatis) {
+    this.mybatis = mybatis;
+  }
+
+  public void updateKey(String projectUuid, String newKey) {
+    DbSession session = mybatis.openSession(true);
+    ComponentKeyUpdaterMapper mapper = session.getMapper(ComponentKeyUpdaterMapper.class);
+    try {
+      if (mapper.countResourceByKey(newKey) > 0) {
+        throw new IllegalArgumentException("Impossible to update key: a component with key \"" + newKey + "\" already exists.");
+      }
+
+      // must SELECT first everything
+      ResourceDto project = mapper.selectProject(projectUuid);
+      String projectOldKey = project.getKey();
+      List<ResourceDto> resources = mapper.selectProjectResources(projectUuid);
+      resources.add(project);
+
+      // and then proceed with the batch UPDATE at once
+      runBatchUpdateForAllResources(resources, projectOldKey, newKey, mapper);
+
+      session.commit();
+    } finally {
+      MyBatis.closeQuietly(session);
+    }
+  }
+
+  public Map<String, String> checkModuleKeysBeforeRenaming(String projectUuid, String stringToReplace, String replacementString) {
+    SqlSession session = mybatis.openSession(false);
+    ComponentKeyUpdaterMapper mapper = session.getMapper(ComponentKeyUpdaterMapper.class);
+    Map<String, String> result = Maps.newHashMap();
+    try {
+      Set<ResourceDto> modules = collectAllModules(projectUuid, stringToReplace, mapper);
+      for (ResourceDto module : modules) {
+        String newKey = computeNewKey(module, stringToReplace, replacementString);
+        if (mapper.countResourceByKey(newKey) > 0) {
+          result.put(module.getKey(), "#duplicate_key#");
+        } else {
+          result.put(module.getKey(), newKey);
+        }
+      }
+    } finally {
+      MyBatis.closeQuietly(session);
+    }
+    return result;
+  }
+
+  public static void checkIsProjectOrModule(ComponentDto component) {
+    checkArgument(PROJECT_OR_MODULE_QUALIFIERS.contains(component.qualifier()), "Component updated must be a module or a key");
+  }
+
+  /**
+   *
+   * @return a map with currentKey/newKey is a bulk update was executed
+   */
+  public Map<String, String> simulateBulkUpdateKey(DbSession dbSession, String projectUuid, String stringToReplace, String replacementString) {
+    return collectAllModules(projectUuid, stringToReplace, mapper(dbSession))
+      .stream()
+      .collect(Collectors.toMap(
+        ResourceDto::getKey,
+        component -> computeNewKey(component, stringToReplace, replacementString)));
+  }
+
+  /**
+   * @return a map with the component key as key, and boolean as true if key already exists in db
+   */
+  public Map<String, Boolean> checkComponentKeys(DbSession dbSession, List<String> newComponentKeys) {
+    return newComponentKeys.stream().collect(Collectors.toMap(Function.identity(), key -> mapper(dbSession).countResourceByKey(key) > 0));
+  }
+
+  public void bulkUpdateKey(DbSession session, String projectUuid, String stringToReplace, String replacementString) {
+    ComponentKeyUpdaterMapper mapper = session.getMapper(ComponentKeyUpdaterMapper.class);
+    // must SELECT first everything
+    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.getUuid()));
+    }
+
+    // and then proceed with the batch UPDATE at once
+    for (ResourceDto module : modules) {
+      String oldModuleKey = module.getKey();
+      String newModuleKey = computeNewKey(module, stringToReplace, replacementString);
+      Collection<ResourceDto> resources = Lists.newArrayList(module);
+      resources.addAll(allResourcesByModuleMap.get(module));
+      runBatchUpdateForAllResources(resources, oldModuleKey, newModuleKey, mapper);
+    }
+  }
+
+  private static String computeNewKey(ResourceDto resource, String stringToReplace, String replacementString) {
+    return resource.getKey().replaceAll(stringToReplace, replacementString);
+  }
+
+  private static void runBatchUpdateForAllResources(Collection<ResourceDto> resources, String oldKey, String newKey, ComponentKeyUpdaterMapper mapper) {
+    for (ResourceDto resource : resources) {
+      String oldResourceKey = resource.getKey();
+      String newResourceKey = newKey + oldResourceKey.substring(oldKey.length(), oldResourceKey.length());
+      resource.setKey(newResourceKey);
+      String oldResourceDeprecatedKey = resource.getDeprecatedKey();
+      if (StringUtils.isNotBlank(oldResourceDeprecatedKey)) {
+        String newResourceDeprecatedKey = newKey + oldResourceDeprecatedKey.substring(oldKey.length(), oldResourceDeprecatedKey.length());
+        resource.setDeprecatedKey(newResourceDeprecatedKey);
+      }
+      mapper.update(resource);
+    }
+  }
+
+  private static Set<ResourceDto> collectAllModules(String projectUuid, String stringToReplace, ComponentKeyUpdaterMapper mapper) {
+    ResourceDto project = mapper.selectProject(projectUuid);
+    Set<ResourceDto> modules = Sets.newHashSet();
+    if (project.getKey().contains(stringToReplace)) {
+      modules.add(project);
+    }
+    for (ResourceDto submodule : mapper.selectDescendantProjects(projectUuid)) {
+      modules.addAll(collectAllModules(submodule.getUuid(), stringToReplace, mapper));
+    }
+    return modules;
+  }
+
+  private static void checkNewNameOfAllModules(Set<ResourceDto> modules, String stringToReplace, String replacementString, ComponentKeyUpdaterMapper mapper) {
+    for (ResourceDto module : modules) {
+      String newKey = computeNewKey(module, stringToReplace, replacementString);
+      checkArgument(isValidModuleKey(newKey), "Malformed key for '%s'. Allowed characters are alphanumeric, '-', '_', '.' and ':', with at least one non-digit.", newKey);
+      if (mapper.countResourceByKey(newKey) > 0) {
+        throw new IllegalArgumentException("Impossible to update key: a component with key \"" + newKey + "\" already exists.");
+      }
+    }
+  }
+
+  private static ComponentKeyUpdaterMapper mapper(DbSession dbSession) {
+    return dbSession.getMapper(ComponentKeyUpdaterMapper.class);
+  }
+}
diff --git a/sonar-db/src/main/java/org/sonar/db/component/ComponentKeyUpdaterMapper.java b/sonar-db/src/main/java/org/sonar/db/component/ComponentKeyUpdaterMapper.java
new file mode 100644 (file)
index 0000000..87f44b1
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.db.component;
+
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @since 3.2
+ */
+public interface ComponentKeyUpdaterMapper {
+
+  int countResourceByKey(String key);
+
+  ResourceDto selectProject(@Param("uuid") String uuid);
+
+  List<ResourceDto> selectProjectResources(@Param("rootUuid") String rootUuid);
+
+  List<ResourceDto> selectDescendantProjects(@Param("rootUuid") String rootUuid);
+
+  void update(ResourceDto resource);
+
+}
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
deleted file mode 100644 (file)
index 24fd831..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.db.component;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-import org.apache.commons.lang.StringUtils;
-import org.apache.ibatis.session.SqlSession;
-import org.sonar.api.resources.Qualifiers;
-import org.sonar.db.Dao;
-import org.sonar.db.DbSession;
-import org.sonar.db.MyBatis;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static org.sonar.core.component.ComponentKeys.isValidModuleKey;
-
-/**
- * Class used to rename the key of a project and its resources.
- *
- * @since 3.2
- */
-public class ResourceKeyUpdaterDao implements Dao {
-  private static final Set<String> PROJECT_OR_MODULE_QUALIFIERS = ImmutableSet.of(Qualifiers.PROJECT, Qualifiers.MODULE);
-
-  private MyBatis mybatis;
-
-  public ResourceKeyUpdaterDao(MyBatis mybatis) {
-    this.mybatis = mybatis;
-  }
-
-  public void updateKey(String projectUuid, String newKey) {
-    DbSession session = mybatis.openSession(true);
-    ResourceKeyUpdaterMapper mapper = session.getMapper(ResourceKeyUpdaterMapper.class);
-    try {
-      if (mapper.countResourceByKey(newKey) > 0) {
-        throw new IllegalArgumentException("Impossible to update key: a component with key \"" + newKey + "\" already exists.");
-      }
-
-      // must SELECT first everything
-      ResourceDto project = mapper.selectProject(projectUuid);
-      String projectOldKey = project.getKey();
-      List<ResourceDto> resources = mapper.selectProjectResources(projectUuid);
-      resources.add(project);
-
-      // and then proceed with the batch UPDATE at once
-      runBatchUpdateForAllResources(resources, projectOldKey, newKey, mapper);
-
-      session.commit();
-    } finally {
-      MyBatis.closeQuietly(session);
-    }
-  }
-
-  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(projectUuid, stringToReplace, mapper);
-      for (ResourceDto module : modules) {
-        String newKey = computeNewKey(module, stringToReplace, replacementString);
-        if (mapper.countResourceByKey(newKey) > 0) {
-          result.put(module.getKey(), "#duplicate_key#");
-        } else {
-          result.put(module.getKey(), newKey);
-        }
-      }
-    } finally {
-      MyBatis.closeQuietly(session);
-    }
-    return result;
-  }
-
-  public static void checkIsProjectOrModule(ComponentDto component) {
-    checkArgument(PROJECT_OR_MODULE_QUALIFIERS.contains(component.qualifier()), "Component updated must be a module or a key");
-  }
-
-  /**
-   *
-   * @return a map with currentKey/newKey is a bulk update was executed
-   */
-  public Map<String, String> simulateBulkUpdateKey(DbSession dbSession, String projectUuid, String stringToReplace, String replacementString) {
-    return collectAllModules(projectUuid, stringToReplace, mapper(dbSession))
-      .stream()
-      .collect(Collectors.toMap(
-        ResourceDto::getKey,
-        component -> computeNewKey(component, stringToReplace, replacementString)));
-  }
-
-  /**
-   * @return a map with the component key as key, and boolean as true if key already exists in db
-   */
-  public Map<String, Boolean> checkComponentKeys(DbSession dbSession, List<String> newComponentKeys) {
-    return newComponentKeys.stream().collect(Collectors.toMap(Function.identity(), key -> mapper(dbSession).countResourceByKey(key) > 0));
-  }
-
-  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(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.getUuid()));
-    }
-
-    // and then proceed with the batch UPDATE at once
-    for (ResourceDto module : modules) {
-      String oldModuleKey = module.getKey();
-      String newModuleKey = computeNewKey(module, stringToReplace, replacementString);
-      Collection<ResourceDto> resources = Lists.newArrayList(module);
-      resources.addAll(allResourcesByModuleMap.get(module));
-      runBatchUpdateForAllResources(resources, oldModuleKey, newModuleKey, mapper);
-    }
-  }
-
-  private static String computeNewKey(ResourceDto resource, String stringToReplace, String replacementString) {
-    return resource.getKey().replaceAll(stringToReplace, replacementString);
-  }
-
-  private static void runBatchUpdateForAllResources(Collection<ResourceDto> resources, String oldKey, String newKey, ResourceKeyUpdaterMapper mapper) {
-    for (ResourceDto resource : resources) {
-      String oldResourceKey = resource.getKey();
-      String newResourceKey = newKey + oldResourceKey.substring(oldKey.length(), oldResourceKey.length());
-      resource.setKey(newResourceKey);
-      String oldResourceDeprecatedKey = resource.getDeprecatedKey();
-      if (StringUtils.isNotBlank(oldResourceDeprecatedKey)) {
-        String newResourceDeprecatedKey = newKey + oldResourceDeprecatedKey.substring(oldKey.length(), oldResourceDeprecatedKey.length());
-        resource.setDeprecatedKey(newResourceDeprecatedKey);
-      }
-      mapper.update(resource);
-    }
-  }
-
-  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(projectUuid)) {
-      modules.addAll(collectAllModules(submodule.getUuid(), stringToReplace, mapper));
-    }
-    return modules;
-  }
-
-  private static void checkNewNameOfAllModules(Set<ResourceDto> modules, String stringToReplace, String replacementString, ResourceKeyUpdaterMapper mapper) {
-    for (ResourceDto module : modules) {
-      String newKey = computeNewKey(module, stringToReplace, replacementString);
-      checkArgument(isValidModuleKey(newKey), "Malformed key for '%s'. Allowed characters are alphanumeric, '-', '_', '.' and ':', with at least one non-digit.", newKey);
-      if (mapper.countResourceByKey(newKey) > 0) {
-        throw new IllegalArgumentException("Impossible to update key: a component with key \"" + newKey + "\" already exists.");
-      }
-    }
-  }
-
-  private ResourceKeyUpdaterMapper mapper(DbSession dbSession) {
-    return dbSession.getMapper(ResourceKeyUpdaterMapper.class);
-  }
-}
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
deleted file mode 100644 (file)
index c38ee17..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.db.component;
-
-import java.util.List;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @since 3.2
- */
-public interface ResourceKeyUpdaterMapper {
-
-  int countResourceByKey(String key);
-
-  ResourceDto selectProject(@Param("uuid") String uuid);
-
-  List<ResourceDto> selectProjectResources(@Param("rootUuid") String rootUuid);
-
-  List<ResourceDto> selectDescendantProjects(@Param("rootUuid") String rootUuid);
-
-  void update(ResourceDto resource);
-
-}
diff --git a/sonar-db/src/main/resources/org/sonar/db/component/ComponentKeyUpdaterMapper.xml b/sonar-db/src/main/resources/org/sonar/db/component/ComponentKeyUpdaterMapper.xml
new file mode 100644 (file)
index 0000000..c1adecc
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.sonar.db.component.ComponentKeyUpdaterMapper">
+
+  <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="rootUuid" column="root_uuid"/>
+    <result property="scope" column="scope"/>
+  </resultMap>
+
+  <select id="countResourceByKey" parameterType="String" resultType="int">
+    SELECT count(1)
+    FROM projects
+    WHERE kee = #{key}
+  </select>
+
+  <select id="selectProject" parameterType="String" resultMap="resourceResultMap">
+    select * from projects where uuid=#{uuid}
+  </select>
+
+  <select id="selectProjectResources" parameterType="String" resultMap="resourceResultMap">
+    select * from projects where root_uuid=#{rootUuid} AND scope!='PRJ'
+  </select>
+
+  <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">
+    update projects
+    set kee = #{key}, deprecated_kee = #{deprecatedKey}
+    where id = #{id}
+  </update>
+
+</mapper>
+
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
deleted file mode 100644 (file)
index 0d6bd0f..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="org.sonar.db.component.ResourceKeyUpdaterMapper">
-
-  <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="rootUuid" column="root_uuid"/>
-    <result property="scope" column="scope"/>
-  </resultMap>
-
-  <select id="countResourceByKey" parameterType="String" resultType="int">
-    SELECT count(1)
-    FROM projects
-    WHERE kee = #{key}
-  </select>
-
-  <select id="selectProject" parameterType="String" resultMap="resourceResultMap">
-    select * from projects where uuid=#{uuid}
-  </select>
-
-  <select id="selectProjectResources" parameterType="String" resultMap="resourceResultMap">
-    select * from projects where root_uuid=#{rootUuid} AND scope!='PRJ'
-  </select>
-
-  <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">
-    update projects
-    set kee = #{key}, deprecated_kee = #{deprecatedKey}
-    where id = #{id}
-  </update>
-
-</mapper>
-
diff --git a/sonar-db/src/test/java/org/sonar/db/component/ComponentKeyUpdaterDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/ComponentKeyUpdaterDaoTest.java
new file mode 100644 (file)
index 0000000..518871a
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.db.component;
+
+import com.google.common.base.Strings;
+import java.util.Map;
+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 com.google.common.collect.Lists.newArrayList;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.entry;
+import static org.sonar.db.component.ComponentTesting.newFileDto;
+import static org.sonar.db.component.ComponentTesting.newProjectDto;
+
+public class ComponentKeyUpdaterDaoTest {
+
+  @Rule
+  public ExpectedException thrown = ExpectedException.none();
+
+  @Rule
+  public DbTester db = DbTester.create(System2.INSTANCE);
+  private DbSession dbSession = db.getSession();
+  ComponentDbTester componentDb = new ComponentDbTester(db);
+
+  ComponentKeyUpdaterDao underTest = db.getDbClient().componentKeyUpdaterDao();
+
+  @Test
+  public void shouldUpdateKey() {
+    db.prepareDbUnit(getClass(), "shared.xml");
+
+    underTest.updateKey("B", "struts:core");
+
+    db.assertDbUnit(getClass(), "shouldUpdateKey-result.xml", "projects");
+  }
+
+  @Test
+  public void shouldNotUpdateKey() {
+    db.prepareDbUnit(getClass(), "shared.xml");
+
+    thrown.expect(IllegalArgumentException.class);
+    thrown.expectMessage("Impossible to update key: a component with key \"org.struts:struts-ui\" already exists.");
+
+    underTest.updateKey("B", "org.struts:struts-ui");
+  }
+
+  @Test
+  public void shouldBulkUpdateKey() {
+    db.prepareDbUnit(getClass(), "shared.xml");
+
+    underTest.bulkUpdateKey(dbSession, "A", "org.struts", "org.apache.struts");
+    dbSession.commit();
+
+    db.assertDbUnit(getClass(), "shouldBulkUpdateKey-result.xml", "projects");
+  }
+
+  @Test
+  public void shouldBulkUpdateKeyOnOnlyOneSubmodule() {
+    db.prepareDbUnit(getClass(), "shared.xml");
+
+    underTest.bulkUpdateKey(dbSession, "A", "struts-ui", "struts-web");
+    dbSession.commit();
+
+    db.assertDbUnit(getClass(), "shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml", "projects");
+  }
+
+  @Test
+  public void shouldFailBulkUpdateKeyIfKeyAlreadyExist() {
+    db.prepareDbUnit(getClass(), "shared.xml");
+
+    thrown.expect(IllegalArgumentException.class);
+    thrown.expectMessage("Impossible to update key: a component with key \"foo:struts-core\" already exists.");
+
+    underTest.bulkUpdateKey(dbSession, "A", "org.struts", "foo");
+    dbSession.commit();
+  }
+
+  @Test
+  public void shouldNotUpdateAllSubmodules() {
+    db.prepareDbUnit(getClass(), "shouldNotUpdateAllSubmodules.xml");
+
+    underTest.bulkUpdateKey(dbSession, "A", "org.struts", "org.apache.struts");
+    dbSession.commit();
+
+    db.assertDbUnit(getClass(), "shouldNotUpdateAllSubmodules-result.xml", "projects");
+  }
+
+  @Test
+  public void fail_with_functional_exception_when_sub_component_key_is_longer_than_authorized() {
+    ComponentDto project = newProjectDto("project-uuid").setKey("old-project-key");
+    componentDb.insertComponent(project);
+    componentDb.insertComponent(newFileDto(project).setKey("old-project-key:file"));
+    String newLongProjectKey = Strings.repeat("a", 400);
+    thrown.expect(IllegalArgumentException.class);
+    thrown.expectMessage("Component key length (405) is longer than the maximum authorized (400). '" + newLongProjectKey + ":file' was provided.");
+
+    underTest.updateKey(project.uuid(), newLongProjectKey);
+  }
+
+  @Test
+  public void fail_when_new_key_is_invalid() {
+    ComponentDto project = componentDb.insertProject();
+
+    thrown.expect(IllegalArgumentException.class);
+    thrown.expectMessage("Malformed key for 'my?project?key'. Allowed characters are alphanumeric, '-', '_', '.' and ':', with at least one non-digit.");
+
+    underTest.bulkUpdateKey(dbSession, project.uuid(), project.key(), "my?project?key");
+  }
+
+  @Test
+  public void shouldCheckModuleKeysBeforeRenaming() {
+    db.prepareDbUnit(getClass(), "shared.xml");
+
+    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#");
+    assertThat(checkResults.get("org.struts:struts-ui")).isEqualTo("foo:struts-ui");
+  }
+
+  @Test
+  public void check_component_keys() {
+    db.prepareDbUnit(getClass(), "shared.xml");
+
+    Map<String, Boolean> result = underTest.checkComponentKeys(dbSession, newArrayList("foo:struts", "foo:struts-core", "foo:struts-ui"));
+
+    assertThat(result)
+      .hasSize(3)
+      .containsOnly(entry("foo:struts", false), entry("foo:struts-core", true), entry("foo:struts-ui", false));
+  }
+
+  @Test
+  public void simulate_bulk_update_key() {
+    db.prepareDbUnit(getClass(), "shared.xml");
+
+    Map<String, String> result = underTest.simulateBulkUpdateKey(dbSession, "A", "org.struts", "foo");
+
+    assertThat(result)
+      .hasSize(3)
+      .containsOnly(entry("org.struts:struts", "foo:struts"), entry("org.struts:struts-core", "foo:struts-core"), entry("org.struts:struts-ui", "foo:struts-ui"));
+  }
+}
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
deleted file mode 100644 (file)
index fc6fe33..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.db.component;
-
-import com.google.common.base.Strings;
-import java.util.Map;
-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 com.google.common.collect.Lists.newArrayList;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.entry;
-import static org.sonar.db.component.ComponentTesting.newFileDto;
-import static org.sonar.db.component.ComponentTesting.newProjectDto;
-
-public class ResourceKeyUpdaterDaoTest {
-
-  @Rule
-  public ExpectedException thrown = ExpectedException.none();
-
-  @Rule
-  public DbTester db = DbTester.create(System2.INSTANCE);
-  private DbSession dbSession = db.getSession();
-  ComponentDbTester componentDb = new ComponentDbTester(db);
-
-  ResourceKeyUpdaterDao underTest = db.getDbClient().resourceKeyUpdaterDao();
-
-  @Test
-  public void shouldUpdateKey() {
-    db.prepareDbUnit(getClass(), "shared.xml");
-
-    underTest.updateKey("B", "struts:core");
-
-    db.assertDbUnit(getClass(), "shouldUpdateKey-result.xml", "projects");
-  }
-
-  @Test
-  public void shouldNotUpdateKey() {
-    db.prepareDbUnit(getClass(), "shared.xml");
-
-    thrown.expect(IllegalArgumentException.class);
-    thrown.expectMessage("Impossible to update key: a component with key \"org.struts:struts-ui\" already exists.");
-
-    underTest.updateKey("B", "org.struts:struts-ui");
-  }
-
-  @Test
-  public void shouldBulkUpdateKey() {
-    db.prepareDbUnit(getClass(), "shared.xml");
-
-    underTest.bulkUpdateKey(dbSession, "A", "org.struts", "org.apache.struts");
-    dbSession.commit();
-
-    db.assertDbUnit(getClass(), "shouldBulkUpdateKey-result.xml", "projects");
-  }
-
-  @Test
-  public void shouldBulkUpdateKeyOnOnlyOneSubmodule() {
-    db.prepareDbUnit(getClass(), "shared.xml");
-
-    underTest.bulkUpdateKey(dbSession, "A", "struts-ui", "struts-web");
-    dbSession.commit();
-
-    db.assertDbUnit(getClass(), "shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml", "projects");
-  }
-
-  @Test
-  public void shouldFailBulkUpdateKeyIfKeyAlreadyExist() {
-    db.prepareDbUnit(getClass(), "shared.xml");
-
-    thrown.expect(IllegalArgumentException.class);
-    thrown.expectMessage("Impossible to update key: a component with key \"foo:struts-core\" already exists.");
-
-    underTest.bulkUpdateKey(dbSession, "A", "org.struts", "foo");
-    dbSession.commit();
-  }
-
-  @Test
-  public void shouldNotUpdateAllSubmodules() {
-    db.prepareDbUnit(getClass(), "shouldNotUpdateAllSubmodules.xml");
-
-    underTest.bulkUpdateKey(dbSession, "A", "org.struts", "org.apache.struts");
-    dbSession.commit();
-
-    db.assertDbUnit(getClass(), "shouldNotUpdateAllSubmodules-result.xml", "projects");
-  }
-
-  @Test
-  public void fail_with_functional_exception_when_sub_component_key_is_longer_than_authorized() {
-    ComponentDto project = newProjectDto("project-uuid").setKey("old-project-key");
-    componentDb.insertComponent(project);
-    componentDb.insertComponent(newFileDto(project).setKey("old-project-key:file"));
-    String newLongProjectKey = Strings.repeat("a", 400);
-    thrown.expect(IllegalArgumentException.class);
-    thrown.expectMessage("Component key length (405) is longer than the maximum authorized (400). '" + newLongProjectKey + ":file' was provided.");
-
-    underTest.updateKey(project.uuid(), newLongProjectKey);
-  }
-
-  @Test
-  public void fail_when_new_key_is_invalid() {
-    ComponentDto project = componentDb.insertProject();
-
-    thrown.expect(IllegalArgumentException.class);
-    thrown.expectMessage("Malformed key for 'my?project?key'. Allowed characters are alphanumeric, '-', '_', '.' and ':', with at least one non-digit.");
-
-    underTest.bulkUpdateKey(dbSession, project.uuid(), project.key(), "my?project?key");
-  }
-
-  @Test
-  public void shouldCheckModuleKeysBeforeRenaming() {
-    db.prepareDbUnit(getClass(), "shared.xml");
-
-    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#");
-    assertThat(checkResults.get("org.struts:struts-ui")).isEqualTo("foo:struts-ui");
-  }
-
-  @Test
-  public void check_component_keys() {
-    db.prepareDbUnit(getClass(), "shared.xml");
-
-    Map<String, Boolean> result = underTest.checkComponentKeys(dbSession, newArrayList("foo:struts", "foo:struts-core", "foo:struts-ui"));
-
-    assertThat(result)
-      .hasSize(3)
-      .containsOnly(entry("foo:struts", false), entry("foo:struts-core", true), entry("foo:struts-ui", false));
-  }
-
-  @Test
-  public void simulate_bulk_update_key() {
-    db.prepareDbUnit(getClass(), "shared.xml");
-
-    Map<String, String> result = underTest.simulateBulkUpdateKey(dbSession, "A", "org.struts", "foo");
-
-    assertThat(result)
-      .hasSize(3)
-      .containsOnly(entry("org.struts:struts", "foo:struts"), entry("org.struts:struts-core", "foo:struts-core"), entry("org.struts:struts-ui", "foo:struts-ui"));
-  }
-}
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shared.xml
new file mode 100644 (file)
index 0000000..2c9b3ee
--- /dev/null
@@ -0,0 +1,270 @@
+<dataset>
+
+  <!-- root project -->
+  <projects id="1"
+            root_uuid="A"
+            scope="PRJ"
+            qualifier="TRK"
+            kee="org.struts:struts"
+            name="Struts"
+            uuid="A"
+            uuid_path="A."
+            project_uuid="A"
+            module_uuid="[null]"
+            module_uuid_path="."
+            description="[null]"
+            long_name="Apache Struts"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+  Â²
+
+  <!-- **************** First sub project **************** -->
+  <projects id="2"
+            root_uuid="A"
+            kee="org.struts:struts-core"
+            name="Struts Core"
+            uuid="B"
+            uuid_path="A.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"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-core"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="B"
+            uuid="C"
+            uuid_path="A.B.C."
+            project_uuid="A"
+            module_uuid="B"
+            module_uuid_path=".A.B."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-core:org.struts"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="B"
+            uuid="D"
+            uuid_path="A.B.C.D."
+            project_uuid="A"
+            module_uuid="B"
+            module_uuid_path=".A.B."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-core:org.struts.RequestContext"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** Second sub project **************** -->
+  <projects id="5"
+            root_uuid="A"
+            kee="org.struts:struts-ui"
+            name="Struts UI"
+            uuid="E"
+            uuid_path="A.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"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-ui"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="E"
+            uuid="F"
+            uuid_path="A.E.F."
+            project_uuid="[null]"
+            module_uuid="[null]"
+            module_uuid_path=".E."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-ui:org.struts"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="E"
+            uuid="G"
+            uuid_path="A.E.F.G."
+            project_uuid="[null]"
+            module_uuid="[null]"
+            module_uuid_path=".E."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-ui:org.struts.RequestContext"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** Another independent project **************** -->
+  <projects id="8"
+            root_uuid="A"
+            kee="foo:struts-core"
+            name="Foo Struts Core"
+            uuid="H"
+            uuid_path="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"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="foo:struts-core"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldBulkUpdateKey-result.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldBulkUpdateKey-result.xml
new file mode 100644 (file)
index 0000000..7548d17
--- /dev/null
@@ -0,0 +1,286 @@
+<dataset>
+
+  <!-- root project -->
+  <projects id="1"
+            root_uuid="A"
+            scope="PRJ"
+            qualifier="TRK"
+            kee="org.apache.struts:struts"
+            name="Struts"
+            uuid="A"
+            uuid_path="A."
+            project_uuid="A"
+            module_uuid="[null]"
+            module_uuid_path="."
+            description="[null]"
+            long_name="Apache Struts"
+            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]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** First sub project **************** -->
+  <projects id="2"
+            root_uuid="A"
+            kee="org.apache.struts:struts-core"
+            name="Struts Core"
+            uuid="B"
+            uuid_path="A.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_component_uuid="[null]"
+            developer_uuid="[null]"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.apache.struts:struts-core"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="B"
+            uuid="C"
+            uuid_path="A.B.C."
+            project_uuid="A"
+            module_uuid="B"
+            module_uuid_path=".A.B."
+            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:org.struts"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="B"
+            uuid="D"
+            uuid_path="A.B.C.D."
+            project_uuid="A"
+            module_uuid="B"
+            module_uuid_path=".A.B."
+            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:org.struts.RequestContext"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** Second sub project **************** -->
+  <projects id="5"
+            root_uuid="A"
+            kee="org.apache.struts:struts-ui"
+            name="Struts UI"
+            uuid="E"
+            uuid_path="A.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_component_uuid="[null]"
+            developer_uuid="[null]"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.apache.struts:struts-ui"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="E"
+            uuid="F"
+            uuid_path="A.E.F."
+            project_uuid="[null]"
+            module_uuid="[null]"
+            module_uuid_path=".E."
+            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:org.struts"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="E"
+            uuid="G"
+            uuid_path="A.E.F.G."
+            project_uuid="[null]"
+            module_uuid="[null]"
+            module_uuid_path=".E."
+            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:org.struts.RequestContext"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** Another independent project **************** -->
+  <projects id="8"
+            root_uuid="A"
+            kee="foo:struts-core"
+            name="Foo Struts Core"
+            uuid="H"
+            uuid_path="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_component_uuid="[null]"
+            developer_uuid="[null]"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="foo:struts-core"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldBulkUpdateKeyOnOnlyOneSubmodule-result.xml
new file mode 100644 (file)
index 0000000..ced8067
--- /dev/null
@@ -0,0 +1,286 @@
+<dataset>
+
+  <!-- root project -->
+  <projects id="1"
+            root_uuid="A"
+            scope="PRJ"
+            qualifier="TRK"
+            kee="org.struts:struts"
+            name="Struts"
+            uuid="A"
+            uuid_path="A."
+            project_uuid="A"
+            module_uuid="[null]"
+            module_uuid_path="."
+            description="[null]"
+            long_name="Apache Struts"
+            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]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** First sub project **************** -->
+  <projects id="2"
+            root_uuid="A"
+            kee="org.struts:struts-core"
+            name="Struts Core"
+            uuid="B"
+            uuid_path="A.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_component_uuid="[null]"
+            developer_uuid="[null]"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-core"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="B"
+            uuid="C"
+            uuid_path="A.B.C."
+            project_uuid="A"
+            module_uuid="B"
+            module_uuid_path=".A.B."
+            description="[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]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="B"
+            uuid="D"
+            uuid_path="A.B.C.D."
+            project_uuid="A"
+            module_uuid="B"
+            module_uuid_path=".A.B."
+            description="[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]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** Second sub project **************** -->
+  <projects id="5"
+            root_uuid="A"
+            kee="org.struts:struts-web"
+            name="Struts UI"
+            uuid="E"
+            uuid_path="A.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_component_uuid="[null]"
+            developer_uuid="[null]"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-web"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="E"
+            uuid="F"
+            uuid_path="A.E.F."
+            project_uuid="[null]"
+            module_uuid="[null]"
+            module_uuid_path=".E."
+            description="[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]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="E"
+            uuid="G"
+            uuid_path="A.E.F.G."
+            project_uuid="[null]"
+            module_uuid="[null]"
+            module_uuid_path=".E."
+            description="[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]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** Another independent project **************** -->
+  <projects id="8"
+            root_uuid="A"
+            kee="foo:struts-core"
+            name="Foo Struts Core"
+            uuid="H"
+            uuid_path="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_component_uuid="[null]"
+            developer_uuid="[null]"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="foo:struts-core"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules-result.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules-result.xml
new file mode 100644 (file)
index 0000000..e789eff
--- /dev/null
@@ -0,0 +1,238 @@
+<dataset>
+
+  <!-- root project -->
+  <projects id="1"
+            root_uuid="A"
+            scope="PRJ"
+            qualifier="TRK"
+            kee="org.apache.struts:struts"
+            name="Struts"
+            uuid="A"
+            uuid_path="A."
+            project_uuid="A"
+            module_uuid="[null]"
+            module_uuid_path="."
+            description="[null]"
+            long_name="Apache Struts"
+            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]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** First sub project **************** -->
+  <projects id="2"
+            root_uuid="A"
+            kee="org.apache.struts:struts-core"
+            name="Struts Core"
+            uuid="B"
+            uuid_path="A.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"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.apache.struts:struts-core"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="B"
+            uuid="C"
+            uuid_path="A.B.C."
+            project_uuid="A"
+            module_uuid="B"
+            module_uuid_path=".A.B."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.apache.struts:struts-core:org.struts"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="B"
+            uuid="D"
+            uuid_path="A.B.C.D."
+            project_uuid="A"
+            module_uuid="B"
+            module_uuid_path=".A.B."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.apache.struts:struts-core:org.struts.RequestContext"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** Second sub project THAT HAS A DIFFERENT GROUP ID => MUST NOT BE UPDATED **************** -->
+  <projects id="5"
+            root_uuid="A"
+            kee="foo:struts-ui"
+            name="Struts UI"
+            uuid="E"
+            uuid_path="A.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"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="foo:struts-ui"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+  <!-- directory -->
+  <projects long_name="org.struts"
+            id="6"
+            scope="DIR"
+            qualifier="PAC"
+            kee="foo:struts-ui:/src/org/struts"
+            name="org.struts"
+            root_uuid="E"
+            uuid="F"
+            uuid_path="A.E.F."
+            project_uuid="[null]"
+            module_uuid="[null]"
+            module_uuid_path=".E."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="foo:struts-ui:org.struts"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="E"
+            uuid="G"
+            uuid_path="A.E.F.G."
+            project_uuid="[null]"
+            module_uuid="[null]"
+            module_uuid_path=".E."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="foo:struts-ui:org.struts.RequestContext"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldNotUpdateAllSubmodules.xml
new file mode 100644 (file)
index 0000000..efcbeeb
--- /dev/null
@@ -0,0 +1,231 @@
+<dataset>
+
+  <!-- root project -->
+  <projects id="1"
+            root_uuid="A"
+            scope="PRJ"
+            qualifier="TRK"
+            kee="org.struts:struts"
+            name="Struts"
+            uuid="A"
+            uuid_path="A."
+            project_uuid="A"
+            module_uuid="[null]"
+            module_uuid_path="."
+            description="[null]"
+            long_name="Apache Struts"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** First sub project **************** -->
+  <projects id="2"
+            root_uuid="A"
+            kee="org.struts:struts-core"
+            name="Struts Core"
+            uuid="B"
+            uuid_path="A.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"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-core"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="B"
+            uuid="C"
+            uuid_path="A.B.C."
+            project_uuid="A"
+            module_uuid="B"
+            module_uuid_path=".A.B."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-core:org.struts"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="B"
+            uuid="D"
+            uuid_path="A.B.C.D."
+            project_uuid="A"
+            module_uuid="B"
+            module_uuid_path=".A.B."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-core:org.struts.RequestContext"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"/>
+
+
+  <!-- **************** Second sub project THAT HAS A DIFFERENT GROUP ID => MUST NOT BE UPDATED **************** -->
+  <projects id="5"
+            root_uuid="A"
+            kee="foo:struts-ui"
+            name="Struts UI"
+            uuid="E"
+            uuid_path="A.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"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="foo:struts-ui"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"/>
+
+  <!-- directory -->
+  <projects long_name="org.struts"
+            id="6"
+            scope="DIR"
+            qualifier="PAC"
+            kee="foo:struts-ui:/src/org/struts"
+            name="org.struts"
+            root_uuid="E"
+            uuid="F"
+            uuid_path="A.E.F."
+            project_uuid="[null]"
+            module_uuid="[null]"
+            module_uuid_path=".E."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="foo:struts-ui:org.struts"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="E"
+            uuid="G"
+            uuid_path="A.E.F.G."
+            project_uuid="[null]"
+            module_uuid="[null]"
+            module_uuid_path=".E."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="foo:struts-ui:org.struts.RequestContext"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldUpdateKey-result.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentKeyUpdaterDaoTest/shouldUpdateKey-result.xml
new file mode 100644 (file)
index 0000000..b077221
--- /dev/null
@@ -0,0 +1,274 @@
+<dataset>
+
+  <!-- root project -->
+  <projects id="1"
+            root_uuid="A"
+            scope="PRJ"
+            qualifier="TRK"
+            kee="org.struts:struts"
+            name="Struts"
+            uuid="A"
+            uuid_path="A."
+            project_uuid="A"
+            module_uuid="[null]"
+            module_uuid_path="."
+            description="[null]"
+            long_name="Apache Struts"
+            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]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** First sub project **************** -->
+  <!-- ONLY THIS PROJECT MUST HAVE BEEN UPDATED            -->
+  <!--                                                     -->
+  <projects id="2"
+            root_uuid="A"
+            kee="struts:core"
+            name="Struts Core"
+            uuid="B"
+            uuid_path="A.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"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="struts:core"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+  <!-- directory -->
+  <projects long_name="org.struts"
+            id="3"
+            scope="DIR"
+            qualifier="DIR"
+            kee="struts:core:/src/org/struts"
+            name="org.struts"
+            root_uuid="B"
+            uuid="C"
+            uuid_path="A.B.C."
+            project_uuid="A"
+            module_uuid="B"
+            module_uuid_path=".A.B."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="struts:core:org.struts"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="B"
+            uuid="D"
+            uuid_path="A.B.C.D."
+            project_uuid="A"
+            module_uuid="B"
+            module_uuid_path=".A.B."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="struts:core:org.struts.RequestContext"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** Second sub project **************** -->
+  <projects id="5"
+            root_uuid="A"
+            kee="org.struts:struts-ui"
+            name="Struts UI"
+            uuid="E"
+            uuid_path="A.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"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-ui"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="E"
+            uuid="F"
+            uuid_path="A.E.F."
+            project_uuid="[null]"
+            module_uuid="[null]"
+            module_uuid_path=".E."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-ui:org.struts"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[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_uuid="E"
+            uuid="G"
+            uuid_path="A.E.F.G."
+            project_uuid="[null]"
+            module_uuid="[null]"
+            module_uuid_path=".E."
+            description="[null]"
+            enabled="[true]"
+            language="java"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="org.struts:struts-ui:org.struts.RequestContext"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+
+  <!-- **************** Another independent project **************** -->
+  <projects id="8"
+            root_uuid="A"
+            kee="foo:struts-core"
+            name="Foo Struts Core"
+            uuid="H"
+            uuid_path="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"
+            created_at="[null]"
+            path="[null]"
+            deprecated_kee="foo:struts-core"
+            authorization_updated_at="[null]"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"
+  />
+
+</dataset>
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
deleted file mode 100644 (file)
index 2c9b3ee..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-<dataset>
-
-  <!-- root project -->
-  <projects id="1"
-            root_uuid="A"
-            scope="PRJ"
-            qualifier="TRK"
-            kee="org.struts:struts"
-            name="Struts"
-            uuid="A"
-            uuid_path="A."
-            project_uuid="A"
-            module_uuid="[null]"
-            module_uuid_path="."
-            description="[null]"
-            long_name="Apache Struts"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-  Â²
-
-  <!-- **************** First sub project **************** -->
-  <projects id="2"
-            root_uuid="A"
-            kee="org.struts:struts-core"
-            name="Struts Core"
-            uuid="B"
-            uuid_path="A.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"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-core"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="B"
-            uuid="C"
-            uuid_path="A.B.C."
-            project_uuid="A"
-            module_uuid="B"
-            module_uuid_path=".A.B."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-core:org.struts"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="B"
-            uuid="D"
-            uuid_path="A.B.C.D."
-            project_uuid="A"
-            module_uuid="B"
-            module_uuid_path=".A.B."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-core:org.struts.RequestContext"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** Second sub project **************** -->
-  <projects id="5"
-            root_uuid="A"
-            kee="org.struts:struts-ui"
-            name="Struts UI"
-            uuid="E"
-            uuid_path="A.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"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-ui"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="E"
-            uuid="F"
-            uuid_path="A.E.F."
-            project_uuid="[null]"
-            module_uuid="[null]"
-            module_uuid_path=".E."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-ui:org.struts"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="E"
-            uuid="G"
-            uuid_path="A.E.F.G."
-            project_uuid="[null]"
-            module_uuid="[null]"
-            module_uuid_path=".E."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-ui:org.struts.RequestContext"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** Another independent project **************** -->
-  <projects id="8"
-            root_uuid="A"
-            kee="foo:struts-core"
-            name="Foo Struts Core"
-            uuid="H"
-            uuid_path="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"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="foo:struts-core"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-</dataset>
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
deleted file mode 100644 (file)
index 7548d17..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-<dataset>
-
-  <!-- root project -->
-  <projects id="1"
-            root_uuid="A"
-            scope="PRJ"
-            qualifier="TRK"
-            kee="org.apache.struts:struts"
-            name="Struts"
-            uuid="A"
-            uuid_path="A."
-            project_uuid="A"
-            module_uuid="[null]"
-            module_uuid_path="."
-            description="[null]"
-            long_name="Apache Struts"
-            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]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** First sub project **************** -->
-  <projects id="2"
-            root_uuid="A"
-            kee="org.apache.struts:struts-core"
-            name="Struts Core"
-            uuid="B"
-            uuid_path="A.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_component_uuid="[null]"
-            developer_uuid="[null]"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.apache.struts:struts-core"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="B"
-            uuid="C"
-            uuid_path="A.B.C."
-            project_uuid="A"
-            module_uuid="B"
-            module_uuid_path=".A.B."
-            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:org.struts"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="B"
-            uuid="D"
-            uuid_path="A.B.C.D."
-            project_uuid="A"
-            module_uuid="B"
-            module_uuid_path=".A.B."
-            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:org.struts.RequestContext"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** Second sub project **************** -->
-  <projects id="5"
-            root_uuid="A"
-            kee="org.apache.struts:struts-ui"
-            name="Struts UI"
-            uuid="E"
-            uuid_path="A.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_component_uuid="[null]"
-            developer_uuid="[null]"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.apache.struts:struts-ui"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="E"
-            uuid="F"
-            uuid_path="A.E.F."
-            project_uuid="[null]"
-            module_uuid="[null]"
-            module_uuid_path=".E."
-            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:org.struts"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="E"
-            uuid="G"
-            uuid_path="A.E.F.G."
-            project_uuid="[null]"
-            module_uuid="[null]"
-            module_uuid_path=".E."
-            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:org.struts.RequestContext"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** Another independent project **************** -->
-  <projects id="8"
-            root_uuid="A"
-            kee="foo:struts-core"
-            name="Foo Struts Core"
-            uuid="H"
-            uuid_path="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_component_uuid="[null]"
-            developer_uuid="[null]"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="foo:struts-core"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-</dataset>
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
deleted file mode 100644 (file)
index ced8067..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-<dataset>
-
-  <!-- root project -->
-  <projects id="1"
-            root_uuid="A"
-            scope="PRJ"
-            qualifier="TRK"
-            kee="org.struts:struts"
-            name="Struts"
-            uuid="A"
-            uuid_path="A."
-            project_uuid="A"
-            module_uuid="[null]"
-            module_uuid_path="."
-            description="[null]"
-            long_name="Apache Struts"
-            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]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** First sub project **************** -->
-  <projects id="2"
-            root_uuid="A"
-            kee="org.struts:struts-core"
-            name="Struts Core"
-            uuid="B"
-            uuid_path="A.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_component_uuid="[null]"
-            developer_uuid="[null]"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-core"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="B"
-            uuid="C"
-            uuid_path="A.B.C."
-            project_uuid="A"
-            module_uuid="B"
-            module_uuid_path=".A.B."
-            description="[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]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="B"
-            uuid="D"
-            uuid_path="A.B.C.D."
-            project_uuid="A"
-            module_uuid="B"
-            module_uuid_path=".A.B."
-            description="[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]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** Second sub project **************** -->
-  <projects id="5"
-            root_uuid="A"
-            kee="org.struts:struts-web"
-            name="Struts UI"
-            uuid="E"
-            uuid_path="A.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_component_uuid="[null]"
-            developer_uuid="[null]"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-web"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="E"
-            uuid="F"
-            uuid_path="A.E.F."
-            project_uuid="[null]"
-            module_uuid="[null]"
-            module_uuid_path=".E."
-            description="[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]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="E"
-            uuid="G"
-            uuid_path="A.E.F.G."
-            project_uuid="[null]"
-            module_uuid="[null]"
-            module_uuid_path=".E."
-            description="[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]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** Another independent project **************** -->
-  <projects id="8"
-            root_uuid="A"
-            kee="foo:struts-core"
-            name="Foo Struts Core"
-            uuid="H"
-            uuid_path="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_component_uuid="[null]"
-            developer_uuid="[null]"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="foo:struts-core"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-</dataset>
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
deleted file mode 100644 (file)
index e789eff..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-<dataset>
-
-  <!-- root project -->
-  <projects id="1"
-            root_uuid="A"
-            scope="PRJ"
-            qualifier="TRK"
-            kee="org.apache.struts:struts"
-            name="Struts"
-            uuid="A"
-            uuid_path="A."
-            project_uuid="A"
-            module_uuid="[null]"
-            module_uuid_path="."
-            description="[null]"
-            long_name="Apache Struts"
-            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]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** First sub project **************** -->
-  <projects id="2"
-            root_uuid="A"
-            kee="org.apache.struts:struts-core"
-            name="Struts Core"
-            uuid="B"
-            uuid_path="A.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"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.apache.struts:struts-core"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="B"
-            uuid="C"
-            uuid_path="A.B.C."
-            project_uuid="A"
-            module_uuid="B"
-            module_uuid_path=".A.B."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.apache.struts:struts-core:org.struts"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="B"
-            uuid="D"
-            uuid_path="A.B.C.D."
-            project_uuid="A"
-            module_uuid="B"
-            module_uuid_path=".A.B."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.apache.struts:struts-core:org.struts.RequestContext"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** Second sub project THAT HAS A DIFFERENT GROUP ID => MUST NOT BE UPDATED **************** -->
-  <projects id="5"
-            root_uuid="A"
-            kee="foo:struts-ui"
-            name="Struts UI"
-            uuid="E"
-            uuid_path="A.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"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="foo:struts-ui"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-  <!-- directory -->
-  <projects long_name="org.struts"
-            id="6"
-            scope="DIR"
-            qualifier="PAC"
-            kee="foo:struts-ui:/src/org/struts"
-            name="org.struts"
-            root_uuid="E"
-            uuid="F"
-            uuid_path="A.E.F."
-            project_uuid="[null]"
-            module_uuid="[null]"
-            module_uuid_path=".E."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="foo:struts-ui:org.struts"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="E"
-            uuid="G"
-            uuid_path="A.E.F.G."
-            project_uuid="[null]"
-            module_uuid="[null]"
-            module_uuid_path=".E."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="foo:struts-ui:org.struts.RequestContext"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-</dataset>
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
deleted file mode 100644 (file)
index efcbeeb..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-<dataset>
-
-  <!-- root project -->
-  <projects id="1"
-            root_uuid="A"
-            scope="PRJ"
-            qualifier="TRK"
-            kee="org.struts:struts"
-            name="Struts"
-            uuid="A"
-            uuid_path="A."
-            project_uuid="A"
-            module_uuid="[null]"
-            module_uuid_path="."
-            description="[null]"
-            long_name="Apache Struts"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** First sub project **************** -->
-  <projects id="2"
-            root_uuid="A"
-            kee="org.struts:struts-core"
-            name="Struts Core"
-            uuid="B"
-            uuid_path="A.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"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-core"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="B"
-            uuid="C"
-            uuid_path="A.B.C."
-            project_uuid="A"
-            module_uuid="B"
-            module_uuid_path=".A.B."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-core:org.struts"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="B"
-            uuid="D"
-            uuid_path="A.B.C.D."
-            project_uuid="A"
-            module_uuid="B"
-            module_uuid_path=".A.B."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-core:org.struts.RequestContext"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"/>
-
-
-  <!-- **************** Second sub project THAT HAS A DIFFERENT GROUP ID => MUST NOT BE UPDATED **************** -->
-  <projects id="5"
-            root_uuid="A"
-            kee="foo:struts-ui"
-            name="Struts UI"
-            uuid="E"
-            uuid_path="A.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"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="foo:struts-ui"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"/>
-
-  <!-- directory -->
-  <projects long_name="org.struts"
-            id="6"
-            scope="DIR"
-            qualifier="PAC"
-            kee="foo:struts-ui:/src/org/struts"
-            name="org.struts"
-            root_uuid="E"
-            uuid="F"
-            uuid_path="A.E.F."
-            project_uuid="[null]"
-            module_uuid="[null]"
-            module_uuid_path=".E."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="foo:struts-ui:org.struts"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="E"
-            uuid="G"
-            uuid_path="A.E.F.G."
-            project_uuid="[null]"
-            module_uuid="[null]"
-            module_uuid_path=".E."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="foo:struts-ui:org.struts.RequestContext"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-</dataset>
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
deleted file mode 100644 (file)
index b077221..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-<dataset>
-
-  <!-- root project -->
-  <projects id="1"
-            root_uuid="A"
-            scope="PRJ"
-            qualifier="TRK"
-            kee="org.struts:struts"
-            name="Struts"
-            uuid="A"
-            uuid_path="A."
-            project_uuid="A"
-            module_uuid="[null]"
-            module_uuid_path="."
-            description="[null]"
-            long_name="Apache Struts"
-            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]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** First sub project **************** -->
-  <!-- ONLY THIS PROJECT MUST HAVE BEEN UPDATED            -->
-  <!--                                                     -->
-  <projects id="2"
-            root_uuid="A"
-            kee="struts:core"
-            name="Struts Core"
-            uuid="B"
-            uuid_path="A.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"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="struts:core"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-  <!-- directory -->
-  <projects long_name="org.struts"
-            id="3"
-            scope="DIR"
-            qualifier="DIR"
-            kee="struts:core:/src/org/struts"
-            name="org.struts"
-            root_uuid="B"
-            uuid="C"
-            uuid_path="A.B.C."
-            project_uuid="A"
-            module_uuid="B"
-            module_uuid_path=".A.B."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="struts:core:org.struts"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="B"
-            uuid="D"
-            uuid_path="A.B.C.D."
-            project_uuid="A"
-            module_uuid="B"
-            module_uuid_path=".A.B."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="struts:core:org.struts.RequestContext"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** Second sub project **************** -->
-  <projects id="5"
-            root_uuid="A"
-            kee="org.struts:struts-ui"
-            name="Struts UI"
-            uuid="E"
-            uuid_path="A.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"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-ui"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="E"
-            uuid="F"
-            uuid_path="A.E.F."
-            project_uuid="[null]"
-            module_uuid="[null]"
-            module_uuid_path=".E."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-ui:org.struts"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[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_uuid="E"
-            uuid="G"
-            uuid_path="A.E.F.G."
-            project_uuid="[null]"
-            module_uuid="[null]"
-            module_uuid_path=".E."
-            description="[null]"
-            enabled="[true]"
-            language="java"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="org.struts:struts-ui:org.struts.RequestContext"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-
-  <!-- **************** Another independent project **************** -->
-  <projects id="8"
-            root_uuid="A"
-            kee="foo:struts-core"
-            name="Foo Struts Core"
-            uuid="H"
-            uuid_path="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"
-            created_at="[null]"
-            path="[null]"
-            deprecated_kee="foo:struts-core"
-            authorization_updated_at="[null]"
-            b_changed="[false]"
-            b_copy_component_uuid="[null]"
-            b_description="[null]"
-            b_enabled="[false]"
-            b_language="[null]"
-            b_long_name="[null]"
-            b_module_uuid="[null]"
-            b_module_uuid_path="[null]"
-            b_name="[null]"
-            b_path="[null]"
-            b_qualifier="[null]"
-  />
-
-</dataset>