aboutsummaryrefslogtreecommitdiffstats
path: root/it/it-tests/src/test/java/util/ItUtils.java
diff options
context:
space:
mode:
authorJenkins CI <ci@sonarsource.com>2016-01-06 12:50:23 +0100
committerJenkins CI <ci@sonarsource.com>2016-01-06 12:50:23 +0100
commit0429a8b70f7d60755f65602037d1c6fd01011c75 (patch)
tree8556eb60c0dcd8ad6f16dcf118dc1cec3fd192b3 /it/it-tests/src/test/java/util/ItUtils.java
parent0fddc5fa4ea33882b60e072eee51f0e1ea585b4c (diff)
parent36619d7c9a56bef27d2430b77685e7a4f65abb55 (diff)
downloadsonarqube-0429a8b70f7d60755f65602037d1c6fd01011c75.tar.gz
sonarqube-0429a8b70f7d60755f65602037d1c6fd01011c75.zip
Automatic merge from branch-5.3
* origin/branch-5.3: SONAR-7093 Allow projects to define their leak period fix display of date leak period
Diffstat (limited to 'it/it-tests/src/test/java/util/ItUtils.java')
-rw-r--r--it/it-tests/src/test/java/util/ItUtils.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/it/it-tests/src/test/java/util/ItUtils.java b/it/it-tests/src/test/java/util/ItUtils.java
index b25b564479f..865790b75a5 100644
--- a/it/it-tests/src/test/java/util/ItUtils.java
+++ b/it/it-tests/src/test/java/util/ItUtils.java
@@ -220,10 +220,14 @@ public class ItUtils {
}
public static void setServerProperty(Orchestrator orchestrator, String key, @Nullable String value) {
+ setServerProperty(orchestrator, null, key, value);
+ }
+
+ public static void setServerProperty(Orchestrator orchestrator, @Nullable String componentKey, String key, @Nullable String value) {
if (value == null) {
- orchestrator.getServer().getAdminWsClient().delete(new PropertyDeleteQuery(key));
+ orchestrator.getServer().getAdminWsClient().delete(new PropertyDeleteQuery(key).setResourceKeyOrId(componentKey));
} else {
- orchestrator.getServer().getAdminWsClient().update(new PropertyUpdateQuery().setKey(key).setValue(value));
+ orchestrator.getServer().getAdminWsClient().update(new PropertyUpdateQuery().setKey(key).setResourceKeyOrId(componentKey).setValue(value));
}
}
@@ -267,4 +271,9 @@ public class ItUtils {
}
}
+ public static String formatDate(Date d) {
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+ return sdf.format(d);
+ }
+
}