diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2016-10-25 14:19:25 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2016-10-25 15:34:48 +0200 |
commit | 8836dd4591462784a67c9adc77764ca2b876f241 (patch) | |
tree | 065a0d9ee8e5a4b237b3382742548afbf09bc04e /sonar-db/src | |
parent | 6dce6c46c7ebfa4408b09d8be40b519671afb1c5 (diff) | |
download | sonarqube-8836dd4591462784a67c9adc77764ca2b876f241.tar.gz sonarqube-8836dd4591462784a67c9adc77764ca2b876f241.zip |
SONAR-8160 WS measures/search handles permission check on several projects
Diffstat (limited to 'sonar-db/src')
-rw-r--r-- | sonar-db/src/test/java/org/sonar/db/component/ComponentTesting.java | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/sonar-db/src/test/java/org/sonar/db/component/ComponentTesting.java b/sonar-db/src/test/java/org/sonar/db/component/ComponentTesting.java index e1b2f364b3b..f26cb90d4b0 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/ComponentTesting.java +++ b/sonar-db/src/test/java/org/sonar/db/component/ComponentTesting.java @@ -30,6 +30,10 @@ import static org.sonar.db.component.ComponentDto.UUID_PATH_SEPARATOR; public class ComponentTesting { + public static ComponentDto newFileDto(ComponentDto subProjectOrProject) { + return newFileDto(subProjectOrProject, null); + } + public static ComponentDto newFileDto(ComponentDto subProjectOrProject, @Nullable ComponentDto directory) { return newFileDto(subProjectOrProject, directory, Uuids.create()); } @@ -53,21 +57,21 @@ public class ComponentTesting { public static ComponentDto newDirectory(ComponentDto module, String uuid, String path) { return newChildComponent(uuid, module, module) - .setKey(!path.equals("/") ? module.getKey() + ":" + path : module.getKey() + ":/") - .setName(path) - .setLongName(path) - .setPath(path) - .setScope(Scopes.DIRECTORY) - .setQualifier(Qualifiers.DIRECTORY); + .setKey(!path.equals("/") ? module.getKey() + ":" + path : module.getKey() + ":/") + .setName(path) + .setLongName(path) + .setPath(path) + .setScope(Scopes.DIRECTORY) + .setQualifier(Qualifiers.DIRECTORY); } public static ComponentDto newSubView(ComponentDto viewOrSubView, String uuid, String key) { return newChildComponent(uuid, viewOrSubView, viewOrSubView) - .setKey(key) - .setName(key) - .setLongName(key) - .setScope(Scopes.PROJECT) - .setQualifier(Qualifiers.SUBVIEW); + .setKey(key) + .setName(key) + .setLongName(key) + .setScope(Scopes.PROJECT) + .setQualifier(Qualifiers.SUBVIEW); } public static ComponentDto newModuleDto(String uuid, ComponentDto parentModuleOrProject) { @@ -120,7 +124,7 @@ public class ComponentTesting { .setName(name) .setLongName(name) .setScope(Scopes.PROJECT) - // XXX No constant ! + // XXX No constant ! .setQualifier("DEV") .setPath(null) .setLanguage(null) |