Class DataLoggerTest

java.lang.Object
de.freaklamarsch.systarest.tests.DataLoggerTest

public class DataLoggerTest
extends java.lang.Object
  • Field Details

    • tempDir

      @TempDir java.nio.file.Path tempDir
    • logger

      DataLogger<java.lang.Integer> logger
    • dataArray

      java.lang.Integer[] dataArray
    • logPath

      java.nio.file.Path logPath
    • DEFAULT_FORMATTER

      private static final java.time.format.DateTimeFormatter DEFAULT_FORMATTER
  • Constructor Details

    • DataLoggerTest

      public DataLoggerTest()
  • Method Details

    • setUp

      @BeforeEach void setUp() throws java.io.IOException
      Throws:
      java.io.IOException
    • testConstructor

      @Test public void testConstructor()
    • testSingleFileWriteOnCapacityOne

      @Test void testSingleFileWriteOnCapacityOne() throws java.io.IOException
      Throws:
      java.io.IOException
    • testMultipleFileWritesAndBuffering

      @Test void testMultipleFileWritesAndBuffering() throws java.io.IOException
      Throws:
      java.io.IOException
    • testStopSavingFlushesBuffer

      @Test void testStopSavingFlushesBuffer() throws java.io.IOException
      Throws:
      java.io.IOException
    • testNoFileWrittenWhenLoggingIsOff

      @Test void testNoFileWrittenWhenLoggingIsOff() throws java.io.IOException
      Throws:
      java.io.IOException
    • testReactivatingLoggingFlushesExistingBuffer

      @Test void testReactivatingLoggingFlushesExistingBuffer() throws java.io.IOException
      Throws:
      java.io.IOException
    • verifyFileContent

      private void verifyFileContent​(java.nio.file.Path filePath, java.lang.String expectedDelimiter, java.util.List<java.util.Map.Entry<java.lang.Long,​java.lang.Integer[]>> expectedEntriesInChronologicalOrder, int expectedArrayLength) throws java.io.IOException
      Throws:
      java.io.IOException
    • testLogEntryDelimiterEdgeCases

      @Test void testLogEntryDelimiterEdgeCases() throws java.io.IOException
      Throws:
      java.io.IOException
    • testTimestampLogic

      @Test void testTimestampLogic() throws java.io.IOException
      Throws:
      java.io.IOException
    • testWriteOnEmptyBufferNoFileGenerated

      @Test void testWriteOnEmptyBufferNoFileGenerated() throws java.io.IOException
      Throws:
      java.io.IOException