diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-11-15 16:58:17 +0100 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-11-16 18:45:39 +0100 |
commit | 0aaf59f1624a7fb2f2efb21603fd5cfcb205e8f6 (patch) | |
tree | 5c92aaecabcf202f0f9dd92b373cd260dae6ed17 /it | |
parent | 110ef36edc63445345a15735249ff80372082d6e (diff) | |
download | sonarqube-0aaf59f1624a7fb2f2efb21603fd5cfcb205e8f6.tar.gz sonarqube-0aaf59f1624a7fb2f2efb21603fd5cfcb205e8f6.zip |
SONAR-8341 add IT
Diffstat (limited to 'it')
-rw-r--r-- | it/it-tests/src/test/java/it/serverSystem/LogsTest.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/it/it-tests/src/test/java/it/serverSystem/LogsTest.java b/it/it-tests/src/test/java/it/serverSystem/LogsTest.java index 2a67c98e8a0..dc976fc78d5 100644 --- a/it/it-tests/src/test/java/it/serverSystem/LogsTest.java +++ b/it/it-tests/src/test/java/it/serverSystem/LogsTest.java @@ -23,6 +23,8 @@ import com.sonar.orchestrator.Orchestrator; import it.Category4Suite; import java.io.File; import java.io.IOException; +import java.util.List; +import org.apache.commons.io.FileUtils; import org.apache.commons.io.input.ReversedLinesFileReader; import org.junit.ClassRule; import org.junit.Test; @@ -65,6 +67,14 @@ public class LogsTest { assertThat(requestId.length()).isGreaterThanOrEqualTo(20); } + @Test + public void info_log_in_sonar_log_file_when_SQ_is_done_starting() throws IOException { + List<String> logs = FileUtils.readLines(orchestrator.getServer().getAppLogs()); + String sqIsUpMessage = "SonarQube is up"; + assertThat(logs.stream().filter(str -> str.contains(sqIsUpMessage)).findFirst()).describedAs("message is there").isNotEmpty(); + assertThat(logs.get(logs.size() - 1)).describedAs("message is the last line of logs").contains(sqIsUpMessage); + } + private void verifyLastAccessLogLine(String login, String path, int status) throws IOException { assertThat(readLastAccessLog()).endsWith(format("\"%s\" \"GET %s HTTP/1.1\" %d", login, path, status)); } |