diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-08-14 18:08:34 +0200 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-08-24 14:00:31 +0200 |
commit | 583b7c63135c21a6ffbdbf111074b6642476d221 (patch) | |
tree | 54988119b3ee5ea98bf97ad403b96d6683dd95d4 /sonar-db | |
parent | f5f10c7b7605deab98ed384de1580c47c8bbad6b (diff) | |
download | sonarqube-583b7c63135c21a6ffbdbf111074b6642476d221.tar.gz sonarqube-583b7c63135c21a6ffbdbf111074b6642476d221.zip |
make PersistSnapshotsStep support Views Components
Diffstat (limited to 'sonar-db')
-rw-r--r-- | sonar-db/src/test/java/org/sonar/db/component/ComponentTesting.java | 22 |
1 files changed, 16 insertions, 6 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 37c61a7ec80..f492d037f43 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 @@ -47,12 +47,22 @@ public class ComponentTesting { public static ComponentDto newDirectory(ComponentDto module, String uuid, String path) { return newChildComponent(uuid, 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 path) { + return newChildComponent(uuid, viewOrSubView) + .setKey(!path.equals("/") ? viewOrSubView.getKey() + ":" + path : viewOrSubView.getKey() + ":/") + .setName(path) + .setLongName(path) + .setPath(path) + .setScope(Scopes.PROJECT) + .setQualifier(Qualifiers.SUBVIEW); } public static ComponentDto newDirectory(ComponentDto module, String path) { |