ppkarwasz commented on code in PR #748:
URL: https://github.com/apache/commons-io/pull/748#discussion_r2094125662
##########
src/test/java/org/apache/commons/io/input/QueueInputStreamTest.java:
##########
@@ -123,14 +129,53 @@ public void testAvailableAfterOpen(final String
inputData) throws IOException {
@MethodSource("inputData")
public void testBufferedReads(final String inputData) throws IOException {
final BlockingQueue<Integer> queue = new LinkedBlockingQueue<>();
- try (BufferedInputStream inputStream = new BufferedInputStream(new
QueueInputStream(queue));
- QueueOutputStream outputStream = new QueueOutputStream(queue))
{
+ try (BufferedInputStream inputStream = new BufferedInputStream(new
QueueInputStream(queue)); QueueOutputStream outputStream = new
QueueOutputStream(queue)) {
outputStream.write(inputData.getBytes(StandardCharsets.UTF_8));
final String actualData = IOUtils.toString(inputStream,
StandardCharsets.UTF_8);
assertEquals(inputData, actualData);
}
}
+ @ParameterizedTest(name = "inputData={0}")
+ @MethodSource("inputData")
+ public void testReadLineByLineQueue(final String inputData) throws
IOException {
+ final String[] lines = inputData.split("\n");
+ final BlockingQueue<Integer> queue = new LinkedBlockingQueue<>();
+ try (InputStream inputStream =
QueueInputStream.builder().setBlockingQueue(queue)
+
.setTimeout(Duration.ofHours(1))
+ .get();
+ QueueOutputStream outputStream = new QueueOutputStream(queue)) {
Review Comment:
Fixed in e91989163f7a5e856ae1b168b00c14ef49b8d8fe
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]