garydgregory commented on code in PR #358:
URL: https://github.com/apache/commons-io/pull/358#discussion_r889363755
##########
src/test/java/org/apache/commons/io/output/ByteArrayOutputStreamTest.java:
##########
@@ -350,6 +358,22 @@ public void testWriteZero(final String baosName, final
BAOSFactory<?> baosFactor
}
}
+ @Test
+ public void testToByteArrayImplAndResetImpl() throws Exception {
+ final int file_size = (1024 * 4) + 1;
+ final byte[] inData = TestUtils.generateTestData(file_size);
+ try (InputStream in = new ByteArrayInputStream(inData)) {
+ try (ByteArrayOutputStream baout = new ByteArrayOutputStream()) {
+ try (Writer writer = new OutputStreamWriter(baout,
StandardCharsets.US_ASCII)) {
+ CopyUtils.copy(in, writer);
+ writer.flush();
+ }
+ baout.reset();
+ Assertions.assertEquals("", baout.toString());
Review Comment:
No need for Assertions prefix static in a test method. Use the other methods
in this file as a style guide.
##########
src/test/java/org/apache/commons/io/output/ByteArrayOutputStreamTest.java:
##########
@@ -350,6 +358,22 @@ public void testWriteZero(final String baosName, final
BAOSFactory<?> baosFactor
}
}
+ @Test
+ public void testToByteArrayImplAndResetImpl() throws Exception {
+ final int file_size = (1024 * 4) + 1;
Review Comment:
- No underscore in local variable names.
- No need for spelling out 4097 in an expression.
--
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]