aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src
diff options
context:
space:
mode:
authorJacek <52388493+jacek-poreda-sonarsource@users.noreply.github.com>2019-08-01 15:08:41 +0200
committerSonarTech <sonartech@sonarsource.com>2019-08-01 20:21:14 +0200
commit1feb7a0ef4ff095b9712f891385207b60f4c2e6c (patch)
treebbd8e43e048f12d074e3138cf45a6399254761fe /sonar-plugin-api/src
parentbfb93726f012db0c0e7359ece193aae1fa30e00f (diff)
downloadsonarqube-1feb7a0ef4ff095b9712f891385207b60f4c2e6c.tar.gz
sonarqube-1feb7a0ef4ff095b9712f891385207b60f4c2e6c.zip
Fix test to make it run on mac os (#1977)
* fix test to make it run on mac os
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java7
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java5
2 files changed, 12 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java
index 36dc553a74e..ed4ee20497c 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java
@@ -127,6 +127,13 @@ public class System2 {
}
/**
+ * True if this is Mac system.
+ */
+ public boolean isOsMac() {
+ return SystemUtils.IS_OS_MAC;
+ }
+
+ /**
* True if Java 7 or Java 8 runtime environment
*
* @since 4.3
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java
index 9a8526195eb..ec4d0aac177 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/System2Test.java
@@ -84,6 +84,11 @@ public class System2Test {
}
@Test
+ public void testIsOsMac() {
+ assertThat(System2.INSTANCE.isOsMac()).isEqualTo(SystemUtils.IS_OS_MAC);
+ }
+
+ @Test
public void isJavaAtLeast17_always_returns_true() {
assertThat(System2.INSTANCE.isJavaAtLeast17()).isTrue();
}