diff options
author | Ola Aunrønning <ola.aunroe@gmail.com> | 2018-09-10 15:58:51 +0200 |
---|---|---|
committer | Ola Aunrønning <ola.aunroe@gmail.com> | 2018-09-10 15:58:51 +0200 |
commit | dd4f6af83ca7374d6458b4e31d2706a8684c43c8 (patch) | |
tree | 7b8c97014dcbe7661d7d6fe74a6d5e38b51146a4 /container-core/src/test/java | |
parent | 44053e445e8f893514667325be40613830056e6e (diff) |
Check if container is running on logserver
Diffstat (limited to 'container-core/src/test/java')
-rw-r--r-- | container-core/src/test/java/com/yahoo/container/handler/LogReaderTest.java | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/container-core/src/test/java/com/yahoo/container/handler/LogReaderTest.java b/container-core/src/test/java/com/yahoo/container/handler/LogReaderTest.java index ff6ea74a411..e5302ee43ee 100644 --- a/container-core/src/test/java/com/yahoo/container/handler/LogReaderTest.java +++ b/container-core/src/test/java/com/yahoo/container/handler/LogReaderTest.java @@ -1,5 +1,6 @@ package com.yahoo.container.handler; +import org.json.JSONObject; import org.junit.Before; import org.junit.Test; @@ -19,18 +20,9 @@ public class LogReaderTest { @Test public void testThatFilesAreWrittenCorrectlyToOutputStream() throws Exception{ String logDirectory = "src/test/resources/logfolder/"; - LogReader.writeToOutputStream(logDirectory, outputStream); + JSONObject json = LogReader.readLogs(logDirectory); String expected = "{\"subfolder\":{\"log2.log\":\"VGhpcyBpcyBhbm90aGVyIGxvZyBmaWxl\"},\"log1.log\":\"VGhpcyBpcyBvbmUgbG9nIGZpbGU=\"}"; - String actual = new String(outputStream.toByteArray()); - assertEquals(expected, actual); - } - - @Test - public void testNothingISWrittenToOutputStreamWithEmptyLogFolder() throws Exception { - String logDirectory = "src/test/resources/emptylogfolder/"; - LogReader.writeToOutputStream(logDirectory, outputStream); - String expected = "{}"; - String actual = new String(outputStream.toByteArray()); + String actual = json.toString(); assertEquals(expected, actual); } }
\ No newline at end of file |