aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db/src/test/java/org/sonar/db/component/ComponentTesting.java
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-db/src/test/java/org/sonar/db/component/ComponentTesting.java')
-rw-r--r--sonar-db/src/test/java/org/sonar/db/component/ComponentTesting.java22
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) {