aboutsummaryrefslogtreecommitdiffstats
path: root/it/it-tests/src/test/java/util/ItUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'it/it-tests/src/test/java/util/ItUtils.java')
-rw-r--r--it/it-tests/src/test/java/util/ItUtils.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/it/it-tests/src/test/java/util/ItUtils.java b/it/it-tests/src/test/java/util/ItUtils.java
index 09124d89ac8..f0392cf732c 100644
--- a/it/it-tests/src/test/java/util/ItUtils.java
+++ b/it/it-tests/src/test/java/util/ItUtils.java
@@ -52,4 +52,18 @@ public class ItUtils {
}
return dir;
}
+
+ /**
+ * Locate the artifact of a fake plugin stored in it/it-plugins.
+ *
+ * @param dirName the directory of it/it-plugins, for example "sonar-fake-plugin".
+ * It assumes that version is 1.0-SNAPSHOT
+ */
+ public static FileLocation pluginArtifact(String dirName) {
+ File file = new File(HOME_DIR.get(), "it/it-plugins/" + dirName + "/target/" + dirName + "-1.0-SNAPSHOT.jar");
+ if (!file.exists()) {
+ throw new IllegalStateException(String.format("Plugin [%s]for integration tests is not built. File not found:%s", dirName, file));
+ }
+ return FileLocation.of(file);
+ }
}