]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8341 add IT 1390/head
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Tue, 15 Nov 2016 15:58:17 +0000 (16:58 +0100)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Wed, 16 Nov 2016 17:45:39 +0000 (18:45 +0100)
it/it-tests/src/test/java/it/serverSystem/LogsTest.java

index 2a67c98e8a043be23bf8d7f49bee0411236ad4a5..dc976fc78d587b46d73f3570afe8b838f2bea306 100644 (file)
@@ -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));
   }