Skip to content

Commit 4a5611c

Browse files
committed
Updated test comments for print tests targeting IOUtils.
1 parent 1539f48 commit 4a5611c

1 file changed

Lines changed: 20 additions & 6 deletions

File tree

src/test/java/org/apache/commons/csv/CSVPrinterTest.java

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,11 +1471,18 @@ private String[] toFirstRecordValues(final String expected, final CSVFormat form
14711471
return CSVParser.parse(expected, format).getRecords().get(0).values();
14721472
}
14731473

1474+
/**
1475+
* Test to target the use of {@link IOUtils#copyLarge(java.io.Reader, Writer)} which directly
1476+
* buffers the value from the Reader to the Writer.
1477+
*
1478+
* <p>Requires the format to have no quote or escape character, value to be a
1479+
* {@link java.io.Reader Reader} and the output <i>MUST</i> be a
1480+
* {@link java.io.Writer Writer}.</p>
1481+
*
1482+
* @throws IOException Not expected to happen
1483+
*/
14741484
@Test
14751485
public void testPrintReaderWithoutQuoteToWriter() throws IOException {
1476-
// Test to target the use of IOUtils::copyLarge.
1477-
// Requires the format to have no quote or escape character,
1478-
// value to be a java.io.Reader and the output to be a java.io.Writer.
14791486
final StringWriter sw = new StringWriter();
14801487
final String content = "testValue";
14811488
try (final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null))) {
@@ -1485,11 +1492,18 @@ public void testPrintReaderWithoutQuoteToWriter() throws IOException {
14851492
assertEquals(content, sw.toString());
14861493
}
14871494

1495+
/**
1496+
* Test to target the use of {@link IOUtils#copy(java.io.Reader, Appendable)} which directly
1497+
* buffers the value from the Reader to the Appendable.
1498+
*
1499+
* <p>Requires the format to have no quote or escape character, value to be a
1500+
* {@link java.io.Reader Reader} and the output <i>MUST NOT</i> be a
1501+
* {@link java.io.Writer Writer} but some other Appendable.</p>
1502+
*
1503+
* @throws IOException Not expected to happen
1504+
*/
14881505
@Test
14891506
public void testPrintReaderWithoutQuoteToAppendable() throws IOException {
1490-
// Test to target the use of IOUtils::copy.
1491-
// Requires the format to have no quote or escape character,
1492-
// value to be a java.io.Reader and the output to not be a java.io.Writer.
14931507
final StringBuilder sb = new StringBuilder();
14941508
final String content = "testValue";
14951509
try (final CSVPrinter printer = new CSVPrinter(sb, CSVFormat.DEFAULT.withQuote(null))) {

0 commit comments

Comments
 (0)