aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src
diff options
context:
space:
mode:
authorDaniel Schwarz <daniel.schwarz@sonarsource.com>2017-10-23 10:49:46 +0200
committerDaniel Schwarz <bartfastiel@users.noreply.github.com>2017-10-24 17:40:56 +0200
commitb226884e6334d06b73005852500a16074e2b3495 (patch)
tree2e163e938ffa32c508f63d52635a8e5a10fab648 /sonar-plugin-api/src
parentd1f8eb5bbc8f4779d23f23e43b1326e00e3c9131 (diff)
downloadsonarqube-b226884e6334d06b73005852500a16074e2b3495.tar.gz
sonarqube-b226884e6334d06b73005852500a16074e2b3495.zip
SONAR-10008 Make date facet tests independent from the machine's time zone
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/TestSystem2.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/TestSystem2.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/TestSystem2.java
index 11695d31200..2f0e1828fe2 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/TestSystem2.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/internal/TestSystem2.java
@@ -19,11 +19,13 @@
*/
package org.sonar.api.utils.internal;
+import java.util.TimeZone;
import org.sonar.api.utils.System2;
public class TestSystem2 extends System2 {
private long now = 0L;
+ private TimeZone defaultTimeZone = getDefaultTimeZone();
public TestSystem2 setNow(long l) {
this.now = l;
@@ -37,4 +39,14 @@ public class TestSystem2 extends System2 {
}
return now;
}
+
+ public TestSystem2 setDefaultTimeZone(TimeZone defaultTimeZone) {
+ this.defaultTimeZone = defaultTimeZone;
+ return this;
+ }
+
+ @Override
+ public TimeZone getDefaultTimeZone() {
+ return defaultTimeZone;
+ }
}