tst/com/amazon/kinesis/streaming/agent/tailing/AbstractParserTest.java [575:602]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        }});
        when(flow.getDataConverter()).thenReturn(new AgentDataConverterChain(new LogToJSONDataConverter(config)));
        Path testFile = FileSystems.getDefault().getPath(this.getClass().getResource(testfileName).getFile());
        Path resultFile = FileSystems.getDefault().getPath(this.getClass().getResource(expectedResultFileName).getFile());
        P parser = buildParser();
        parser = spy(parser);
        TrackedFile file = new TrackedFile(flow, testFile);
        file.open(0);
        assertTrue(parser.switchParsingToFile(file));
        List<R> actualRecords = parseAllRecords(parser, null);
        List<String> expectedRecords = getLines(null, resultFile);
        
        assertTrue(actualRecords.size() > 0);  // SANITYCHECK: Ensure we didn't shoot blanks
        assertEquals(actualRecords.size(), expectedRecords.size() + expectedSkippedRecords);
        int numSkippedRecord = 0;
        for(int i = 0; i < actualRecords.size(); i++) {
            if (actualRecords.get(i).shouldSkip()) {
                numSkippedRecord++;
                continue;
            }
            String actualRecord = ByteBuffers.toString(actualRecords.get(i).data(), StandardCharsets.UTF_8);
            // getLines() preserves the NEWLINE at the end of each line
            assertEquals(actualRecord, 
                    expectedRecords.get(i - numSkippedRecord)
                    .substring(0,  expectedRecords.get(i - numSkippedRecord).length()-1) + "\n", 
                    "Record " + i + " does not match!");
        }
        assertEquals(numSkippedRecord, expectedSkippedRecords);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tst/com/amazon/kinesis/streaming/agent/tailing/AbstractParserTest.java [616:643]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        }});
        when(flow.getDataConverter()).thenReturn(new AgentDataConverterChain(new LogToJSONDataConverter(config)));
        Path testFile = FileSystems.getDefault().getPath(this.getClass().getResource(testfileName).getFile());
        Path resultFile = FileSystems.getDefault().getPath(this.getClass().getResource(expectedResultFileName).getFile());
        P parser = buildParser();
        parser = spy(parser);
        TrackedFile file = new TrackedFile(flow, testFile);
        file.open(0);
        assertTrue(parser.switchParsingToFile(file));
        List<R> actualRecords = parseAllRecords(parser, null);
        List<String> expectedRecords = getLines(null, resultFile);
        
        assertTrue(actualRecords.size() > 0);  // SANITYCHECK: Ensure we didn't shoot blanks
        assertEquals(actualRecords.size(), expectedRecords.size() + expectedSkippedRecords);
        int numSkippedRecord = 0;
        for(int i = 0; i < actualRecords.size(); i++) {
            if (actualRecords.get(i).shouldSkip()) {
                numSkippedRecord++;
                continue;
            }
            String actualRecord = ByteBuffers.toString(actualRecords.get(i).data(), StandardCharsets.UTF_8);
            // getLines() preserves the NEWLINE at the end of each line
            assertEquals(actualRecord, 
                    expectedRecords.get(i - numSkippedRecord)
                    .substring(0,  expectedRecords.get(i - numSkippedRecord).length()-1) + "\n", 
                    "Record " + i + " does not match!");
        }
        assertEquals(numSkippedRecord, expectedSkippedRecords);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



