Package de.freaklamarsch.systarest.tests
Class DataLoggerTest
java.lang.Object
de.freaklamarsch.systarest.tests.DataLoggerTest
public class DataLoggerTest
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.Integer[]dataArrayprivate static java.time.format.DateTimeFormatterDEFAULT_FORMATTER(package private) DataLogger<java.lang.Integer>logger(package private) java.nio.file.PathlogPath(package private) java.nio.file.PathtempDir -
Constructor Summary
Constructors Constructor Description DataLoggerTest() -
Method Summary
Modifier and Type Method Description (package private) voidsetUp()voidtestConstructor()(package private) voidtestLogEntryDelimiterEdgeCases()(package private) voidtestMultipleFileWritesAndBuffering()(package private) voidtestNoFileWrittenWhenLoggingIsOff()(package private) voidtestReactivatingLoggingFlushesExistingBuffer()(package private) voidtestSingleFileWriteOnCapacityOne()(package private) voidtestStopSavingFlushesBuffer()(package private) voidtestTimestampLogic()(package private) voidtestWriteOnEmptyBufferNoFileGenerated()private voidverifyFileContent(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)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
-