manoj-mathivanan commented on code in PR #18391: URL: https://github.com/apache/kafka/pull/18391#discussion_r2079048431
########## tools/src/test/java/org/apache/kafka/tools/ProducerPerformanceTest.java: ########## @@ -104,6 +104,20 @@ public void testReadProps() throws Exception { Utils.delete(producerConfig); } + @Test + public void testReadPayloadFileWithAlternateDelimiter() throws Exception { + File payloadFile = createTempFile("Hello~~Kafka"); + String payloadFilePath = payloadFile.getAbsolutePath(); + String payloadDelimiter = "~~"; + + List<byte[]> payloadByteList = ProducerPerformance.readPayloadFile(payloadFilePath, payloadDelimiter); + + assertEquals(2, payloadByteList.size()); + assertEquals("Hello", new String(payloadByteList.get(0))); + assertEquals("Kafka", new String(payloadByteList.get(1))); + Utils.delete(payloadFile); Review Comment: Sure, The `createTempFile` method creates the file with `file.deleteOnExit();` set. I will also add a finally block to handle abrupt terminations. Thanks for the suggestion. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org