]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-12108 Support Java 11 RTE
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Tue, 14 May 2019 21:02:43 +0000 (16:02 -0500)
committersonartech <sonartech@sonarsource.com>
Fri, 28 Jun 2019 06:45:40 +0000 (08:45 +0200)
server/sonar-main/src/test/java/org/sonar/application/command/CeJvmOptionsTest.java
server/sonar-main/src/test/java/org/sonar/application/command/WebJvmOptionsTest.java

index 863ee7633404340d119601fd735a728419564e40..3cb6f5a81f9b94b22fc4d02bc7b9588937dd5e75 100644 (file)
@@ -41,8 +41,13 @@ public class CeJvmOptionsTest {
   @Before
   public void setUp() throws IOException {
     tmpDir = temporaryFolder.newFolder();
+    underTest = new CeJvmOptions(tmpDir, javaVersion);
   }
 
+  @Test
+  public void constructor_sets_mandatory_JVM_options_before_java11() throws IOException {
+    when(javaVersion.isAtLeastJava11()).thenReturn(false);
+
   @Test
   public void constructor_sets_mandatory_JVM_options_before_java11() {
     when(javaVersion.isAtLeastJava11()).thenReturn(false);
@@ -52,9 +57,9 @@ public class CeJvmOptionsTest {
   }
 
   @Test
-  public void constructor_sets_mandatory_JVM_options_for_java11() {
+  public void constructor_sets_mandatory_JVM_options_for_java11() throws IOException {
     when(javaVersion.isAtLeastJava11()).thenReturn(true);
-    underTest = new CeJvmOptions(tmpDir, javaVersion);
+
     assertThat(underTest.getAll()).containsExactly(
       "-Djava.awt.headless=true", "-Dfile.encoding=UTF-8", "-Djava.io.tmpdir=" + tmpDir.getAbsolutePath(),
       "--add-opens=java.base/java.util=ALL-UNNAMED");
index 8cc87861f5fa3817789c0532d37881ad99faaee4..65def9d351921a000f04a06c0014190f7a5fbebb 100644 (file)
@@ -41,8 +41,13 @@ public class WebJvmOptionsTest {
   @Before
   public void setUp() throws IOException {
     tmpDir = temporaryFolder.newFolder();
+    underTest = new WebJvmOptions(tmpDir, javaVersion);
   }
 
+  @Test
+  public void constructor_sets_mandatory_JVM_options_before_java11() throws IOException {
+    when(javaVersion.isAtLeastJava11()).thenReturn(false);
+
   @Test
   public void constructor_sets_mandatory_JVM_options_before_java11() {
     when(javaVersion.isAtLeastJava11()).thenReturn(false);
@@ -52,9 +57,9 @@ public class WebJvmOptionsTest {
   }
 
   @Test
-  public void constructor_sets_mandatory_JVM_options_for_java11() {
+  public void constructor_sets_mandatory_JVM_options_for_java11() throws IOException {
     when(javaVersion.isAtLeastJava11()).thenReturn(true);
-    underTest = new WebJvmOptions(tmpDir, javaVersion);
+
     assertThat(underTest.getAll()).containsExactly(
       "-Djava.awt.headless=true", "-Dfile.encoding=UTF-8", "-Djava.io.tmpdir=" + tmpDir.getAbsolutePath(),
       "--add-opens=java.base/java.util=ALL-UNNAMED",