From 23615069db2863f45dba4b9df50b30cf6fb7b792 Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Tue, 25 Jun 2019 16:33:56 +0200 Subject: SQSCANNER-60 Upgrade embedded JRE to 11 Move QA to use Jenkinsfile --- .../java/com/sonarsource/scanner/it/ScannerTest.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'it/src/test/java/com/sonarsource') diff --git a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java index fa147ac..f003df2 100644 --- a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java +++ b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java @@ -25,7 +25,6 @@ import java.io.File; import java.io.IOException; import java.util.Map; import java.util.stream.Collectors; -import org.assertj.core.api.Condition; import org.junit.After; import org.junit.Rule; import org.junit.Test; @@ -188,19 +187,15 @@ public class ScannerTest extends ScannerTestCase { } @Test - public void verify_env_variable() { + public void verify_scanner_opts_env_variable_passed_as_jvm_argument() { SonarScanner build = newScanner(new File("projects/simple-sample")) - .setEnvironmentVariable("SONAR_SCANNER_OPTS", "-Xmx2m"); + .setEnvironmentVariable("SONAR_SCANNER_OPTS", "-Xmx1k"); BuildResult executeBuild = orchestrator.executeBuildQuietly(build); - assertThat(executeBuild.getStatus()).isNotEqualTo(0); + assertThat(executeBuild.getLastStatus()).isNotEqualTo(0); String logs = executeBuild.getLogs(); - assertThat(logs).is(new Condition("Contain error message about OOM") { - @Override - public boolean matches(String value) { - return value.contains("java.lang.OutOfMemoryError") - || value.contains("GC overhead limit exceeded") || value.contains("Java heap space"); - } - }); + assertThat(logs).contains("Error occurred during initialization of VM"); + // Not the same message with JRE 8 and 11 + assertThat(logs).containsPattern("Too small (initial|maximum) heap"); } } -- cgit v1.2.3