You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/06/07 18:43:03 UTC
(commons-csv) branch master updated: Use JUnit 5 convention for test method visibility
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-csv.git
The following commit(s) were added to refs/heads/master by this push:
new f97c1721 Use JUnit 5 convention for test method visibility
f97c1721 is described below
commit f97c172162256366058f23b8e13a1ccb3b129d82
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sat Jun 7 14:42:56 2025 -0400
Use JUnit 5 convention for test method visibility
---
.../apache/commons/csv/CSVDuplicateHeaderTest.java | 4 +-
.../org/apache/commons/csv/CSVFileParserTest.java | 4 +-
.../commons/csv/CSVFormatPredefinedTest.java | 20 +-
.../java/org/apache/commons/csv/CSVFormatTest.java | 220 +++++++++---------
.../java/org/apache/commons/csv/CSVParserTest.java | 248 ++++++++++-----------
.../org/apache/commons/csv/CSVPrinterTest.java | 244 ++++++++++----------
.../java/org/apache/commons/csv/CSVRecordTest.java | 62 +++---
.../commons/csv/ExtendedBufferedReaderTest.java | 12 +-
.../org/apache/commons/csv/JiraCsv196Test.java | 4 +-
.../java/org/apache/commons/csv/LexerTest.java | 66 +++---
.../java/org/apache/commons/csv/TokenTest.java | 2 +-
.../java/org/apache/commons/csv/UserGuideTest.java | 4 +-
.../apache/commons/csv/issues/JiraCsv148Test.java | 4 +-
.../apache/commons/csv/issues/JiraCsv149Test.java | 4 +-
.../apache/commons/csv/issues/JiraCsv150Test.java | 6 +-
.../apache/commons/csv/issues/JiraCsv154Test.java | 4 +-
.../apache/commons/csv/issues/JiraCsv167Test.java | 2 +-
.../apache/commons/csv/issues/JiraCsv198Test.java | 2 +-
.../apache/commons/csv/issues/JiraCsv203Test.java | 14 +-
.../apache/commons/csv/issues/JiraCsv206Test.java | 2 +-
.../apache/commons/csv/issues/JiraCsv211Test.java | 2 +-
.../apache/commons/csv/issues/JiraCsv213Test.java | 2 +-
.../apache/commons/csv/issues/JiraCsv247Test.java | 4 +-
.../apache/commons/csv/issues/JiraCsv248Test.java | 2 +-
.../apache/commons/csv/issues/JiraCsv249Test.java | 2 +-
.../apache/commons/csv/issues/JiraCsv253Test.java | 2 +-
.../apache/commons/csv/issues/JiraCsv263Test.java | 2 +-
.../apache/commons/csv/issues/JiraCsv264Test.java | 6 +-
.../apache/commons/csv/issues/JiraCsv265Test.java | 4 +-
.../apache/commons/csv/issues/JiraCsv271Test.java | 4 +-
.../apache/commons/csv/issues/JiraCsv288Test.java | 24 +-
.../apache/commons/csv/issues/JiraCsv290Test.java | 6 +-
.../apache/commons/csv/issues/JiraCsv294Test.java | 8 +-
.../apache/commons/csv/issues/JiraCsv93Test.java | 6 +-
.../apache/commons/csv/perf/PerformanceTest.java | 4 +-
35 files changed, 503 insertions(+), 503 deletions(-)
diff --git a/src/test/java/org/apache/commons/csv/CSVDuplicateHeaderTest.java b/src/test/java/org/apache/commons/csv/CSVDuplicateHeaderTest.java
index 124e9efc..c5705e28 100644
--- a/src/test/java/org/apache/commons/csv/CSVDuplicateHeaderTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVDuplicateHeaderTest.java
@@ -272,7 +272,7 @@ public class CSVDuplicateHeaderTest {
*/
@ParameterizedTest
@MethodSource(value = {"duplicateHeaderAllowsMissingColumnsNamesData"})
- public void testCSVFormat(final DuplicateHeaderMode duplicateHeaderMode,
+ void testCSVFormat(final DuplicateHeaderMode duplicateHeaderMode,
final boolean allowMissingColumnNames,
final boolean ignoreHeaderCase,
final String[] headers,
@@ -305,7 +305,7 @@ public class CSVDuplicateHeaderTest {
*/
@ParameterizedTest
@MethodSource(value = {"duplicateHeaderData"})
- public void testCSVParser(final DuplicateHeaderMode duplicateHeaderMode,
+ void testCSVParser(final DuplicateHeaderMode duplicateHeaderMode,
final boolean allowMissingColumnNames,
final boolean ignoreHeaderCase,
final String[] headers,
diff --git a/src/test/java/org/apache/commons/csv/CSVFileParserTest.java b/src/test/java/org/apache/commons/csv/CSVFileParserTest.java
index fd989779..cb01de37 100644
--- a/src/test/java/org/apache/commons/csv/CSVFileParserTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVFileParserTest.java
@@ -59,7 +59,7 @@ public class CSVFileParserTest {
@ParameterizedTest
@MethodSource("generateData")
- public void testCSVFile(final File testFile) throws Exception {
+ void testCSVFile(final File testFile) throws Exception {
try (FileReader fr = new FileReader(testFile); BufferedReader testDataReader = new BufferedReader(fr)) {
String line = readTestData(testDataReader);
assertNotNull("file must contain config line", line);
@@ -104,7 +104,7 @@ public class CSVFileParserTest {
@ParameterizedTest
@MethodSource("generateData")
- public void testCSVUrl(final File testFile) throws Exception {
+ void testCSVUrl(final File testFile) throws Exception {
try (FileReader fr = new FileReader(testFile); BufferedReader testData = new BufferedReader(fr)) {
String line = readTestData(testData);
assertNotNull("file must contain config line", line);
diff --git a/src/test/java/org/apache/commons/csv/CSVFormatPredefinedTest.java b/src/test/java/org/apache/commons/csv/CSVFormatPredefinedTest.java
index e907d4f1..8ff96e96 100644
--- a/src/test/java/org/apache/commons/csv/CSVFormatPredefinedTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVFormatPredefinedTest.java
@@ -34,52 +34,52 @@ public class CSVFormatPredefinedTest {
}
@Test
- public void testDefault() {
+ void testDefault() {
test(CSVFormat.DEFAULT, "Default");
}
@Test
- public void testExcel() {
+ void testExcel() {
test(CSVFormat.EXCEL, "Excel");
}
@Test
- public void testMongoDbCsv() {
+ void testMongoDbCsv() {
test(CSVFormat.MONGODB_CSV, "MongoDBCsv");
}
@Test
- public void testMongoDbTsv() {
+ void testMongoDbTsv() {
test(CSVFormat.MONGODB_TSV, "MongoDBTsv");
}
@Test
- public void testMySQL() {
+ void testMySQL() {
test(CSVFormat.MYSQL, "MySQL");
}
@Test
- public void testOracle() {
+ void testOracle() {
test(CSVFormat.ORACLE, "Oracle");
}
@Test
- public void testPostgreSqlCsv() {
+ void testPostgreSqlCsv() {
test(CSVFormat.POSTGRESQL_CSV, "PostgreSQLCsv");
}
@Test
- public void testPostgreSqlText() {
+ void testPostgreSqlText() {
test(CSVFormat.POSTGRESQL_TEXT, "PostgreSQLText");
}
@Test
- public void testRFC4180() {
+ void testRFC4180() {
test(CSVFormat.RFC4180, "RFC4180");
}
@Test
- public void testTDF() {
+ void testTDF() {
test(CSVFormat.TDF, "TDF");
}
}
diff --git a/src/test/java/org/apache/commons/csv/CSVFormatTest.java b/src/test/java/org/apache/commons/csv/CSVFormatTest.java
index 0c7e763e..31ad476e 100644
--- a/src/test/java/org/apache/commons/csv/CSVFormatTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVFormatTest.java
@@ -83,65 +83,65 @@ public class CSVFormatTest {
}
@Test
- public void testBuildVsGet() {
+ void testBuildVsGet() {
final Builder builder = CSVFormat.DEFAULT.builder();
assertNotSame(builder.get(), builder.build());
}
@Test
- public void testDelimiterCharLineBreakCrThrowsException1() {
+ void testDelimiterCharLineBreakCrThrowsException1() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.builder().setDelimiter(Constants.CR).get());
}
@Test
- public void testDelimiterCharLineBreakLfThrowsException1() {
+ void testDelimiterCharLineBreakLfThrowsException1() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.builder().setDelimiter(Constants.LF).get());
}
@Test
- public void testDelimiterEmptyStringThrowsException1() {
+ void testDelimiterEmptyStringThrowsException1() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.builder().setDelimiter("").get());
}
@SuppressWarnings("deprecation")
@Test
- public void testDelimiterSameAsCommentStartThrowsException_Deprecated() {
+ void testDelimiterSameAsCommentStartThrowsException_Deprecated() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withDelimiter('!').withCommentMarker('!'));
}
@Test
- public void testDelimiterSameAsCommentStartThrowsException1() {
+ void testDelimiterSameAsCommentStartThrowsException1() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.builder().setDelimiter('!').setCommentMarker('!').get());
}
@SuppressWarnings("deprecation")
@Test
- public void testDelimiterSameAsEscapeThrowsException_Deprecated() {
+ void testDelimiterSameAsEscapeThrowsException_Deprecated() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withDelimiter('!').withEscape('!'));
}
@Test
- public void testDelimiterSameAsEscapeThrowsException1() {
+ void testDelimiterSameAsEscapeThrowsException1() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.builder().setDelimiter('!').setEscape('!').get());
}
@Test
- public void testDelimiterSameAsRecordSeparatorThrowsException() {
+ void testDelimiterSameAsRecordSeparatorThrowsException() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.newFormat(CR));
}
@Test
- public void testDelimiterStringLineBreakCrThrowsException1() {
+ void testDelimiterStringLineBreakCrThrowsException1() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.builder().setDelimiter(String.valueOf(Constants.CR)).get());
}
@Test
- public void testDelimiterStringLineBreakLfThrowsException1() {
+ void testDelimiterStringLineBreakLfThrowsException1() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.builder().setDelimiter(String.valueOf(Constants.LF)).get());
}
@Test
- public void testDuplicateHeaderElements() {
+ void testDuplicateHeaderElements() {
final String[] header = { "A", "A" };
final CSVFormat format = CSVFormat.DEFAULT.builder().setHeader(header).get();
assertEquals(2, format.getHeader().length);
@@ -150,7 +150,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testDuplicateHeaderElements_Deprecated() {
+ void testDuplicateHeaderElements_Deprecated() {
final String[] header = { "A", "A" };
final CSVFormat format = CSVFormat.DEFAULT.withHeader(header);
assertEquals(2, format.getHeader().length);
@@ -158,44 +158,44 @@ public class CSVFormatTest {
}
@Test
- public void testDuplicateHeaderElementsFalse() {
+ void testDuplicateHeaderElementsFalse() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.builder().setAllowDuplicateHeaderNames(false).setHeader("A", "A").get());
}
@SuppressWarnings("deprecation")
@Test
- public void testDuplicateHeaderElementsFalse_Deprecated() {
+ void testDuplicateHeaderElementsFalse_Deprecated() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withAllowDuplicateHeaderNames(false).withHeader("A", "A"));
}
@Test
- public void testDuplicateHeaderElementsTrue() {
+ void testDuplicateHeaderElementsTrue() {
CSVFormat.DEFAULT.builder().setAllowDuplicateHeaderNames(true).setHeader("A", "A").get();
}
@SuppressWarnings("deprecation")
@Test
- public void testDuplicateHeaderElementsTrue_Deprecated() {
+ void testDuplicateHeaderElementsTrue_Deprecated() {
CSVFormat.DEFAULT.withAllowDuplicateHeaderNames(true).withHeader("A", "A");
}
@Test
- public void testDuplicateHeaderElementsTrueContainsEmpty1() {
+ void testDuplicateHeaderElementsTrueContainsEmpty1() {
CSVFormat.DEFAULT.builder().setAllowDuplicateHeaderNames(false).setHeader("A", "", "B", "").get();
}
@Test
- public void testDuplicateHeaderElementsTrueContainsEmpty2() {
+ void testDuplicateHeaderElementsTrueContainsEmpty2() {
CSVFormat.DEFAULT.builder().setDuplicateHeaderMode(DuplicateHeaderMode.ALLOW_EMPTY).setHeader("A", "", "B", "").get();
}
@Test
- public void testDuplicateHeaderElementsTrueContainsEmpty3() {
+ void testDuplicateHeaderElementsTrueContainsEmpty3() {
CSVFormat.DEFAULT.builder().setAllowDuplicateHeaderNames(false).setAllowMissingColumnNames(true).setHeader("A", "", "B", "").get();
}
@Test
- public void testEquals() {
+ void testEquals() {
final CSVFormat right = CSVFormat.DEFAULT;
final CSVFormat left = copy(right);
Assertions.assertNotEquals(null, right);
@@ -208,7 +208,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsCommentStart() {
+ void testEqualsCommentStart() {
final CSVFormat right = CSVFormat.newFormat('\'').builder().setQuote('"').setCommentMarker('#').setQuoteMode(QuoteMode.ALL).get();
final CSVFormat left = right.builder().setCommentMarker('!').get();
@@ -217,7 +217,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testEqualsCommentStart_Deprecated() {
+ void testEqualsCommentStart_Deprecated() {
final CSVFormat right = CSVFormat.newFormat('\'').withQuote('"').withCommentMarker('#').withQuoteMode(QuoteMode.ALL);
final CSVFormat left = right.withCommentMarker('!');
@@ -225,7 +225,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsDelimiter() {
+ void testEqualsDelimiter() {
final CSVFormat right = CSVFormat.newFormat('!');
final CSVFormat left = CSVFormat.newFormat('?');
@@ -233,7 +233,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsEscape() {
+ void testEqualsEscape() {
final CSVFormat right = CSVFormat.newFormat('\'').builder().setQuote('"').setCommentMarker('#').setEscape('+').setQuoteMode(QuoteMode.ALL).get();
final CSVFormat left = right.builder().setEscape('!').get();
@@ -242,7 +242,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testEqualsEscape_Deprecated() {
+ void testEqualsEscape_Deprecated() {
final CSVFormat right = CSVFormat.newFormat('\'').withQuote('"').withCommentMarker('#').withEscape('+').withQuoteMode(QuoteMode.ALL);
final CSVFormat left = right.withEscape('!');
@@ -250,7 +250,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsHash() throws Exception {
+ void testEqualsHash() throws Exception {
final Method[] methods = CSVFormat.class.getDeclaredMethods();
for (final Method method : methods) {
if (Modifier.isPublic(method.getModifiers())) {
@@ -322,7 +322,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsHeader() {
+ void testEqualsHeader() {
final CSVFormat right = CSVFormat.newFormat('\'').builder().setRecordSeparator(CR).setCommentMarker('#').setEscape('+').setHeader("One", "Two", "Three")
.setIgnoreEmptyLines(true).setIgnoreSurroundingSpaces(true).setQuote('"').setQuoteMode(QuoteMode.ALL).get();
final CSVFormat left = right.builder().setHeader("Three", "Two", "One").get();
@@ -332,7 +332,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testEqualsHeader_Deprecated() {
+ void testEqualsHeader_Deprecated() {
final CSVFormat right = CSVFormat.newFormat('\'').withRecordSeparator(CR).withCommentMarker('#').withEscape('+').withHeader("One", "Two", "Three")
.withIgnoreEmptyLines().withIgnoreSurroundingSpaces().withQuote('"').withQuoteMode(QuoteMode.ALL);
final CSVFormat left = right.withHeader("Three", "Two", "One");
@@ -341,7 +341,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsIgnoreEmptyLines() {
+ void testEqualsIgnoreEmptyLines() {
final CSVFormat right = CSVFormat.newFormat('\'').builder().setCommentMarker('#').setEscape('+').setIgnoreEmptyLines(true)
.setIgnoreSurroundingSpaces(true).setQuote('"').setQuoteMode(QuoteMode.ALL).get();
final CSVFormat left = right.builder().setIgnoreEmptyLines(false).get();
@@ -351,7 +351,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testEqualsIgnoreEmptyLines_Deprecated() {
+ void testEqualsIgnoreEmptyLines_Deprecated() {
final CSVFormat right = CSVFormat.newFormat('\'').withCommentMarker('#').withEscape('+').withIgnoreEmptyLines().withIgnoreSurroundingSpaces()
.withQuote('"').withQuoteMode(QuoteMode.ALL);
final CSVFormat left = right.withIgnoreEmptyLines(false);
@@ -360,7 +360,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsIgnoreSurroundingSpaces() {
+ void testEqualsIgnoreSurroundingSpaces() {
final CSVFormat right = CSVFormat.newFormat('\'').builder().setCommentMarker('#').setEscape('+').setIgnoreSurroundingSpaces(true).setQuote('"')
.setQuoteMode(QuoteMode.ALL).get();
final CSVFormat left = right.builder().setIgnoreSurroundingSpaces(false).get();
@@ -370,7 +370,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testEqualsIgnoreSurroundingSpaces_Deprecated() {
+ void testEqualsIgnoreSurroundingSpaces_Deprecated() {
final CSVFormat right = CSVFormat.newFormat('\'').withCommentMarker('#').withEscape('+').withIgnoreSurroundingSpaces().withQuote('"')
.withQuoteMode(QuoteMode.ALL);
final CSVFormat left = right.withIgnoreSurroundingSpaces(false);
@@ -379,7 +379,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsLeftNoQuoteRightQuote() {
+ void testEqualsLeftNoQuoteRightQuote() {
final CSVFormat left = CSVFormat.newFormat(',').builder().setQuote(null).get();
final CSVFormat right = left.builder().setQuote('#').get();
@@ -388,7 +388,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testEqualsLeftNoQuoteRightQuote_Deprecated() {
+ void testEqualsLeftNoQuoteRightQuote_Deprecated() {
final CSVFormat left = CSVFormat.newFormat(',').withQuote(null);
final CSVFormat right = left.withQuote('#');
@@ -396,7 +396,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsNoQuotes() {
+ void testEqualsNoQuotes() {
final CSVFormat left = CSVFormat.newFormat(',').builder().setQuote(null).get();
final CSVFormat right = left.builder().setQuote(null).get();
@@ -405,7 +405,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testEqualsNoQuotes_Deprecated() {
+ void testEqualsNoQuotes_Deprecated() {
final CSVFormat left = CSVFormat.newFormat(',').withQuote(null);
final CSVFormat right = left.withQuote(null);
@@ -413,7 +413,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsNullString() {
+ void testEqualsNullString() {
final CSVFormat right = CSVFormat.newFormat('\'').builder().setRecordSeparator(CR).setCommentMarker('#').setEscape('+').setIgnoreEmptyLines(true)
.setIgnoreSurroundingSpaces(true).setQuote('"').setQuoteMode(QuoteMode.ALL).setNullString("null").get();
final CSVFormat left = right.builder().setNullString("---").get();
@@ -423,7 +423,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testEqualsNullString_Deprecated() {
+ void testEqualsNullString_Deprecated() {
final CSVFormat right = CSVFormat.newFormat('\'').withRecordSeparator(CR).withCommentMarker('#').withEscape('+').withIgnoreEmptyLines()
.withIgnoreSurroundingSpaces().withQuote('"').withQuoteMode(QuoteMode.ALL).withNullString("null");
final CSVFormat left = right.withNullString("---");
@@ -432,7 +432,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsOne() {
+ void testEqualsOne() {
final CSVFormat csvFormatOne = CSVFormat.INFORMIX_UNLOAD;
final CSVFormat csvFormatTwo = CSVFormat.MYSQL;
@@ -562,7 +562,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsQuoteChar() {
+ void testEqualsQuoteChar() {
final CSVFormat right = CSVFormat.newFormat('\'').builder().setQuote('"').get();
final CSVFormat left = right.builder().setQuote('!').get();
@@ -571,7 +571,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testEqualsQuoteChar_Deprecated() {
+ void testEqualsQuoteChar_Deprecated() {
final CSVFormat right = CSVFormat.newFormat('\'').withQuote('"');
final CSVFormat left = right.withQuote('!');
@@ -579,7 +579,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsQuotePolicy() {
+ void testEqualsQuotePolicy() {
final CSVFormat right = CSVFormat.newFormat('\'').builder().setQuote('"').setQuoteMode(QuoteMode.ALL).get();
final CSVFormat left = right.builder().setQuoteMode(QuoteMode.MINIMAL).get();
@@ -588,7 +588,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testEqualsQuotePolicy_Deprecated() {
+ void testEqualsQuotePolicy_Deprecated() {
final CSVFormat right = CSVFormat.newFormat('\'').withQuote('"').withQuoteMode(QuoteMode.ALL);
final CSVFormat left = right.withQuoteMode(QuoteMode.MINIMAL);
@@ -596,7 +596,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsRecordSeparator() {
+ void testEqualsRecordSeparator() {
final CSVFormat right = CSVFormat.newFormat('\'').builder().setRecordSeparator(CR).setCommentMarker('#').setEscape('+').setIgnoreEmptyLines(true)
.setIgnoreSurroundingSpaces(true).setQuote('"').setQuoteMode(QuoteMode.ALL).get();
final CSVFormat left = right.builder().setRecordSeparator(LF).get();
@@ -606,7 +606,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testEqualsRecordSeparator_Deprecated() {
+ void testEqualsRecordSeparator_Deprecated() {
final CSVFormat right = CSVFormat.newFormat('\'').withRecordSeparator(CR).withCommentMarker('#').withEscape('+').withIgnoreEmptyLines()
.withIgnoreSurroundingSpaces().withQuote('"').withQuoteMode(QuoteMode.ALL);
final CSVFormat left = right.withRecordSeparator(LF);
@@ -614,7 +614,7 @@ public class CSVFormatTest {
assertNotEquals(right, left);
}
- public void testEqualsSkipHeaderRecord() {
+ void testEqualsSkipHeaderRecord() {
final CSVFormat right = CSVFormat.newFormat('\'').builder().setRecordSeparator(CR).setCommentMarker('#').setEscape('+').setIgnoreEmptyLines(true)
.setIgnoreSurroundingSpaces(true).setQuote('"').setQuoteMode(QuoteMode.ALL).setNullString("null").setSkipHeaderRecord(true).get();
final CSVFormat left = right.builder().setSkipHeaderRecord(false).get();
@@ -624,7 +624,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testEqualsSkipHeaderRecord_Deprecated() {
+ void testEqualsSkipHeaderRecord_Deprecated() {
final CSVFormat right = CSVFormat.newFormat('\'').withRecordSeparator(CR).withCommentMarker('#').withEscape('+').withIgnoreEmptyLines()
.withIgnoreSurroundingSpaces().withQuote('"').withQuoteMode(QuoteMode.ALL).withNullString("null").withSkipHeaderRecord();
final CSVFormat left = right.withSkipHeaderRecord(false);
@@ -633,7 +633,7 @@ public class CSVFormatTest {
}
@Test
- public void testEqualsWithNull() {
+ void testEqualsWithNull() {
final CSVFormat csvFormat = CSVFormat.POSTGRESQL_TEXT;
@@ -696,18 +696,18 @@ public class CSVFormatTest {
}
@Test
- public void testEscapeSameAsCommentStartThrowsException() {
+ void testEscapeSameAsCommentStartThrowsException() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.builder().setEscape('!').setCommentMarker('!').get());
}
@SuppressWarnings("deprecation")
@Test
- public void testEscapeSameAsCommentStartThrowsException_Deprecated() {
+ void testEscapeSameAsCommentStartThrowsException_Deprecated() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withEscape('!').withCommentMarker('!'));
}
@Test
- public void testEscapeSameAsCommentStartThrowsExceptionForWrapperType() {
+ void testEscapeSameAsCommentStartThrowsExceptionForWrapperType() {
// Cannot assume that callers won't use different Character objects
assertThrows(IllegalArgumentException.class,
() -> CSVFormat.DEFAULT.builder().setEscape(Character.valueOf('!')).setCommentMarker(Character.valueOf('!')).get());
@@ -715,13 +715,13 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testEscapeSameAsCommentStartThrowsExceptionForWrapperType_Deprecated() {
+ void testEscapeSameAsCommentStartThrowsExceptionForWrapperType_Deprecated() {
// Cannot assume that callers won't use different Character objects
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withEscape(Character.valueOf('!')).withCommentMarker(Character.valueOf('!')));
}
@Test
- public void testFormat() {
+ void testFormat() {
final CSVFormat format = CSVFormat.DEFAULT;
assertEquals("", format.format());
@@ -730,7 +730,7 @@ public class CSVFormatTest {
}
@Test // I assume this to be a defect.
- public void testFormatThrowsNullPointerException() {
+ void testFormatThrowsNullPointerException() {
final CSVFormat csvFormat = CSVFormat.MYSQL;
@@ -739,7 +739,7 @@ public class CSVFormatTest {
}
@Test
- public void testFormatToString() {
+ void testFormatToString() {
// @formatter:off
final CSVFormat format = CSVFormat.RFC4180
.withEscape('?')
@@ -759,7 +759,7 @@ public class CSVFormatTest {
}
@Test
- public void testGetAllowDuplicateHeaderNames() {
+ void testGetAllowDuplicateHeaderNames() {
final Builder builder = CSVFormat.DEFAULT.builder();
assertTrue(builder.get().getAllowDuplicateHeaderNames());
assertTrue(builder.setDuplicateHeaderMode(DuplicateHeaderMode.ALLOW_ALL).get().getAllowDuplicateHeaderNames());
@@ -768,7 +768,7 @@ public class CSVFormatTest {
}
@Test
- public void testGetDuplicateHeaderMode() {
+ void testGetDuplicateHeaderMode() {
final Builder builder = CSVFormat.DEFAULT.builder();
assertEquals(DuplicateHeaderMode.ALLOW_ALL, builder.get().getDuplicateHeaderMode());
@@ -778,7 +778,7 @@ public class CSVFormatTest {
}
@Test
- public void testGetHeader() {
+ void testGetHeader() {
final String[] header = { "one", "two", "three" };
final CSVFormat formatWithHeader = CSVFormat.DEFAULT.withHeader(header);
// getHeader() makes a copy of the header array.
@@ -791,7 +791,7 @@ public class CSVFormatTest {
}
@Test
- public void testHashCodeAndWithIgnoreHeaderCase() {
+ void testHashCodeAndWithIgnoreHeaderCase() {
final CSVFormat csvFormat = CSVFormat.INFORMIX_UNLOAD_CSV;
final CSVFormat csvFormatTwo = csvFormat.withIgnoreHeaderCase();
@@ -809,18 +809,18 @@ public class CSVFormatTest {
}
@Test
- public void testJiraCsv236() {
+ void testJiraCsv236() {
CSVFormat.DEFAULT.builder().setAllowDuplicateHeaderNames(true).setHeader("CC", "VV", "VV").get();
}
@SuppressWarnings("deprecation")
@Test
- public void testJiraCsv236__Deprecated() {
+ void testJiraCsv236__Deprecated() {
CSVFormat.DEFAULT.withAllowDuplicateHeaderNames().withHeader("CC", "VV", "VV");
}
@Test
- public void testNewFormat() {
+ void testNewFormat() {
final CSVFormat csvFormat = CSVFormat.newFormat('X');
@@ -881,7 +881,7 @@ public class CSVFormatTest {
}
@Test
- public void testNullRecordSeparatorCsv106() {
+ void testNullRecordSeparatorCsv106() {
final CSVFormat format = CSVFormat.newFormat(';').builder().setSkipHeaderRecord(true).setHeader("H1", "H2").get();
final String formatStr = format.format("A", "B");
assertNotNull(formatStr);
@@ -890,7 +890,7 @@ public class CSVFormatTest {
@SuppressWarnings("deprecation")
@Test
- public void testNullRecordSeparatorCsv106__Deprecated() {
+ void testNullRecordSeparatorCsv106__Deprecated() {
final CSVFormat format = CSVFormat.newFormat(';').withSkipHeaderRecord().withHeader("H1", "H2");
final String formatStr = format.format("A", "B");
assertNotNull(formatStr);
@@ -898,7 +898,7 @@ public class CSVFormatTest {
}
@Test
- public void testPrintRecord() throws IOException {
+ void testPrintRecord() throws IOException {
final Appendable out = new StringBuilder();
final CSVFormat format = CSVFormat.RFC4180;
format.printRecord(out, "a", "b", "c");
@@ -906,7 +906,7 @@ public class CSVFormatTest {
}
@Test
- public void testPrintRecordEmpty() throws IOException {
+ void testPrintRecordEmpty() throws IOException {
final Appendable out = new StringBuilder();
final CSVFormat format = CSVFormat.RFC4180;
format.printRecord(out);
@@ -914,7 +914,7 @@ public class CSVFormatTest {
}
@Test
- public void testPrintWithEscapesEndWithCRLF() throws IOException {
+ void testPrintWithEscapesEndWithCRLF() throws IOException {
final Reader in = new StringReader("x,y,x\r\na,?b,c\r\n");
final Appendable out = new StringBuilder();
final CSVFormat format = CSVFormat.RFC4180.withEscape('?').withDelimiter(',').withQuote(null).withRecordSeparator(CRLF);
@@ -923,7 +923,7 @@ public class CSVFormatTest {
}
@Test
- public void testPrintWithEscapesEndWithoutCRLF() throws IOException {
+ void testPrintWithEscapesEndWithoutCRLF() throws IOException {
final Reader in = new StringReader("x,y,x");
final Appendable out = new StringBuilder();
final CSVFormat format = CSVFormat.RFC4180.withEscape('?').withDelimiter(',').withQuote(null).withRecordSeparator(CRLF);
@@ -932,7 +932,7 @@ public class CSVFormatTest {
}
@Test
- public void testPrintWithoutQuotes() throws IOException {
+ void testPrintWithoutQuotes() throws IOException {
final Reader in = new StringReader("");
final Appendable out = new StringBuilder();
final CSVFormat format = CSVFormat.RFC4180.withDelimiter(',').withQuote('"').withEscape('?').withQuoteMode(QuoteMode.NON_NUMERIC);
@@ -941,7 +941,7 @@ public class CSVFormatTest {
}
@Test
- public void testPrintWithQuoteModeIsNONE() throws IOException {
+ void testPrintWithQuoteModeIsNONE() throws IOException {
final Reader in = new StringReader("a,b,c");
final Appendable out = new StringBuilder();
final CSVFormat format = CSVFormat.RFC4180.withDelimiter(',').withQuote('"').withEscape('?').withQuoteMode(QuoteMode.NONE);
@@ -950,7 +950,7 @@ public class CSVFormatTest {
}
@Test
- public void testPrintWithQuotes() throws IOException {
+ void testPrintWithQuotes() throws IOException {
final Reader in = new StringReader("\"a,b,c\r\nx,y,z");
final Appendable out = new StringBuilder();
final CSVFormat format = CSVFormat.RFC4180.withDelimiter(',').withQuote('"').withEscape('?').withQuoteMode(QuoteMode.NON_NUMERIC);
@@ -959,42 +959,42 @@ public class CSVFormatTest {
}
@Test
- public void testQuoteCharSameAsCommentStartThrowsException() {
+ void testQuoteCharSameAsCommentStartThrowsException() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.builder().setQuote('!').setCommentMarker('!').get());
}
@SuppressWarnings("deprecation")
@Test
- public void testQuoteCharSameAsCommentStartThrowsException_Deprecated() {
+ void testQuoteCharSameAsCommentStartThrowsException_Deprecated() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withQuote('!').withCommentMarker('!'));
}
@Test
- public void testQuoteCharSameAsCommentStartThrowsExceptionForWrapperType() {
+ void testQuoteCharSameAsCommentStartThrowsExceptionForWrapperType() {
// Cannot assume that callers won't use different Character objects
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.builder().setQuote(Character.valueOf('!')).setCommentMarker('!').get());
}
@SuppressWarnings("deprecation")
@Test
- public void testQuoteCharSameAsCommentStartThrowsExceptionForWrapperType_Deprecated() {
+ void testQuoteCharSameAsCommentStartThrowsExceptionForWrapperType_Deprecated() {
// Cannot assume that callers won't use different Character objects
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withQuote(Character.valueOf('!')).withCommentMarker('!'));
}
@Test
- public void testQuoteCharSameAsDelimiterThrowsException() {
+ void testQuoteCharSameAsDelimiterThrowsException() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.builder().setQuote('!').setDelimiter('!').get());
}
@SuppressWarnings("deprecation")
@Test
- public void testQuoteCharSameAsDelimiterThrowsException_Deprecated() {
+ void testQuoteCharSameAsDelimiterThrowsException_Deprecated() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withQuote('!').withDelimiter('!'));
}
@Test
- public void testQuoteModeNoneShouldReturnMeaningfulExceptionMessage() {
+ void testQuoteModeNoneShouldReturnMeaningfulExceptionMessage() {
final Exception exception = assertThrows(IllegalArgumentException.class, () ->
// @formatter:off
CSVFormat.DEFAULT.builder()
@@ -1009,18 +1009,18 @@ public class CSVFormatTest {
}
@Test
- public void testQuotePolicyNoneWithoutEscapeThrowsException() {
+ void testQuotePolicyNoneWithoutEscapeThrowsException() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.newFormat('!').builder().setQuoteMode(QuoteMode.NONE).get());
}
@SuppressWarnings("deprecation")
@Test
- public void testQuotePolicyNoneWithoutEscapeThrowsException_Deprecated() {
+ void testQuotePolicyNoneWithoutEscapeThrowsException_Deprecated() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.newFormat('!').withQuoteMode(QuoteMode.NONE));
}
@Test
- public void testRFC4180() {
+ void testRFC4180() {
assertNull(RFC4180.getCommentMarker());
assertEquals(',', RFC4180.getDelimiter());
assertNull(RFC4180.getEscapeCharacter());
@@ -1032,7 +1032,7 @@ public class CSVFormatTest {
@SuppressWarnings("boxing") // no need to worry about boxing here
@Test
- public void testSerialization() throws Exception {
+ void testSerialization() throws Exception {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
try (ObjectOutputStream oos = new ObjectOutputStream(out)) {
@@ -1054,7 +1054,7 @@ public class CSVFormatTest {
}
@Test
- public void testToString() {
+ void testToString() {
final String string = CSVFormat.INFORMIX_UNLOAD.toString();
@@ -1063,7 +1063,7 @@ public class CSVFormatTest {
}
@Test
- public void testToStringAndWithCommentMarkerTakingCharacter() {
+ void testToStringAndWithCommentMarkerTakingCharacter() {
final CSVFormat.Predefined csvFormatPredefined = CSVFormat.Predefined.Default;
final CSVFormat csvFormat = csvFormatPredefined.getFormat();
@@ -1224,7 +1224,7 @@ public class CSVFormatTest {
}
@Test
- public void testTrim() throws IOException {
+ void testTrim() throws IOException {
final CSVFormat formatWithTrim = CSVFormat.DEFAULT.withDelimiter(',').withTrim().withQuote(null).withRecordSeparator(CRLF);
CharSequence in = "a,b,c";
@@ -1249,29 +1249,29 @@ public class CSVFormatTest {
}
@Test
- public void testWithCommentStart() {
+ void testWithCommentStart() {
final CSVFormat formatWithCommentStart = CSVFormat.DEFAULT.withCommentMarker('#');
assertEquals(Character.valueOf('#'), formatWithCommentStart.getCommentMarker());
}
@Test
- public void testWithCommentStartCRThrowsException() {
+ void testWithCommentStartCRThrowsException() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withCommentMarker(CR));
}
@Test
- public void testWithDelimiter() {
+ void testWithDelimiter() {
final CSVFormat formatWithDelimiter = CSVFormat.DEFAULT.withDelimiter('!');
assertEquals('!', formatWithDelimiter.getDelimiter());
}
@Test
- public void testWithDelimiterLFThrowsException() {
+ void testWithDelimiterLFThrowsException() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withDelimiter(LF));
}
@Test
- public void testWithEmptyDuplicates() {
+ void testWithEmptyDuplicates() {
final CSVFormat formatWithEmptyDuplicates = CSVFormat.DEFAULT.builder().setDuplicateHeaderMode(DuplicateHeaderMode.ALLOW_EMPTY).get();
assertEquals(DuplicateHeaderMode.ALLOW_EMPTY, formatWithEmptyDuplicates.getDuplicateHeaderMode());
@@ -1279,31 +1279,31 @@ public class CSVFormatTest {
}
@Test
- public void testWithEmptyEnum() {
+ void testWithEmptyEnum() {
final CSVFormat formatWithHeader = CSVFormat.DEFAULT.withHeader(EmptyEnum.class);
assertEquals(0, formatWithHeader.getHeader().length);
}
@Test
- public void testWithEscape() {
+ void testWithEscape() {
final CSVFormat formatWithEscape = CSVFormat.DEFAULT.withEscape('&');
assertEquals(Character.valueOf('&'), formatWithEscape.getEscapeCharacter());
}
@Test
- public void testWithEscapeCRThrowsExceptions() {
+ void testWithEscapeCRThrowsExceptions() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withEscape(CR));
}
@Test
- public void testWithFirstRecordAsHeader() {
+ void testWithFirstRecordAsHeader() {
final CSVFormat formatWithFirstRecordAsHeader = CSVFormat.DEFAULT.withFirstRecordAsHeader();
assertTrue(formatWithFirstRecordAsHeader.getSkipHeaderRecord());
assertEquals(0, formatWithFirstRecordAsHeader.getHeader().length);
}
@Test
- public void testWithHeader() {
+ void testWithHeader() {
final String[] header = { "one", "two", "three" };
// withHeader() makes a copy of the header array.
final CSVFormat formatWithHeader = CSVFormat.DEFAULT.withHeader(header);
@@ -1312,7 +1312,7 @@ public class CSVFormatTest {
}
@Test
- public void testWithHeaderComments() {
+ void testWithHeaderComments() {
final CSVFormat csvFormat = CSVFormat.DEFAULT;
@@ -1473,80 +1473,80 @@ public class CSVFormatTest {
}
@Test
- public void testWithHeaderEnum() {
+ void testWithHeaderEnum() {
final CSVFormat formatWithHeader = CSVFormat.DEFAULT.withHeader(Header.class);
assertArrayEquals(new String[] { "Name", "Email", "Phone" }, formatWithHeader.getHeader());
}
@Test
- public void testWithHeaderEnumNull() {
+ void testWithHeaderEnumNull() {
final CSVFormat format = CSVFormat.DEFAULT;
final Class<Enum<?>> simpleName = null;
format.withHeader(simpleName);
}
@Test
- public void testWithHeaderResultSetNull() throws SQLException {
+ void testWithHeaderResultSetNull() throws SQLException {
final CSVFormat format = CSVFormat.DEFAULT;
final ResultSet resultSet = null;
format.withHeader(resultSet);
}
@Test
- public void testWithIgnoreEmptyLines() {
+ void testWithIgnoreEmptyLines() {
assertFalse(CSVFormat.DEFAULT.withIgnoreEmptyLines(false).getIgnoreEmptyLines());
assertTrue(CSVFormat.DEFAULT.withIgnoreEmptyLines().getIgnoreEmptyLines());
}
@Test
- public void testWithIgnoreSurround() {
+ void testWithIgnoreSurround() {
assertFalse(CSVFormat.DEFAULT.withIgnoreSurroundingSpaces(false).getIgnoreSurroundingSpaces());
assertTrue(CSVFormat.DEFAULT.withIgnoreSurroundingSpaces().getIgnoreSurroundingSpaces());
}
@Test
- public void testWithNullString() {
+ void testWithNullString() {
final CSVFormat formatWithNullString = CSVFormat.DEFAULT.withNullString("null");
assertEquals("null", formatWithNullString.getNullString());
}
@Test
- public void testWithQuoteChar() {
+ void testWithQuoteChar() {
final CSVFormat formatWithQuoteChar = CSVFormat.DEFAULT.withQuote('"');
assertEquals(Character.valueOf('"'), formatWithQuoteChar.getQuoteCharacter());
}
@Test
- public void testWithQuoteLFThrowsException() {
+ void testWithQuoteLFThrowsException() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withQuote(LF));
}
@Test
- public void testWithQuotePolicy() {
+ void testWithQuotePolicy() {
final CSVFormat formatWithQuotePolicy = CSVFormat.DEFAULT.withQuoteMode(QuoteMode.ALL);
assertEquals(QuoteMode.ALL, formatWithQuotePolicy.getQuoteMode());
}
@Test
- public void testWithRecordSeparatorCR() {
+ void testWithRecordSeparatorCR() {
final CSVFormat formatWithRecordSeparator = CSVFormat.DEFAULT.withRecordSeparator(CR);
assertEquals(String.valueOf(CR), formatWithRecordSeparator.getRecordSeparator());
}
@Test
- public void testWithRecordSeparatorCRLF() {
+ void testWithRecordSeparatorCRLF() {
final CSVFormat formatWithRecordSeparator = CSVFormat.DEFAULT.withRecordSeparator(CRLF);
assertEquals(CRLF, formatWithRecordSeparator.getRecordSeparator());
}
@Test
- public void testWithRecordSeparatorLF() {
+ void testWithRecordSeparatorLF() {
final CSVFormat formatWithRecordSeparator = CSVFormat.DEFAULT.withRecordSeparator(LF);
assertEquals(String.valueOf(LF), formatWithRecordSeparator.getRecordSeparator());
}
@Test
- public void testWithSystemRecordSeparator() {
+ void testWithSystemRecordSeparator() {
final CSVFormat formatWithRecordSeparator = CSVFormat.DEFAULT.withSystemRecordSeparator();
assertEquals(System.lineSeparator(), formatWithRecordSeparator.getRecordSeparator());
}
diff --git a/src/test/java/org/apache/commons/csv/CSVParserTest.java b/src/test/java/org/apache/commons/csv/CSVParserTest.java
index 20ab9b65..8304a568 100644
--- a/src/test/java/org/apache/commons/csv/CSVParserTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVParserTest.java
@@ -140,7 +140,7 @@ public class CSVParserTest {
}
@Test
- public void testBackslashEscaping() throws IOException {
+ void testBackslashEscaping() throws IOException {
// To avoid confusion over the need for escaping chars in java code,
// We will test with a forward slash as the escape char, and a single
// quote as the encapsulator.
@@ -176,7 +176,7 @@ public class CSVParserTest {
}
@Test
- public void testBackslashEscaping2() throws IOException {
+ void testBackslashEscaping2() throws IOException {
// To avoid confusion over the need for escaping chars in java code,
// We will test with a forward slash as the escape char, and a single
// quote as the encapsulator.
@@ -200,7 +200,7 @@ public class CSVParserTest {
@Test
@Disabled
- public void testBackslashEscapingOld() throws IOException {
+ void testBackslashEscapingOld() throws IOException {
final String code = "one,two,three\n" + "on\\\"e,two\n" + "on\"e,two\n" + "one,\"tw\\\"o\"\n" + "one,\"t\\,wo\"\n" + "one,two,\"th,ree\"\n" +
"\"a\\\\\"\n" + "a\\,b\n" + "\"a\\\\,b\"";
final String[][] res = { { "one", "two", "three" }, { "on\\\"e", "two" }, { "on\"e", "two" }, { "one", "tw\"o" }, { "one", "t\\,wo" }, // backslash in
@@ -224,7 +224,7 @@ public class CSVParserTest {
@Test
@Disabled("CSV-107")
- public void testBOM() throws IOException {
+ void testBOM() throws IOException {
final URL url = ClassLoader.getSystemClassLoader().getResource("org/apache/commons/csv/CSVFileParser/bom.csv");
try (CSVParser parser = CSVParser.parse(url, StandardCharsets.UTF_8, EXCEL_WITH_HEADER)) {
parser.forEach(record -> assertNotNull(record.get("Date")));
@@ -232,7 +232,7 @@ public class CSVParserTest {
}
@Test
- public void testBOMInputStreamParserWithInputStream() throws IOException {
+ void testBOMInputStreamParserWithInputStream() throws IOException {
try (BOMInputStream inputStream = createBOMInputStream("org/apache/commons/csv/CSVFileParser/bom.csv");
CSVParser parser = CSVParser.parse(inputStream, UTF_8, EXCEL_WITH_HEADER)) {
parser.forEach(record -> assertNotNull(record.get("Date")));
@@ -240,7 +240,7 @@ public class CSVParserTest {
}
@Test
- public void testBOMInputStreamParserWithReader() throws IOException {
+ void testBOMInputStreamParserWithReader() throws IOException {
try (Reader reader = new InputStreamReader(createBOMInputStream("org/apache/commons/csv/CSVFileParser/bom.csv"), UTF_8_NAME);
CSVParser parser = CSVParser.builder()
.setReader(reader)
@@ -251,7 +251,7 @@ public class CSVParserTest {
}
@Test
- public void testBOMInputStreamParseWithReader() throws IOException {
+ void testBOMInputStreamParseWithReader() throws IOException {
try (Reader reader = new InputStreamReader(createBOMInputStream("org/apache/commons/csv/CSVFileParser/bom.csv"), UTF_8_NAME);
CSVParser parser = CSVParser.builder()
.setReader(reader)
@@ -262,7 +262,7 @@ public class CSVParserTest {
}
@Test
- public void testCarriageReturnEndings() throws IOException {
+ void testCarriageReturnEndings() throws IOException {
final String string = "foo\rbaar,\rhello,world\r,kanu";
try (CSVParser parser = CSVParser.builder().setCharSequence(string).get()) {
final List<CSVRecord> records = parser.getRecords();
@@ -271,7 +271,7 @@ public class CSVParserTest {
}
@Test
- public void testCarriageReturnLineFeedEndings() throws IOException {
+ void testCarriageReturnLineFeedEndings() throws IOException {
final String string = "foo\r\nbaar,\r\nhello,world\r\n,kanu";
try (CSVParser parser = CSVParser.builder().setCharSequence(string).get()) {
final List<CSVRecord> records = parser.getRecords();
@@ -280,7 +280,7 @@ public class CSVParserTest {
}
@Test
- public void testClose() throws Exception {
+ void testClose() throws Exception {
final Reader in = new StringReader("# comment\na,b,c\n1,2,3\nx,y,z");
final Iterator<CSVRecord> records;
try (CSVParser parser = CSVFormat.DEFAULT.withCommentMarker('#').withHeader().parse(in)) {
@@ -292,32 +292,32 @@ public class CSVParserTest {
}
@Test
- public void testCSV141CSVFormat_DEFAULT() throws Exception {
+ void testCSV141CSVFormat_DEFAULT() throws Exception {
testCSV141Failure(CSVFormat.DEFAULT, 3);
}
@Test
- public void testCSV141CSVFormat_INFORMIX_UNLOAD() throws Exception {
+ void testCSV141CSVFormat_INFORMIX_UNLOAD() throws Exception {
testCSV141Failure(CSVFormat.INFORMIX_UNLOAD, 1);
}
@Test
- public void testCSV141CSVFormat_INFORMIX_UNLOAD_CSV() throws Exception {
+ void testCSV141CSVFormat_INFORMIX_UNLOAD_CSV() throws Exception {
testCSV141Failure(CSVFormat.INFORMIX_UNLOAD_CSV, 3);
}
@Test
- public void testCSV141CSVFormat_ORACLE() throws Exception {
+ void testCSV141CSVFormat_ORACLE() throws Exception {
testCSV141Failure(CSVFormat.ORACLE, 2);
}
@Test
- public void testCSV141CSVFormat_POSTGRESQL_CSV() throws Exception {
+ void testCSV141CSVFormat_POSTGRESQL_CSV() throws Exception {
testCSV141Failure(CSVFormat.POSTGRESQL_CSV, 3);
}
@Test
- public void testCSV141Excel() throws Exception {
+ void testCSV141Excel() throws Exception {
testCSV141Ok(CSVFormat.EXCEL);
}
@@ -387,12 +387,12 @@ public class CSVParserTest {
}
@Test
- public void testCSV141RFC4180() throws Exception {
+ void testCSV141RFC4180() throws Exception {
testCSV141Failure(CSVFormat.RFC4180, 3);
}
@Test
- public void testCSV235() throws IOException {
+ void testCSV235() throws IOException {
final String dqString = "\"aaa\",\"b\"\"bb\",\"ccc\""; // "aaa","b""bb","ccc"
try (CSVParser parser = CSVFormat.RFC4180.parse(new StringReader(dqString))) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -406,7 +406,7 @@ public class CSVParserTest {
}
@Test
- public void testCSV57() throws Exception {
+ void testCSV57() throws Exception {
try (CSVParser parser = CSVParser.parse("", CSVFormat.DEFAULT)) {
final List<CSVRecord> list = parser.getRecords();
assertNotNull(list);
@@ -415,7 +415,7 @@ public class CSVParserTest {
}
@Test
- public void testDefaultFormat() throws IOException {
+ void testDefaultFormat() throws IOException {
// @formatter:off
final String code = "" + "a,b#\n" + // 1)
"\"\n\",\" \",#\n" + // 2)
@@ -440,20 +440,20 @@ public class CSVParserTest {
}
@Test
- public void testDuplicateHeadersAllowedByDefault() throws Exception {
+ void testDuplicateHeadersAllowedByDefault() throws Exception {
try (CSVParser parser = CSVParser.parse("a,b,a\n1,2,3\nx,y,z", CSVFormat.DEFAULT.withHeader())) {
// noop
}
}
@Test
- public void testDuplicateHeadersNotAllowed() {
+ void testDuplicateHeadersNotAllowed() {
assertThrows(IllegalArgumentException.class,
() -> CSVParser.parse("a,b,a\n1,2,3\nx,y,z", CSVFormat.DEFAULT.withHeader().withAllowDuplicateHeaderNames(false)));
}
@Test
- public void testEmptyFile() throws Exception {
+ void testEmptyFile() throws Exception {
try (CSVParser parser = CSVParser.parse(Paths.get("src/test/resources/org/apache/commons/csv/empty.txt"), StandardCharsets.UTF_8,
CSVFormat.DEFAULT)) {
assertNull(parser.nextRecord());
@@ -461,7 +461,7 @@ public class CSVParserTest {
}
@Test
- public void testEmptyFileHeaderParsing() throws Exception {
+ void testEmptyFileHeaderParsing() throws Exception {
try (CSVParser parser = CSVParser.parse("", CSVFormat.DEFAULT.withFirstRecordAsHeader())) {
assertNull(parser.nextRecord());
assertTrue(parser.getHeaderNames().isEmpty());
@@ -469,7 +469,7 @@ public class CSVParserTest {
}
@Test
- public void testEmptyLineBehaviorCSV() throws Exception {
+ void testEmptyLineBehaviorCSV() throws Exception {
final String[] codes = { "hello,\r\n\r\n\r\n", "hello,\n\n\n", "hello,\"\"\r\n\r\n\r\n", "hello,\"\"\n\n\n" };
final String[][] res = { { "hello", "" } // CSV format ignores empty lines
};
@@ -486,7 +486,7 @@ public class CSVParserTest {
}
@Test
- public void testEmptyLineBehaviorExcel() throws Exception {
+ void testEmptyLineBehaviorExcel() throws Exception {
final String[] codes = { "hello,\r\n\r\n\r\n", "hello,\n\n\n", "hello,\"\"\r\n\r\n\r\n", "hello,\"\"\n\n\n" };
final String[][] res = { { "hello", "" }, { "" }, // Excel format does not ignore empty lines
{ "" } };
@@ -503,14 +503,14 @@ public class CSVParserTest {
}
@Test
- public void testEmptyString() throws Exception {
+ void testEmptyString() throws Exception {
try (CSVParser parser = CSVParser.parse("", CSVFormat.DEFAULT)) {
assertNull(parser.nextRecord());
}
}
@Test
- public void testEndOfFileBehaviorCSV() throws Exception {
+ void testEndOfFileBehaviorCSV() throws Exception {
final String[] codes = { "hello,\r\n\r\nworld,\r\n", "hello,\r\n\r\nworld,", "hello,\r\n\r\nworld,\"\"\r\n", "hello,\r\n\r\nworld,\"\"",
"hello,\r\n\r\nworld,\n", "hello,\r\n\r\nworld,", "hello,\r\n\r\nworld,\"\"\n", "hello,\r\n\r\nworld,\"\"" };
final String[][] res = { { "hello", "" }, // CSV format ignores empty lines
@@ -528,7 +528,7 @@ public class CSVParserTest {
}
@Test
- public void testEndOfFileBehaviorExcel() throws Exception {
+ void testEndOfFileBehaviorExcel() throws Exception {
final String[] codes = { "hello,\r\n\r\nworld,\r\n", "hello,\r\n\r\nworld,", "hello,\r\n\r\nworld,\"\"\r\n", "hello,\r\n\r\nworld,\"\"",
"hello,\r\n\r\nworld,\n", "hello,\r\n\r\nworld,", "hello,\r\n\r\nworld,\"\"\n", "hello,\r\n\r\nworld,\"\"" };
final String[][] res = { { "hello", "" }, { "" }, // Excel format does not ignore empty lines
@@ -547,7 +547,7 @@ public class CSVParserTest {
}
@Test
- public void testExcelFormat1() throws IOException {
+ void testExcelFormat1() throws IOException {
final String code = "value1,value2,value3,value4\r\na,b,c,d\r\n x,,," + "\r\n\r\n\"\"\"hello\"\"\",\" \"\"world\"\"\",\"abc\ndef\",\r\n";
final String[][] res = { { "value1", "value2", "value3", "value4" }, { "a", "b", "c", "d" }, { " x", "", "", "" }, { "" },
{ "\"hello\"", " \"world\"", "abc\ndef", "" } };
@@ -562,7 +562,7 @@ public class CSVParserTest {
}
@Test
- public void testExcelFormat2() throws Exception {
+ void testExcelFormat2() throws Exception {
final String code = "foo,baar\r\n\r\nhello,\r\n\r\nworld,\r\n";
final String[][] res = { { "foo", "baar" }, { "" }, { "hello", "" }, { "" }, { "world", "" } };
try (CSVParser parser = CSVParser.parse(code, CSVFormat.EXCEL)) {
@@ -579,7 +579,7 @@ public class CSVParserTest {
* Tests an exported Excel worksheet with a header row and rows that have more columns than the headers
*/
@Test
- public void testExcelHeaderCountLessThanData() throws Exception {
+ void testExcelHeaderCountLessThanData() throws Exception {
final String code = "A,B,C,,\r\na,b,c,d,e\r\n";
try (CSVParser parser = CSVParser.parse(code, EXCEL_WITH_HEADER)) {
parser.getRecords().forEach(record -> {
@@ -591,7 +591,7 @@ public class CSVParserTest {
}
@Test
- public void testFirstEndOfLineCr() throws IOException {
+ void testFirstEndOfLineCr() throws IOException {
final String data = "foo\rbaar,\rhello,world\r,kanu";
try (CSVParser parser = CSVParser.parse(data, CSVFormat.DEFAULT)) {
final List<CSVRecord> records = parser.getRecords();
@@ -601,7 +601,7 @@ public class CSVParserTest {
}
@Test
- public void testFirstEndOfLineCrLf() throws IOException {
+ void testFirstEndOfLineCrLf() throws IOException {
final String data = "foo\r\nbaar,\r\nhello,world\r\n,kanu";
try (CSVParser parser = CSVParser.parse(data, CSVFormat.DEFAULT)) {
final List<CSVRecord> records = parser.getRecords();
@@ -611,7 +611,7 @@ public class CSVParserTest {
}
@Test
- public void testFirstEndOfLineLf() throws IOException {
+ void testFirstEndOfLineLf() throws IOException {
final String data = "foo\nbaar,\nhello,world\n,kanu";
try (CSVParser parser = CSVParser.parse(data, CSVFormat.DEFAULT)) {
final List<CSVRecord> records = parser.getRecords();
@@ -621,7 +621,7 @@ public class CSVParserTest {
}
@Test
- public void testForEach() throws Exception {
+ void testForEach() throws Exception {
try (Reader in = new StringReader("a,b,c\n1,2,3\nx,y,z");
CSVParser parser = CSVFormat.DEFAULT.parse(in)) {
final List<CSVRecord> records = new ArrayList<>();
@@ -636,7 +636,7 @@ public class CSVParserTest {
}
@Test
- public void testGetHeaderComment_HeaderComment1() throws IOException {
+ void testGetHeaderComment_HeaderComment1() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_HEADER_COMMENT, FORMAT_AUTO_HEADER)) {
parser.getRecords();
// Expect a header comment
@@ -646,7 +646,7 @@ public class CSVParserTest {
}
@Test
- public void testGetHeaderComment_HeaderComment2() throws IOException {
+ void testGetHeaderComment_HeaderComment2() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_HEADER_COMMENT, FORMAT_EXPLICIT_HEADER)) {
parser.getRecords();
// Expect a header comment
@@ -656,7 +656,7 @@ public class CSVParserTest {
}
@Test
- public void testGetHeaderComment_HeaderComment3() throws IOException {
+ void testGetHeaderComment_HeaderComment3() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_HEADER_COMMENT, FORMAT_EXPLICIT_HEADER_NOSKIP)) {
parser.getRecords();
// Expect no header comment - the text "comment" is attached to the first record
@@ -666,7 +666,7 @@ public class CSVParserTest {
}
@Test
- public void testGetHeaderComment_HeaderTrailerComment() throws IOException {
+ void testGetHeaderComment_HeaderTrailerComment() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_MULTILINE_HEADER_TRAILER_COMMENT, FORMAT_AUTO_HEADER)) {
parser.getRecords();
// Expect a header comment
@@ -676,7 +676,7 @@ public class CSVParserTest {
}
@Test
- public void testGetHeaderComment_NoComment1() throws IOException {
+ void testGetHeaderComment_NoComment1() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_NO_COMMENT, FORMAT_AUTO_HEADER)) {
parser.getRecords();
// Expect no header comment
@@ -686,7 +686,7 @@ public class CSVParserTest {
}
@Test
- public void testGetHeaderComment_NoComment2() throws IOException {
+ void testGetHeaderComment_NoComment2() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_NO_COMMENT, FORMAT_EXPLICIT_HEADER)) {
parser.getRecords();
// Expect no header comment
@@ -696,7 +696,7 @@ public class CSVParserTest {
}
@Test
- public void testGetHeaderComment_NoComment3() throws IOException {
+ void testGetHeaderComment_NoComment3() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_NO_COMMENT, FORMAT_EXPLICIT_HEADER_NOSKIP)) {
parser.getRecords();
// Expect no header comment
@@ -706,7 +706,7 @@ public class CSVParserTest {
}
@Test
- public void testGetHeaderMap() throws Exception {
+ void testGetHeaderMap() throws Exception {
try (CSVParser parser = CSVParser.parse("a,b,c\n1,2,3\nx,y,z", CSVFormat.DEFAULT.withHeader("A", "B", "C"))) {
final Map<String, Integer> headerMap = parser.getHeaderMap();
final Iterator<String> columnNames = headerMap.keySet().iterator();
@@ -730,7 +730,7 @@ public class CSVParserTest {
}
@Test
- public void testGetHeaderNames() throws IOException {
+ void testGetHeaderNames() throws IOException {
try (CSVParser parser = CSVParser.parse("a,b,c\n1,2,3\nx,y,z", CSVFormat.DEFAULT.withHeader("A", "B", "C"))) {
final Map<String, Integer> nameIndexMap = parser.getHeaderMap();
final List<String> headerNames = parser.getHeaderNames();
@@ -744,7 +744,7 @@ public class CSVParserTest {
}
@Test
- public void testGetHeaderNamesReadOnly() throws IOException {
+ void testGetHeaderNamesReadOnly() throws IOException {
try (CSVParser parser = CSVParser.parse("a,b,c\n1,2,3\nx,y,z", CSVFormat.DEFAULT.withHeader("A", "B", "C"))) {
final List<String> headerNames = parser.getHeaderNames();
assertNotNull(headerNames);
@@ -753,7 +753,7 @@ public class CSVParserTest {
}
@Test
- public void testGetLine() throws IOException {
+ void testGetLine() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT, CSVFormat.DEFAULT.withIgnoreSurroundingSpaces())) {
for (final String[] re : RESULT) {
assertArrayEquals(re, parser.nextRecord().values());
@@ -764,22 +764,22 @@ public class CSVParserTest {
}
@Test
- public void testGetLineNumberWithCR() throws Exception {
+ void testGetLineNumberWithCR() throws Exception {
validateLineNumbers(String.valueOf(CR));
}
@Test
- public void testGetLineNumberWithCRLF() throws Exception {
+ void testGetLineNumberWithCRLF() throws Exception {
validateLineNumbers(CRLF);
}
@Test
- public void testGetLineNumberWithLF() throws Exception {
+ void testGetLineNumberWithLF() throws Exception {
validateLineNumbers(String.valueOf(LF));
}
@Test
- public void testGetOneLine() throws IOException {
+ void testGetOneLine() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_1, CSVFormat.DEFAULT)) {
final CSVRecord record = parser.getRecords().get(0);
assertArrayEquals(RESULT[0], record.values());
@@ -792,7 +792,7 @@ public class CSVParserTest {
* @throws IOException when an I/O error occurs.
*/
@Test
- public void testGetOneLineOneParser() throws IOException {
+ void testGetOneLineOneParser() throws IOException {
final CSVFormat format = CSVFormat.DEFAULT;
try (PipedWriter writer = new PipedWriter();
PipedReader origin = new PipedReader(writer);
@@ -812,7 +812,7 @@ public class CSVParserTest {
}
@Test
- public void testGetRecordFourBytesRead() throws Exception {
+ void testGetRecordFourBytesRead() throws Exception {
final String code = "id,a,b,c\n" +
"1,😊,🤔,😂\n" +
"2,😊,🤔,😂\n" +
@@ -846,32 +846,32 @@ public class CSVParserTest {
}
@Test
- public void testGetRecordNumberWithCR() throws Exception {
+ void testGetRecordNumberWithCR() throws Exception {
validateRecordNumbers(String.valueOf(CR));
}
@Test
- public void testGetRecordNumberWithCRLF() throws Exception {
+ void testGetRecordNumberWithCRLF() throws Exception {
validateRecordNumbers(CRLF);
}
@Test
- public void testGetRecordNumberWithLF() throws Exception {
+ void testGetRecordNumberWithLF() throws Exception {
validateRecordNumbers(String.valueOf(LF));
}
@Test
- public void testGetRecordPositionWithCRLF() throws Exception {
+ void testGetRecordPositionWithCRLF() throws Exception {
validateRecordPosition(CRLF);
}
@Test
- public void testGetRecordPositionWithLF() throws Exception {
+ void testGetRecordPositionWithLF() throws Exception {
validateRecordPosition(String.valueOf(LF));
}
@Test
- public void testGetRecords() throws IOException {
+ void testGetRecords() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT, CSVFormat.DEFAULT.withIgnoreSurroundingSpaces())) {
final List<CSVRecord> records = parser.getRecords();
assertEquals(RESULT.length, records.size());
@@ -883,7 +883,7 @@ public class CSVParserTest {
}
@Test
- public void testGetRecordsFromBrokenInputStream() throws IOException {
+ void testGetRecordsFromBrokenInputStream() throws IOException {
@SuppressWarnings("resource") // We also get an exception on close, which is OK but can't assert in a try.
final CSVParser parser = CSVParser.parse(new BrokenInputStream(), UTF_8, CSVFormat.DEFAULT);
assertThrows(UncheckedIOException.class, parser::getRecords);
@@ -892,7 +892,7 @@ public class CSVParserTest {
@ParameterizedTest
@ValueSource(longs = { -1, 0, 1, 2, 3, 4, Long.MAX_VALUE })
- public void testGetRecordsMaxRows(final long maxRows) throws IOException {
+ void testGetRecordsMaxRows(final long maxRows) throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT, CSVFormat.DEFAULT.builder().setIgnoreSurroundingSpaces(true).setMaxRows(maxRows).get())) {
final List<CSVRecord> records = parser.getRecords();
final long expectedLength = maxRows <= 0 || maxRows > RESULT.length ? RESULT.length : maxRows;
@@ -905,7 +905,7 @@ public class CSVParserTest {
}
@Test
- public void testGetRecordThreeBytesRead() throws Exception {
+ void testGetRecordThreeBytesRead() throws Exception {
final String code = "id,date,val5,val4\n" +
"11111111111111,'4017-09-01',きちんと節分近くには咲いてる~,v4\n" +
"22222222222222,'4017-01-01',おはよう私の友人~,v4\n" +
@@ -941,7 +941,7 @@ public class CSVParserTest {
}
@Test
- public void testGetRecordWithMultiLineValues() throws Exception {
+ void testGetRecordWithMultiLineValues() throws Exception {
try (CSVParser parser = CSVParser.parse("\"a\r\n1\",\"a\r\n2\"" + CRLF + "\"b\r\n1\",\"b\r\n2\"" + CRLF + "\"c\r\n1\",\"c\r\n2\"",
CSVFormat.DEFAULT.withRecordSeparator(CRLF))) {
CSVRecord record;
@@ -966,7 +966,7 @@ public class CSVParserTest {
}
@Test
- public void testGetTrailerComment_HeaderComment1() throws IOException {
+ void testGetTrailerComment_HeaderComment1() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_HEADER_COMMENT, FORMAT_AUTO_HEADER)) {
parser.getRecords();
assertFalse(parser.hasTrailerComment());
@@ -975,7 +975,7 @@ public class CSVParserTest {
}
@Test
- public void testGetTrailerComment_HeaderComment2() throws IOException {
+ void testGetTrailerComment_HeaderComment2() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_HEADER_COMMENT, FORMAT_EXPLICIT_HEADER)) {
parser.getRecords();
assertFalse(parser.hasTrailerComment());
@@ -984,7 +984,7 @@ public class CSVParserTest {
}
@Test
- public void testGetTrailerComment_HeaderComment3() throws IOException {
+ void testGetTrailerComment_HeaderComment3() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_HEADER_COMMENT, FORMAT_EXPLICIT_HEADER_NOSKIP)) {
parser.getRecords();
assertFalse(parser.hasTrailerComment());
@@ -993,7 +993,7 @@ public class CSVParserTest {
}
@Test
- public void testGetTrailerComment_HeaderTrailerComment1() throws IOException {
+ void testGetTrailerComment_HeaderTrailerComment1() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_HEADER_TRAILER_COMMENT, FORMAT_AUTO_HEADER)) {
parser.getRecords();
assertTrue(parser.hasTrailerComment());
@@ -1002,7 +1002,7 @@ public class CSVParserTest {
}
@Test
- public void testGetTrailerComment_HeaderTrailerComment2() throws IOException {
+ void testGetTrailerComment_HeaderTrailerComment2() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_HEADER_TRAILER_COMMENT, FORMAT_EXPLICIT_HEADER)) {
parser.getRecords();
assertTrue(parser.hasTrailerComment());
@@ -1011,7 +1011,7 @@ public class CSVParserTest {
}
@Test
- public void testGetTrailerComment_HeaderTrailerComment3() throws IOException {
+ void testGetTrailerComment_HeaderTrailerComment3() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_HEADER_TRAILER_COMMENT, FORMAT_EXPLICIT_HEADER_NOSKIP)) {
parser.getRecords();
assertTrue(parser.hasTrailerComment());
@@ -1020,7 +1020,7 @@ public class CSVParserTest {
}
@Test
- public void testGetTrailerComment_MultilineComment() throws IOException {
+ void testGetTrailerComment_MultilineComment() throws IOException {
try (CSVParser parser = CSVParser.parse(CSV_INPUT_MULTILINE_HEADER_TRAILER_COMMENT, FORMAT_AUTO_HEADER)) {
parser.getRecords();
assertTrue(parser.hasTrailerComment());
@@ -1029,7 +1029,7 @@ public class CSVParserTest {
}
@Test
- public void testHeader() throws Exception {
+ void testHeader() throws Exception {
final Reader in = new StringReader("a,b,c\n1,2,3\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader().parse(in)) {
@@ -1048,7 +1048,7 @@ public class CSVParserTest {
}
@Test
- public void testHeaderComment() throws Exception {
+ void testHeaderComment() throws Exception {
final Reader in = new StringReader("# comment\na,b,c\n1,2,3\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.withCommentMarker('#').withHeader().parse(in)) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -1064,7 +1064,7 @@ public class CSVParserTest {
}
@Test
- public void testHeaderMissing() throws Exception {
+ void testHeaderMissing() throws Exception {
final Reader in = new StringReader("a,,c\n1,2,3\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader().withAllowMissingColumnNames().parse(in)) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -1079,7 +1079,7 @@ public class CSVParserTest {
}
@Test
- public void testHeaderMissingWithNull() throws Exception {
+ void testHeaderMissingWithNull() throws Exception {
final Reader in = new StringReader("a,,c,,e\n1,2,3,4,5\nv,w,x,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader().withNullString("").withAllowMissingColumnNames().parse(in)) {
parser.iterator();
@@ -1087,7 +1087,7 @@ public class CSVParserTest {
}
@Test
- public void testHeadersMissing() throws Exception {
+ void testHeadersMissing() throws Exception {
try (Reader in = new StringReader("a,,c,,e\n1,2,3,4,5\nv,w,x,y,z");
CSVParser parser = CSVFormat.DEFAULT.withHeader().withAllowMissingColumnNames().parse(in)) {
parser.iterator();
@@ -1095,19 +1095,19 @@ public class CSVParserTest {
}
@Test
- public void testHeadersMissingException() {
+ void testHeadersMissingException() {
final Reader in = new StringReader("a,,c,,e\n1,2,3,4,5\nv,w,x,y,z");
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withHeader().parse(in).iterator());
}
@Test
- public void testHeadersMissingOneColumnException() {
+ void testHeadersMissingOneColumnException() {
final Reader in = new StringReader("a,,c,d,e\n1,2,3,4,5\nv,w,x,y,z");
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withHeader().parse(in).iterator());
}
@Test
- public void testHeadersWithNullColumnName() throws IOException {
+ void testHeadersWithNullColumnName() throws IOException {
final Reader in = new StringReader("header1,null,header3\n1,2,3\n4,5,6");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader().withNullString("null").withAllowMissingColumnNames().parse(in)) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -1121,7 +1121,7 @@ public class CSVParserTest {
}
@Test
- public void testIgnoreCaseHeaderMapping() throws Exception {
+ void testIgnoreCaseHeaderMapping() throws Exception {
final Reader reader = new StringReader("1,2,3");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader("One", "TWO", "three").withIgnoreHeaderCase().parse(reader)) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -1133,7 +1133,7 @@ public class CSVParserTest {
}
@Test
- public void testIgnoreEmptyLines() throws IOException {
+ void testIgnoreEmptyLines() throws IOException {
final String code = "\nfoo,baar\n\r\n,\n\n,world\r\n\n";
// String code = "world\r\n\n";
// String code = "foo;baar\r\n\r\nhello;\r\n\r\nworld;\r\n";
@@ -1144,12 +1144,12 @@ public class CSVParserTest {
}
@Test
- public void testInvalidFormat() {
+ void testInvalidFormat() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withDelimiter(CR));
}
@Test
- public void testIterator() throws Exception {
+ void testIterator() throws Exception {
final Reader in = new StringReader("a,b,c\n1,2,3\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.parse(in)) {
final Iterator<CSVRecord> iterator = parser.iterator();
@@ -1168,7 +1168,7 @@ public class CSVParserTest {
@ParameterizedTest
@ValueSource(longs = { -1, 0, 1, 2, 3, 4, 5, Long.MAX_VALUE })
- public void testIteratorMaxRows(final long maxRows) throws Exception {
+ void testIteratorMaxRows(final long maxRows) throws Exception {
final Reader in = new StringReader("a,b,c\n1,2,3\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.builder().setMaxRows(maxRows).get().parse(in)) {
final Iterator<CSVRecord> iterator = parser.iterator();
@@ -1195,7 +1195,7 @@ public class CSVParserTest {
}
@Test
- public void testIteratorSequenceBreaking() throws IOException {
+ void testIteratorSequenceBreaking() throws IOException {
final String fiveRows = "1\n2\n3\n4\n5\n";
// Iterator hasNext() shouldn't break sequence
try (CSVParser parser = CSVFormat.DEFAULT.parse(new StringReader(fiveRows))) {
@@ -1250,7 +1250,7 @@ public class CSVParserTest {
}
@Test
- public void testLineFeedEndings() throws IOException {
+ void testLineFeedEndings() throws IOException {
final String code = "foo\nbaar,\nhello,world\n,kanu";
try (CSVParser parser = CSVParser.parse(code, CSVFormat.DEFAULT)) {
final List<CSVRecord> records = parser.getRecords();
@@ -1259,7 +1259,7 @@ public class CSVParserTest {
}
@Test
- public void testMappedButNotSetAsOutlook2007ContactExport() throws Exception {
+ void testMappedButNotSetAsOutlook2007ContactExport() throws Exception {
final Reader in = new StringReader("a,b,c\n1,2\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader("A", "B", "C").withSkipHeaderRecord().parse(in)) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -1294,7 +1294,7 @@ public class CSVParserTest {
@Test
@Disabled
- public void testMongoDbCsv() throws Exception {
+ void testMongoDbCsv() throws Exception {
try (CSVParser parser = CSVParser.parse("\"a a\",b,c" + LF + "d,e,f", CSVFormat.MONGODB_CSV)) {
final Iterator<CSVRecord> itr1 = parser.iterator();
final Iterator<CSVRecord> itr2 = parser.iterator();
@@ -1313,7 +1313,7 @@ public class CSVParserTest {
@Test
// TODO this may lead to strange behavior, throw an exception if iterator() has already been called?
- public void testMultipleIterators() throws Exception {
+ void testMultipleIterators() throws Exception {
try (CSVParser parser = CSVParser.parse("a,b,c" + CRLF + "d,e,f", CSVFormat.DEFAULT)) {
final Iterator<CSVRecord> itr1 = parser.iterator();
@@ -1330,24 +1330,24 @@ public class CSVParserTest {
}
@Test
- public void testNewCSVParserNullReaderFormat() {
+ void testNewCSVParserNullReaderFormat() {
assertThrows(NullPointerException.class, () -> new CSVParser(null, CSVFormat.DEFAULT));
}
@Test
- public void testNewCSVParserReaderNullFormat() {
+ void testNewCSVParserReaderNullFormat() {
assertThrows(NullPointerException.class, () -> new CSVParser(new StringReader(""), null));
}
@Test
- public void testNoHeaderMap() throws Exception {
+ void testNoHeaderMap() throws Exception {
try (CSVParser parser = CSVParser.parse("a,b,c\n1,2,3\nx,y,z", CSVFormat.DEFAULT)) {
assertNull(parser.getHeaderMap());
}
}
@Test
- public void testNotValueCSV() throws IOException {
+ void testNotValueCSV() throws IOException {
final String source = "#";
final CSVFormat csvFormat = CSVFormat.DEFAULT.withCommentMarker('#');
try (CSVParser csvParser = csvFormat.parse(new StringReader(source))) {
@@ -1357,7 +1357,7 @@ public class CSVParserTest {
}
@Test
- public void testParse() throws Exception {
+ void testParse() throws Exception {
final URL url = ClassLoader.getSystemClassLoader().getResource("org/apache/commons/csv/CSVFileParser/test.csv");
final CSVFormat format = CSVFormat.DEFAULT.builder().setHeader("A", "B", "C", "D").get();
final Charset charset = StandardCharsets.UTF_8;
@@ -1424,7 +1424,7 @@ public class CSVParserTest {
}
@Test
- public void testParseFileCharsetNullFormat() throws IOException {
+ void testParseFileCharsetNullFormat() throws IOException {
final File file = new File("src/test/resources/org/apache/commons/csv/CSVFileParser/test.csv");
try (CSVParser parser = CSVParser.parse(file, Charset.defaultCharset(), null)) {
// null maps to DEFAULT.
@@ -1433,7 +1433,7 @@ public class CSVParserTest {
}
@Test
- public void testParseInputStreamCharsetNullFormat() throws IOException {
+ void testParseInputStreamCharsetNullFormat() throws IOException {
try (InputStream in = Files.newInputStream(Paths.get("src/test/resources/org/apache/commons/csv/CSVFileParser/test.csv"));
CSVParser parser = CSVParser.parse(in, Charset.defaultCharset(), null)) {
// null maps to DEFAULT.
@@ -1442,27 +1442,27 @@ public class CSVParserTest {
}
@Test
- public void testParseNullFileFormat() {
+ void testParseNullFileFormat() {
assertThrows(NullPointerException.class, () -> CSVParser.parse((File) null, Charset.defaultCharset(), CSVFormat.DEFAULT));
}
@Test
- public void testParseNullPathFormat() {
+ void testParseNullPathFormat() {
assertThrows(NullPointerException.class, () -> CSVParser.parse((Path) null, Charset.defaultCharset(), CSVFormat.DEFAULT));
}
@Test
- public void testParseNullStringFormat() {
+ void testParseNullStringFormat() {
assertThrows(NullPointerException.class, () -> CSVParser.parse((String) null, CSVFormat.DEFAULT));
}
@Test
- public void testParseNullUrlCharsetFormat() {
+ void testParseNullUrlCharsetFormat() {
assertThrows(NullPointerException.class, () -> CSVParser.parse((URL) null, Charset.defaultCharset(), CSVFormat.DEFAULT));
}
@Test
- public void testParsePathCharsetNullFormat() throws IOException {
+ void testParsePathCharsetNullFormat() throws IOException {
final Path path = Paths.get("src/test/resources/org/apache/commons/csv/CSVFileParser/test.csv");
try (CSVParser parser = CSVParser.parse(path, Charset.defaultCharset(), null)) {
// null maps to DEFAULT.
@@ -1471,7 +1471,7 @@ public class CSVParserTest {
}
@Test
- public void testParserUrlNullCharsetFormat() throws IOException {
+ void testParserUrlNullCharsetFormat() throws IOException {
final URL url = ClassLoader.getSystemClassLoader().getResource("org/apache/commons/csv/CSVFileParser/test.csv");
try (CSVParser parser = CSVParser.parse(url, null, CSVFormat.DEFAULT)) {
// null maps to DEFAULT.
@@ -1480,7 +1480,7 @@ public class CSVParserTest {
}
@Test
- public void testParseStringNullFormat() throws IOException {
+ void testParseStringNullFormat() throws IOException {
try (CSVParser parser = CSVParser.parse("1,2,3", null)) {
// null maps to DEFAULT.
final List<CSVRecord> records = parser.getRecords();
@@ -1494,7 +1494,7 @@ public class CSVParserTest {
}
@Test
- public void testParseUrlCharsetNullFormat() throws IOException {
+ void testParseUrlCharsetNullFormat() throws IOException {
final URL url = ClassLoader.getSystemClassLoader().getResource("org/apache/commons/csv/CSVFileParser/test.csv");
try (CSVParser parser = CSVParser.parse(url, Charset.defaultCharset(), null)) {
// null maps to DEFAULT.
@@ -1503,7 +1503,7 @@ public class CSVParserTest {
}
@Test
- public void testParseWithDelimiterStringWithEscape() throws IOException {
+ void testParseWithDelimiterStringWithEscape() throws IOException {
final String source = "a![!|!]b![|]c[|]xyz\r\nabc[abc][|]xyz";
final CSVFormat csvFormat = CSVFormat.DEFAULT.builder().setDelimiter("[|]").setEscape('!').get();
try (CSVParser csvParser = csvFormat.parse(new StringReader(source))) {
@@ -1517,7 +1517,7 @@ public class CSVParserTest {
}
@Test
- public void testParseWithDelimiterStringWithQuote() throws IOException {
+ void testParseWithDelimiterStringWithQuote() throws IOException {
final String source = "'a[|]b[|]c'[|]xyz\r\nabc[abc][|]xyz";
final CSVFormat csvFormat = CSVFormat.DEFAULT.builder().setDelimiter("[|]").setQuote('\'').get();
try (CSVParser csvParser = csvFormat.parse(new StringReader(source))) {
@@ -1531,7 +1531,7 @@ public class CSVParserTest {
}
@Test
- public void testParseWithDelimiterWithEscape() throws IOException {
+ void testParseWithDelimiterWithEscape() throws IOException {
final String source = "a!,b!,c,xyz";
final CSVFormat csvFormat = CSVFormat.DEFAULT.withEscape('!');
try (CSVParser csvParser = csvFormat.parse(new StringReader(source))) {
@@ -1542,7 +1542,7 @@ public class CSVParserTest {
}
@Test
- public void testParseWithDelimiterWithQuote() throws IOException {
+ void testParseWithDelimiterWithQuote() throws IOException {
final String source = "'a,b,c',xyz";
final CSVFormat csvFormat = CSVFormat.DEFAULT.withQuote('\'');
try (CSVParser csvParser = csvFormat.parse(new StringReader(source))) {
@@ -1553,7 +1553,7 @@ public class CSVParserTest {
}
@Test
- public void testParseWithQuoteThrowsException() {
+ void testParseWithQuoteThrowsException() {
final CSVFormat csvFormat = CSVFormat.DEFAULT.withQuote('\'');
assertThrows(IOException.class, () -> csvFormat.parse(new StringReader("'a,b,c','")).nextRecord());
assertThrows(IOException.class, () -> csvFormat.parse(new StringReader("'a,b,c'abc,xyz")).nextRecord());
@@ -1561,7 +1561,7 @@ public class CSVParserTest {
}
@Test
- public void testParseWithQuoteWithEscape() throws IOException {
+ void testParseWithQuoteWithEscape() throws IOException {
final String source = "'a?,b?,c?d',xyz";
final CSVFormat csvFormat = CSVFormat.DEFAULT.withQuote('\'').withEscape('?');
try (CSVParser csvParser = csvFormat.parse(new StringReader(source))) {
@@ -1573,7 +1573,7 @@ public class CSVParserTest {
@ParameterizedTest
@EnumSource(CSVFormat.Predefined.class)
- public void testParsingPrintedEmptyFirstColumn(final CSVFormat.Predefined format) throws Exception {
+ void testParsingPrintedEmptyFirstColumn(final CSVFormat.Predefined format) throws Exception {
final String[][] lines = { { "a", "b" }, { "", "x" } };
final StringWriter buf = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(buf, format.getFormat())) {
@@ -1591,7 +1591,7 @@ public class CSVParserTest {
}
@Test
- public void testProvidedHeader() throws Exception {
+ void testProvidedHeader() throws Exception {
final Reader in = new StringReader("a,b,c\n1,2,3\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader("A", "B", "C").parse(in)) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -1611,7 +1611,7 @@ public class CSVParserTest {
}
@Test
- public void testProvidedHeaderAuto() throws Exception {
+ void testProvidedHeaderAuto() throws Exception {
final Reader in = new StringReader("a,b,c\n1,2,3\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader().parse(in)) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -1631,7 +1631,7 @@ public class CSVParserTest {
}
@Test
- public void testRepeatedHeadersAreReturnedInCSVRecordHeaderNames() throws IOException {
+ void testRepeatedHeadersAreReturnedInCSVRecordHeaderNames() throws IOException {
final Reader in = new StringReader("header1,header2,header1\n1,2,3\n4,5,6");
try (CSVParser parser = CSVFormat.DEFAULT.withFirstRecordAsHeader().withTrim().parse(in)) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -1643,7 +1643,7 @@ public class CSVParserTest {
}
@Test
- public void testRoundtrip() throws Exception {
+ void testRoundtrip() throws Exception {
final StringWriter out = new StringWriter();
final String data = "a,b,c\r\n1,2,3\r\nx,y,z\r\n";
try (CSVPrinter printer = new CSVPrinter(out, CSVFormat.DEFAULT);
@@ -1656,7 +1656,7 @@ public class CSVParserTest {
}
@Test
- public void testSkipAutoHeader() throws Exception {
+ void testSkipAutoHeader() throws Exception {
final Reader in = new StringReader("a,b,c\n1,2,3\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader().parse(in)) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -1668,7 +1668,7 @@ public class CSVParserTest {
}
@Test
- public void testSkipHeaderOverrideDuplicateHeaders() throws Exception {
+ void testSkipHeaderOverrideDuplicateHeaders() throws Exception {
final Reader in = new StringReader("a,a,a\n1,2,3\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader("X", "Y", "Z").withSkipHeaderRecord().parse(in)) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -1680,7 +1680,7 @@ public class CSVParserTest {
}
@Test
- public void testSkipSetAltHeaders() throws Exception {
+ void testSkipSetAltHeaders() throws Exception {
final Reader in = new StringReader("a,b,c\n1,2,3\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader("X", "Y", "Z").withSkipHeaderRecord().parse(in)) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -1692,7 +1692,7 @@ public class CSVParserTest {
}
@Test
- public void testSkipSetHeader() throws Exception {
+ void testSkipSetHeader() throws Exception {
final Reader in = new StringReader("a,b,c\n1,2,3\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader("a", "b", "c").withSkipHeaderRecord().parse(in)) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -1705,7 +1705,7 @@ public class CSVParserTest {
@Test
@Disabled
- public void testStartWithEmptyLinesThenHeaders() throws Exception {
+ void testStartWithEmptyLinesThenHeaders() throws Exception {
final String[] codes = { "\r\n\r\n\r\nhello,\r\n\r\n\r\n", "hello,\n\n\n", "hello,\"\"\r\n\r\n\r\n", "hello,\"\"\n\n\n" };
final String[][] res = { { "hello", "" }, { "" }, // Excel format does not ignore empty lines
{ "" } };
@@ -1722,7 +1722,7 @@ public class CSVParserTest {
}
@Test
- public void testStream() throws Exception {
+ void testStream() throws Exception {
final Reader in = new StringReader("a,b,c\n1,2,3\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.parse(in)) {
final List<CSVRecord> list = parser.stream().collect(Collectors.toList());
@@ -1735,7 +1735,7 @@ public class CSVParserTest {
@ParameterizedTest
@ValueSource(longs = { -1, 0, 1, 2, 3, 4, Long.MAX_VALUE })
- public void testStreamMaxRows(final long maxRows) throws Exception {
+ void testStreamMaxRows(final long maxRows) throws Exception {
final Reader in = new StringReader("a,b,c\n1,2,3\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.builder().setMaxRows(maxRows).get().parse(in)) {
final List<CSVRecord> list = parser.stream().collect(Collectors.toList());
@@ -1751,7 +1751,7 @@ public class CSVParserTest {
}
@Test
- public void testThrowExceptionWithLineAndPosition() throws IOException {
+ void testThrowExceptionWithLineAndPosition() throws IOException {
final String csvContent = "col1,col2,col3,col4,col5,col6,col7,col8,col9,col10\nrec1,rec2,rec3,rec4,rec5,rec6,rec7,rec8,\"\"rec9\"\",rec10";
final StringReader stringReader = new StringReader(csvContent);
// @formatter:off
@@ -1769,7 +1769,7 @@ public class CSVParserTest {
}
@Test
- public void testTrailingDelimiter() throws Exception {
+ void testTrailingDelimiter() throws Exception {
final Reader in = new StringReader("a,a,a,\n\"1\",\"2\",\"3\",\nx,y,z,");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader("X", "Y", "Z").withSkipHeaderRecord().withTrailingDelimiter().parse(in)) {
final Iterator<CSVRecord> records = parser.iterator();
@@ -1782,7 +1782,7 @@ public class CSVParserTest {
}
@Test
- public void testTrim() throws Exception {
+ void testTrim() throws Exception {
final Reader in = new StringReader("a,a,a\n\" 1 \",\" 2 \",\" 3 \"\nx,y,z");
try (CSVParser parser = CSVFormat.DEFAULT.withHeader("X", "Y", "Z").withSkipHeaderRecord().withTrim().parse(in)) {
final Iterator<CSVRecord> records = parser.iterator();
diff --git a/src/test/java/org/apache/commons/csv/CSVPrinterTest.java b/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
index a1a59cf4..d9d75198 100644
--- a/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
@@ -265,7 +265,7 @@ public class CSVPrinterTest {
}
@Test
- public void testCloseBackwardCompatibility() throws IOException {
+ void testCloseBackwardCompatibility() throws IOException {
try (Writer writer = mock(Writer.class)) {
final CSVFormat csvFormat = CSVFormat.DEFAULT;
try (CSVPrinter printer = new CSVPrinter(writer, csvFormat)) {
@@ -277,7 +277,7 @@ public class CSVPrinterTest {
}
@Test
- public void testCloseWithCsvFormatAutoFlushOff() throws IOException {
+ void testCloseWithCsvFormatAutoFlushOff() throws IOException {
try (Writer writer = mock(Writer.class)) {
final CSVFormat csvFormat = CSVFormat.DEFAULT.withAutoFlush(false);
try (CSVPrinter printer = new CSVPrinter(writer, csvFormat)) {
@@ -289,7 +289,7 @@ public class CSVPrinterTest {
}
@Test
- public void testCloseWithCsvFormatAutoFlushOn() throws IOException {
+ void testCloseWithCsvFormatAutoFlushOn() throws IOException {
// System.out.println("start method");
try (Writer writer = mock(Writer.class)) {
final CSVFormat csvFormat = CSVFormat.DEFAULT.withAutoFlush(true);
@@ -302,7 +302,7 @@ public class CSVPrinterTest {
}
@Test
- public void testCloseWithFlushOff() throws IOException {
+ void testCloseWithFlushOff() throws IOException {
try (Writer writer = mock(Writer.class)) {
final CSVFormat csvFormat = CSVFormat.DEFAULT;
@SuppressWarnings("resource")
@@ -316,7 +316,7 @@ public class CSVPrinterTest {
}
@Test
- public void testCloseWithFlushOn() throws IOException {
+ void testCloseWithFlushOn() throws IOException {
try (Writer writer = mock(Writer.class)) {
@SuppressWarnings("resource")
final CSVPrinter printer = new CSVPrinter(writer, CSVFormat.DEFAULT);
@@ -328,7 +328,7 @@ public class CSVPrinterTest {
}
@Test
- public void testCRComment() throws IOException {
+ void testCRComment() throws IOException {
final StringWriter sw = new StringWriter();
final Object value = "abc";
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withCommentMarker('#'))) {
@@ -343,7 +343,7 @@ public class CSVPrinterTest {
}
@Test
- public void testCSV135() throws IOException {
+ void testCSV135() throws IOException {
final List<String> list = new LinkedList<>();
list.add("\"\""); // ""
list.add("\\\\"); // \\
@@ -366,7 +366,7 @@ public class CSVPrinterTest {
}
@Test
- public void testCSV259() throws IOException {
+ void testCSV259() throws IOException {
final StringWriter sw = new StringWriter();
try (Reader reader = new FileReader("src/test/resources/org/apache/commons/csv/CSV-259/sample.txt");
CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withEscape('!').withQuote(null))) {
@@ -377,7 +377,7 @@ public class CSVPrinterTest {
}
@Test
- public void testDelimeterQuoted() throws IOException {
+ void testDelimeterQuoted() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote('\''))) {
assertInitialState(printer);
@@ -388,7 +388,7 @@ public class CSVPrinterTest {
}
@Test
- public void testDelimeterQuoteNone() throws IOException {
+ void testDelimeterQuoteNone() throws IOException {
final StringWriter sw = new StringWriter();
final CSVFormat format = CSVFormat.DEFAULT.withEscape('!').withQuoteMode(QuoteMode.NONE);
try (CSVPrinter printer = new CSVPrinter(sw, format)) {
@@ -400,7 +400,7 @@ public class CSVPrinterTest {
}
@Test
- public void testDelimeterStringQuoted() throws IOException {
+ void testDelimeterStringQuoted() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.builder().setDelimiter("[|]").setQuote('\'').get())) {
assertInitialState(printer);
@@ -411,7 +411,7 @@ public class CSVPrinterTest {
}
@Test
- public void testDelimeterStringQuoteNone() throws IOException {
+ void testDelimeterStringQuoteNone() throws IOException {
final StringWriter sw = new StringWriter();
final CSVFormat format = CSVFormat.DEFAULT.builder().setDelimiter("[|]").setEscape('!').setQuoteMode(QuoteMode.NONE).get();
try (CSVPrinter printer = new CSVPrinter(sw, format)) {
@@ -424,7 +424,7 @@ public class CSVPrinterTest {
}
@Test
- public void testDelimiterEscaped() throws IOException {
+ void testDelimiterEscaped() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withEscape('!').withQuote(null))) {
assertInitialState(printer);
@@ -435,7 +435,7 @@ public class CSVPrinterTest {
}
@Test
- public void testDelimiterPlain() throws IOException {
+ void testDelimiterPlain() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null))) {
assertInitialState(printer);
@@ -446,7 +446,7 @@ public class CSVPrinterTest {
}
@Test
- public void testDelimiterStringEscaped() throws IOException {
+ void testDelimiterStringEscaped() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.builder().setDelimiter("|||").setEscape('!').setQuote(null).get())) {
assertInitialState(printer);
@@ -457,7 +457,7 @@ public class CSVPrinterTest {
}
@Test
- public void testDisabledComment() throws IOException {
+ void testDisabledComment() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT)) {
assertInitialState(printer);
@@ -468,7 +468,7 @@ public class CSVPrinterTest {
}
@Test
- public void testDontQuoteEuroFirstChar() throws IOException {
+ void testDontQuoteEuroFirstChar() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.RFC4180)) {
assertInitialState(printer);
@@ -478,7 +478,7 @@ public class CSVPrinterTest {
}
@Test
- public void testEolEscaped() throws IOException {
+ void testEolEscaped() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null).withEscape('!'))) {
assertInitialState(printer);
@@ -489,7 +489,7 @@ public class CSVPrinterTest {
}
@Test
- public void testEolPlain() throws IOException {
+ void testEolPlain() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null))) {
assertInitialState(printer);
@@ -500,7 +500,7 @@ public class CSVPrinterTest {
}
@Test
- public void testEolQuoted() throws IOException {
+ void testEolQuoted() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote('\''))) {
assertInitialState(printer);
@@ -512,7 +512,7 @@ public class CSVPrinterTest {
@SuppressWarnings("unlikely-arg-type")
@Test
- public void testEquals() throws IOException {
+ void testEquals() throws IOException {
// Don't use assertNotEquals here
assertFalse(CSVFormat.DEFAULT.equals(null));
// Don't use assertNotEquals here
@@ -520,7 +520,7 @@ public class CSVPrinterTest {
}
@Test
- public void testEscapeBackslash1() throws IOException {
+ void testEscapeBackslash1() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(QUOTE_CH))) {
assertInitialState(printer);
@@ -530,7 +530,7 @@ public class CSVPrinterTest {
}
@Test
- public void testEscapeBackslash2() throws IOException {
+ void testEscapeBackslash2() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(QUOTE_CH))) {
assertInitialState(printer);
@@ -540,7 +540,7 @@ public class CSVPrinterTest {
}
@Test
- public void testEscapeBackslash3() throws IOException {
+ void testEscapeBackslash3() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(QUOTE_CH))) {
assertInitialState(printer);
@@ -550,7 +550,7 @@ public class CSVPrinterTest {
}
@Test
- public void testEscapeBackslash4() throws IOException {
+ void testEscapeBackslash4() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(QUOTE_CH))) {
assertInitialState(printer);
@@ -560,7 +560,7 @@ public class CSVPrinterTest {
}
@Test
- public void testEscapeBackslash5() throws IOException {
+ void testEscapeBackslash5() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(QUOTE_CH))) {
assertInitialState(printer);
@@ -570,7 +570,7 @@ public class CSVPrinterTest {
}
@Test
- public void testEscapeNull1() throws IOException {
+ void testEscapeNull1() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withEscape(null))) {
assertInitialState(printer);
@@ -580,7 +580,7 @@ public class CSVPrinterTest {
}
@Test
- public void testEscapeNull2() throws IOException {
+ void testEscapeNull2() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withEscape(null))) {
assertInitialState(printer);
@@ -590,7 +590,7 @@ public class CSVPrinterTest {
}
@Test
- public void testEscapeNull3() throws IOException {
+ void testEscapeNull3() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withEscape(null))) {
assertInitialState(printer);
@@ -600,7 +600,7 @@ public class CSVPrinterTest {
}
@Test
- public void testEscapeNull4() throws IOException {
+ void testEscapeNull4() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withEscape(null))) {
assertInitialState(printer);
@@ -610,7 +610,7 @@ public class CSVPrinterTest {
}
@Test
- public void testEscapeNull5() throws IOException {
+ void testEscapeNull5() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withEscape(null))) {
assertInitialState(printer);
@@ -620,7 +620,7 @@ public class CSVPrinterTest {
}
@Test
- public void testExcelPrintAllArrayOfArrays() throws IOException {
+ void testExcelPrintAllArrayOfArrays() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL)) {
assertInitialState(printer);
@@ -630,7 +630,7 @@ public class CSVPrinterTest {
}
@Test
- public void testExcelPrintAllArrayOfArraysWithFirstEmptyValue2() throws IOException {
+ void testExcelPrintAllArrayOfArraysWithFirstEmptyValue2() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL)) {
assertInitialState(printer);
@@ -640,7 +640,7 @@ public class CSVPrinterTest {
}
@Test
- public void testExcelPrintAllArrayOfArraysWithFirstSpaceValue1() throws IOException {
+ void testExcelPrintAllArrayOfArraysWithFirstSpaceValue1() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL)) {
assertInitialState(printer);
@@ -650,7 +650,7 @@ public class CSVPrinterTest {
}
@Test
- public void testExcelPrintAllArrayOfArraysWithFirstTabValue1() throws IOException {
+ void testExcelPrintAllArrayOfArraysWithFirstTabValue1() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL)) {
assertInitialState(printer);
@@ -660,7 +660,7 @@ public class CSVPrinterTest {
}
@Test
- public void testExcelPrintAllArrayOfLists() throws IOException {
+ void testExcelPrintAllArrayOfLists() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL)) {
assertInitialState(printer);
@@ -670,7 +670,7 @@ public class CSVPrinterTest {
}
@Test
- public void testExcelPrintAllArrayOfListsWithFirstEmptyValue2() throws IOException {
+ void testExcelPrintAllArrayOfListsWithFirstEmptyValue2() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL)) {
assertInitialState(printer);
@@ -680,7 +680,7 @@ public class CSVPrinterTest {
}
@Test
- public void testExcelPrintAllIterableOfArrays() throws IOException {
+ void testExcelPrintAllIterableOfArrays() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL)) {
assertInitialState(printer);
@@ -690,7 +690,7 @@ public class CSVPrinterTest {
}
@Test
- public void testExcelPrintAllIterableOfArraysWithFirstEmptyValue2() throws IOException {
+ void testExcelPrintAllIterableOfArraysWithFirstEmptyValue2() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL)) {
assertInitialState(printer);
@@ -700,7 +700,7 @@ public class CSVPrinterTest {
}
@Test
- public void testExcelPrintAllIterableOfLists() throws IOException {
+ void testExcelPrintAllIterableOfLists() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL)) {
assertInitialState(printer);
@@ -711,7 +711,7 @@ public class CSVPrinterTest {
@ParameterizedTest
@ValueSource(longs = { -1, 0, 1, 2, Long.MAX_VALUE })
- public void testExcelPrintAllStreamOfArrays(final long maxRows) throws IOException {
+ void testExcelPrintAllStreamOfArrays(final long maxRows) throws IOException {
final StringWriter sw = new StringWriter();
final CSVFormat format = CSVFormat.EXCEL.builder().setMaxRows(maxRows).get();
try (CSVPrinter printer = new CSVPrinter(sw, format)) {
@@ -726,7 +726,7 @@ public class CSVPrinterTest {
}
@Test
- public void testExcelPrinter1() throws IOException {
+ void testExcelPrinter1() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL)) {
assertInitialState(printer);
@@ -736,7 +736,7 @@ public class CSVPrinterTest {
}
@Test
- public void testExcelPrinter2() throws IOException {
+ void testExcelPrinter2() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL)) {
assertInitialState(printer);
@@ -746,7 +746,7 @@ public class CSVPrinterTest {
}
@Test
- public void testHeader() throws IOException {
+ void testHeader() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null).withHeader("C1", "C2", "C3"))) {
assertEquals(1, printer.getRecordCount());
@@ -757,7 +757,7 @@ public class CSVPrinterTest {
}
@Test
- public void testHeaderCommentExcel() throws IOException {
+ void testHeaderCommentExcel() throws IOException {
final StringWriter sw = new StringWriter();
final Date now = new Date();
final CSVFormat format = CSVFormat.EXCEL;
@@ -767,7 +767,7 @@ public class CSVPrinterTest {
}
@Test
- public void testHeaderCommentTdf() throws IOException {
+ void testHeaderCommentTdf() throws IOException {
final StringWriter sw = new StringWriter();
final Date now = new Date();
final CSVFormat format = CSVFormat.TDF;
@@ -777,7 +777,7 @@ public class CSVPrinterTest {
}
@Test
- public void testHeaderNotSet() throws IOException {
+ void testHeaderNotSet() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null))) {
assertInitialState(printer);
@@ -788,12 +788,12 @@ public class CSVPrinterTest {
}
@Test
- public void testInvalidFormat() {
+ void testInvalidFormat() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withDelimiter(CR));
}
@Test
- public void testJdbcPrinter() throws IOException, ClassNotFoundException, SQLException {
+ void testJdbcPrinter() throws IOException, ClassNotFoundException, SQLException {
final StringWriter sw = new StringWriter();
final CSVFormat csvFormat = CSVFormat.DEFAULT;
try (Connection connection = getH2Connection()) {
@@ -827,7 +827,7 @@ public class CSVPrinterTest {
}
@Test
- public void testJdbcPrinterWithFirstEmptyValue2() throws IOException, ClassNotFoundException, SQLException {
+ void testJdbcPrinterWithFirstEmptyValue2() throws IOException, ClassNotFoundException, SQLException {
final StringWriter sw = new StringWriter();
try (Connection connection = getH2Connection()) {
try (Statement stmt = connection.createStatement();
@@ -841,7 +841,7 @@ public class CSVPrinterTest {
@ParameterizedTest
@ValueSource(longs = { -1, 0, 1, 2, 3, 4, Long.MAX_VALUE })
- public void testJdbcPrinterWithResultSet(final long maxRows) throws IOException, ClassNotFoundException, SQLException {
+ void testJdbcPrinterWithResultSet(final long maxRows) throws IOException, ClassNotFoundException, SQLException {
final StringWriter sw = new StringWriter();
final CSVFormat format = CSVFormat.DEFAULT.builder().setMaxRows(maxRows).get();
try (Connection connection = getH2Connection()) {
@@ -869,7 +869,7 @@ public class CSVPrinterTest {
@ParameterizedTest
@ValueSource(longs = { -1, 0, 3, 4, Long.MAX_VALUE })
- public void testJdbcPrinterWithResultSetHeader(final long maxRows) throws IOException, ClassNotFoundException, SQLException {
+ void testJdbcPrinterWithResultSetHeader(final long maxRows) throws IOException, ClassNotFoundException, SQLException {
final StringWriter sw = new StringWriter();
try (Connection connection = getH2Connection()) {
setUpTable(connection);
@@ -894,7 +894,7 @@ public class CSVPrinterTest {
@ParameterizedTest
@ValueSource(longs = { -1, 0, 3, 4, Long.MAX_VALUE })
- public void testJdbcPrinterWithResultSetMetaData(final long maxRows) throws IOException, ClassNotFoundException, SQLException {
+ void testJdbcPrinterWithResultSetMetaData(final long maxRows) throws IOException, ClassNotFoundException, SQLException {
final StringWriter sw = new StringWriter();
try (Connection connection = getH2Connection()) {
setUpTable(connection);
@@ -914,7 +914,7 @@ public class CSVPrinterTest {
}
@Test
- public void testJira135_part1() throws IOException {
+ void testJira135_part1() throws IOException {
final CSVFormat format = CSVFormat.DEFAULT.withRecordSeparator('\n').withQuote(DQUOTE_CHAR).withEscape(BACKSLASH);
final StringWriter sw = new StringWriter();
final List<String> list = new LinkedList<>();
@@ -930,7 +930,7 @@ public class CSVPrinterTest {
@Test
@Disabled
- public void testJira135_part2() throws IOException {
+ void testJira135_part2() throws IOException {
final CSVFormat format = CSVFormat.DEFAULT.withRecordSeparator('\n').withQuote(DQUOTE_CHAR).withEscape(BACKSLASH);
final StringWriter sw = new StringWriter();
final List<String> list = new LinkedList<>();
@@ -945,7 +945,7 @@ public class CSVPrinterTest {
}
@Test
- public void testJira135_part3() throws IOException {
+ void testJira135_part3() throws IOException {
final CSVFormat format = CSVFormat.DEFAULT.withRecordSeparator('\n').withQuote(DQUOTE_CHAR).withEscape(BACKSLASH);
final StringWriter sw = new StringWriter();
final List<String> list = new LinkedList<>();
@@ -961,7 +961,7 @@ public class CSVPrinterTest {
@Test
@Disabled
- public void testJira135All() throws IOException {
+ void testJira135All() throws IOException {
final CSVFormat format = CSVFormat.DEFAULT.withRecordSeparator('\n').withQuote(DQUOTE_CHAR).withEscape(BACKSLASH);
final StringWriter sw = new StringWriter();
final List<String> list = new LinkedList<>();
@@ -978,7 +978,7 @@ public class CSVPrinterTest {
}
@Test
- public void testMongoDbCsvBasic() throws IOException {
+ void testMongoDbCsvBasic() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.MONGODB_CSV)) {
printer.printRecord("a", "b");
@@ -988,7 +988,7 @@ public class CSVPrinterTest {
}
@Test
- public void testMongoDbCsvCommaInValue() throws IOException {
+ void testMongoDbCsvCommaInValue() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.MONGODB_CSV)) {
printer.printRecord("a,b", "c");
@@ -998,7 +998,7 @@ public class CSVPrinterTest {
}
@Test
- public void testMongoDbCsvDoubleQuoteInValue() throws IOException {
+ void testMongoDbCsvDoubleQuoteInValue() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.MONGODB_CSV)) {
printer.printRecord("a \"c\" b", "d");
@@ -1008,7 +1008,7 @@ public class CSVPrinterTest {
}
@Test
- public void testMongoDbCsvTabInValue() throws IOException {
+ void testMongoDbCsvTabInValue() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.MONGODB_CSV)) {
printer.printRecord("a\tb", "c");
@@ -1018,7 +1018,7 @@ public class CSVPrinterTest {
}
@Test
- public void testMongoDbTsvBasic() throws IOException {
+ void testMongoDbTsvBasic() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.MONGODB_TSV)) {
printer.printRecord("a", "b");
@@ -1028,7 +1028,7 @@ public class CSVPrinterTest {
}
@Test
- public void testMongoDbTsvCommaInValue() throws IOException {
+ void testMongoDbTsvCommaInValue() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.MONGODB_TSV)) {
printer.printRecord("a,b", "c");
@@ -1038,7 +1038,7 @@ public class CSVPrinterTest {
}
@Test
- public void testMongoDbTsvTabInValue() throws IOException {
+ void testMongoDbTsvTabInValue() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.MONGODB_TSV)) {
printer.printRecord("a\tb", "c");
@@ -1047,7 +1047,7 @@ public class CSVPrinterTest {
}
@Test
- public void testMultiLineComment() throws IOException {
+ void testMultiLineComment() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withCommentMarker('#'))) {
printer.printComment("This is a comment\non multiple lines");
@@ -1057,7 +1057,7 @@ public class CSVPrinterTest {
}
@Test
- public void testMySqlNullOutput() throws IOException {
+ void testMySqlNullOutput() throws IOException {
Object[] s = new String[] { "NULL", null };
CSVFormat format = CSVFormat.MYSQL.withQuote(DQUOTE_CHAR).withNullString("NULL").withQuoteMode(QuoteMode.NON_NUMERIC);
StringWriter writer = new StringWriter();
@@ -1159,22 +1159,22 @@ public class CSVPrinterTest {
}
@Test
- public void testMySqlNullStringDefault() {
+ void testMySqlNullStringDefault() {
assertEquals("\\N", CSVFormat.MYSQL.getNullString());
}
@Test
- public void testNewCsvPrinterAppendableNullFormat() {
+ void testNewCsvPrinterAppendableNullFormat() {
assertThrows(NullPointerException.class, () -> new CSVPrinter(new StringWriter(), null));
}
@Test
- public void testNewCsvPrinterNullAppendableFormat() {
+ void testNewCsvPrinterNullAppendableFormat() {
assertThrows(NullPointerException.class, () -> new CSVPrinter(null, CSVFormat.DEFAULT));
}
@Test
- public void testNotFlushable() throws IOException {
+ void testNotFlushable() throws IOException {
final Appendable out = new StringBuilder();
try (CSVPrinter printer = new CSVPrinter(out, CSVFormat.DEFAULT)) {
printer.printRecord("a", "b", "c");
@@ -1184,7 +1184,7 @@ public class CSVPrinterTest {
}
@Test
- public void testParseCustomNullValues() throws IOException {
+ void testParseCustomNullValues() throws IOException {
final StringWriter sw = new StringWriter();
final CSVFormat format = CSVFormat.DEFAULT.withNullString("NULL");
try (CSVPrinter printer = new CSVPrinter(sw, format)) {
@@ -1203,7 +1203,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPlainEscaped() throws IOException {
+ void testPlainEscaped() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null).withEscape('!'))) {
printer.print("abc");
@@ -1213,7 +1213,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPlainPlain() throws IOException {
+ void testPlainPlain() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null))) {
printer.print("abc");
@@ -1223,7 +1223,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPlainQuoted() throws IOException {
+ void testPlainQuoted() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote('\''))) {
printer.print("abc");
@@ -1233,7 +1233,7 @@ public class CSVPrinterTest {
@Test
@Disabled
- public void testPostgreSqlCsvNullOutput() throws IOException {
+ void testPostgreSqlCsvNullOutput() throws IOException {
Object[] s = new String[] { "NULL", null };
CSVFormat format = CSVFormat.POSTGRESQL_CSV.withQuote(DQUOTE_CHAR).withNullString("NULL").withQuoteMode(QuoteMode.ALL_NON_NULL);
StringWriter writer = new StringWriter();
@@ -1336,7 +1336,7 @@ public class CSVPrinterTest {
@Test
@Disabled
- public void testPostgreSqlCsvTextOutput() throws IOException {
+ void testPostgreSqlCsvTextOutput() throws IOException {
Object[] s = new String[] { "NULL", null };
CSVFormat format = CSVFormat.POSTGRESQL_TEXT.withQuote(DQUOTE_CHAR).withNullString("NULL").withQuoteMode(QuoteMode.ALL_NON_NULL);
StringWriter writer = new StringWriter();
@@ -1438,17 +1438,17 @@ public class CSVPrinterTest {
}
@Test
- public void testPostgreSqlNullStringDefaultCsv() {
+ void testPostgreSqlNullStringDefaultCsv() {
assertEquals("", CSVFormat.POSTGRESQL_CSV.getNullString());
}
@Test
- public void testPostgreSqlNullStringDefaultText() {
+ void testPostgreSqlNullStringDefaultText() {
assertEquals("\\N", CSVFormat.POSTGRESQL_TEXT.getNullString());
}
@Test
- public void testPrint() throws IOException {
+ void testPrint() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = CSVFormat.DEFAULT.print(sw)) {
assertInitialState(printer);
@@ -1458,7 +1458,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrintCSVParser() throws IOException {
+ void testPrintCSVParser() throws IOException {
// @formatter:off
final String code = "a1,b1\n" + // 1)
"a2,b2\n" + // 2)
@@ -1481,7 +1481,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrintCSVRecord() throws IOException {
+ void testPrintCSVRecord() throws IOException {
// @formatter:off
final String code = "a1,b1\n" + // 1)
"a2,b2\n" + // 2)
@@ -1510,7 +1510,7 @@ public class CSVPrinterTest {
@ParameterizedTest
@ValueSource(longs = { -1, 0, 3, 4, Long.MAX_VALUE })
- public void testPrintCSVRecords(final long maxRows) throws IOException {
+ void testPrintCSVRecords(final long maxRows) throws IOException {
// @formatter:off
final String code = "a1,b1\n" + // 1)
"a2,b2\n" + // 2)
@@ -1533,7 +1533,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrintCustomNullValues() throws IOException {
+ void testPrintCustomNullValues() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withNullString("NULL"))) {
assertInitialState(printer);
@@ -1543,7 +1543,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrinter1() throws IOException {
+ void testPrinter1() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT)) {
assertInitialState(printer);
@@ -1554,7 +1554,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrinter2() throws IOException {
+ void testPrinter2() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT)) {
assertInitialState(printer);
@@ -1564,7 +1564,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrinter3() throws IOException {
+ void testPrinter3() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT)) {
assertInitialState(printer);
@@ -1574,7 +1574,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrinter4() throws IOException {
+ void testPrinter4() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT)) {
assertInitialState(printer);
@@ -1584,7 +1584,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrinter5() throws IOException {
+ void testPrinter5() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT)) {
assertInitialState(printer);
@@ -1594,7 +1594,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrinter6() throws IOException {
+ void testPrinter6() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT)) {
assertInitialState(printer);
@@ -1604,7 +1604,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrinter7() throws IOException {
+ void testPrinter7() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT)) {
assertInitialState(printer);
@@ -1614,7 +1614,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrintNullValues() throws IOException {
+ void testPrintNullValues() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT)) {
assertInitialState(printer);
@@ -1624,7 +1624,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrintOnePositiveInteger() throws IOException {
+ void testPrintOnePositiveInteger() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteMode(QuoteMode.MINIMAL))) {
assertInitialState(printer);
@@ -1644,7 +1644,7 @@ public class CSVPrinterTest {
* @throws IOException Not expected to happen
*/
@Test
- public void testPrintReaderWithoutQuoteToAppendable() throws IOException {
+ void testPrintReaderWithoutQuoteToAppendable() throws IOException {
final StringBuilder sb = new StringBuilder();
final String content = "testValue";
try (CSVPrinter printer = new CSVPrinter(sb, CSVFormat.DEFAULT.withQuote(null))) {
@@ -1665,7 +1665,7 @@ public class CSVPrinterTest {
* @throws IOException Not expected to happen
*/
@Test
- public void testPrintReaderWithoutQuoteToWriter() throws IOException {
+ void testPrintReaderWithoutQuoteToWriter() throws IOException {
final StringWriter sw = new StringWriter();
final String content = "testValue";
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null))) {
@@ -1676,7 +1676,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrintRecordStream() throws IOException {
+ void testPrintRecordStream() throws IOException {
// @formatter:off
final String code = "a1,b1\n" + // 1)
"a2,b2\n" + // 2)
@@ -1702,7 +1702,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrintRecordsWithCSVRecord() throws IOException {
+ void testPrintRecordsWithCSVRecord() throws IOException {
final String[] values = { "A", "B", "C" };
final String rowData = StringUtils.join(values, ',');
final CharArrayWriter charArrayWriter = new CharArrayWriter(0);
@@ -1719,7 +1719,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrintRecordsWithEmptyVector() throws IOException {
+ void testPrintRecordsWithEmptyVector() throws IOException {
final PrintStream out = System.out;
try {
System.setOut(new PrintStream(NullOutputStream.INSTANCE));
@@ -1737,7 +1737,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrintRecordsWithObjectArray() throws IOException {
+ void testPrintRecordsWithObjectArray() throws IOException {
final CharArrayWriter charArrayWriter = new CharArrayWriter(0);
final Object[] objectArray = new Object[6];
try (CSVPrinter printer = CSVFormat.INFORMIX_UNLOAD.print(charArrayWriter)) {
@@ -1751,7 +1751,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrintRecordsWithResultSetOneRow() throws IOException, SQLException {
+ void testPrintRecordsWithResultSetOneRow() throws IOException, SQLException {
try (CSVPrinter printer = CSVFormat.MYSQL.printer()) {
try (ResultSet resultSet = new SimpleResultSet()) {
assertInitialState(printer);
@@ -1763,7 +1763,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrintToFileWithCharsetUtf16Be() throws IOException {
+ void testPrintToFileWithCharsetUtf16Be() throws IOException {
final File file = createTempFile();
try (CSVPrinter printer = CSVFormat.DEFAULT.print(file, StandardCharsets.UTF_16BE)) {
printer.printRecord("a", "b\\c");
@@ -1772,7 +1772,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrintToFileWithDefaultCharset() throws IOException {
+ void testPrintToFileWithDefaultCharset() throws IOException {
final File file = createTempFile();
try (CSVPrinter printer = CSVFormat.DEFAULT.print(file, Charset.defaultCharset())) {
printer.printRecord("a", "b\\c");
@@ -1781,7 +1781,7 @@ public class CSVPrinterTest {
}
@Test
- public void testPrintToPathWithDefaultCharset() throws IOException {
+ void testPrintToPathWithDefaultCharset() throws IOException {
final Path file = createTempPath();
try (CSVPrinter printer = CSVFormat.DEFAULT.print(file, Charset.defaultCharset())) {
printer.printRecord("a", "b\\c");
@@ -1790,7 +1790,7 @@ public class CSVPrinterTest {
}
@Test
- public void testQuoteAll() throws IOException {
+ void testQuoteAll() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteMode(QuoteMode.ALL))) {
printer.printRecord("a", "b\nc", "d");
@@ -1799,7 +1799,7 @@ public class CSVPrinterTest {
}
@Test
- public void testQuoteCommaFirstChar() throws IOException {
+ void testQuoteCommaFirstChar() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.RFC4180)) {
printer.printRecord(",");
@@ -1808,7 +1808,7 @@ public class CSVPrinterTest {
}
@Test
- public void testQuoteNonNumeric() throws IOException {
+ void testQuoteNonNumeric() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuoteMode(QuoteMode.NON_NUMERIC))) {
printer.printRecord("a", "b\nc", Integer.valueOf(1));
@@ -1817,55 +1817,55 @@ public class CSVPrinterTest {
}
@Test
- public void testRandomDefault() throws Exception {
+ void testRandomDefault() throws Exception {
doRandom(CSVFormat.DEFAULT, ITERATIONS_FOR_RANDOM_TEST);
}
@Test
- public void testRandomExcel() throws Exception {
+ void testRandomExcel() throws Exception {
doRandom(CSVFormat.EXCEL, ITERATIONS_FOR_RANDOM_TEST);
}
@Test
@Disabled
- public void testRandomMongoDbCsv() throws Exception {
+ void testRandomMongoDbCsv() throws Exception {
doRandom(CSVFormat.MONGODB_CSV, ITERATIONS_FOR_RANDOM_TEST);
}
@Test
- public void testRandomMySql() throws Exception {
+ void testRandomMySql() throws Exception {
doRandom(CSVFormat.MYSQL, ITERATIONS_FOR_RANDOM_TEST);
}
@Test
@Disabled
- public void testRandomOracle() throws Exception {
+ void testRandomOracle() throws Exception {
doRandom(CSVFormat.ORACLE, ITERATIONS_FOR_RANDOM_TEST);
}
@Test
@Disabled
- public void testRandomPostgreSqlCsv() throws Exception {
+ void testRandomPostgreSqlCsv() throws Exception {
doRandom(CSVFormat.POSTGRESQL_CSV, ITERATIONS_FOR_RANDOM_TEST);
}
@Test
- public void testRandomPostgreSqlText() throws Exception {
+ void testRandomPostgreSqlText() throws Exception {
doRandom(CSVFormat.POSTGRESQL_TEXT, ITERATIONS_FOR_RANDOM_TEST);
}
@Test
- public void testRandomRfc4180() throws Exception {
+ void testRandomRfc4180() throws Exception {
doRandom(CSVFormat.RFC4180, ITERATIONS_FOR_RANDOM_TEST);
}
@Test
- public void testRandomTdf() throws Exception {
+ void testRandomTdf() throws Exception {
doRandom(CSVFormat.TDF, ITERATIONS_FOR_RANDOM_TEST);
}
@Test
- public void testSingleLineComment() throws IOException {
+ void testSingleLineComment() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withCommentMarker('#'))) {
printer.printComment("This is a comment");
@@ -1875,7 +1875,7 @@ public class CSVPrinterTest {
}
@Test
- public void testSingleQuoteQuoted() throws IOException {
+ void testSingleQuoteQuoted() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote('\''))) {
printer.print("a'b'c");
@@ -1885,7 +1885,7 @@ public class CSVPrinterTest {
}
@Test
- public void testSkipHeaderRecordFalse() throws IOException {
+ void testSkipHeaderRecordFalse() throws IOException {
// functionally identical to testHeader, used to test CSV-153
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null).withHeader("C1", "C2", "C3").withSkipHeaderRecord(false))) {
@@ -1896,7 +1896,7 @@ public class CSVPrinterTest {
}
@Test
- public void testSkipHeaderRecordTrue() throws IOException {
+ void testSkipHeaderRecordTrue() throws IOException {
// functionally identical to testHeaderNotSet, used to test CSV-153
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null).withHeader("C1", "C2", "C3").withSkipHeaderRecord(true))) {
@@ -1907,7 +1907,7 @@ public class CSVPrinterTest {
}
@Test
- public void testTrailingDelimiterOnTwoColumns() throws IOException {
+ void testTrailingDelimiterOnTwoColumns() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withTrailingDelimiter())) {
printer.printRecord("A", "B");
@@ -1916,7 +1916,7 @@ public class CSVPrinterTest {
}
@Test
- public void testTrimOffOneColumn() throws IOException {
+ void testTrimOffOneColumn() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withTrim(false))) {
printer.print(" A ");
@@ -1925,7 +1925,7 @@ public class CSVPrinterTest {
}
@Test
- public void testTrimOnOneColumn() throws IOException {
+ void testTrimOnOneColumn() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withTrim())) {
printer.print(" A ");
@@ -1934,7 +1934,7 @@ public class CSVPrinterTest {
}
@Test
- public void testTrimOnTwoColumns() throws IOException {
+ void testTrimOnTwoColumns() throws IOException {
final StringWriter sw = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withTrim())) {
printer.print(" A ");
diff --git a/src/test/java/org/apache/commons/csv/CSVRecordTest.java b/src/test/java/org/apache/commons/csv/CSVRecordTest.java
index f9fedc4b..1c0e05d3 100644
--- a/src/test/java/org/apache/commons/csv/CSVRecordTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVRecordTest.java
@@ -86,7 +86,7 @@ public class CSVRecordTest {
}
@Test
- public void testCSVRecordNULLValues() throws IOException {
+ void testCSVRecordNULLValues() throws IOException {
try (CSVParser parser = CSVParser.parse("A,B\r\nONE,TWO", CSVFormat.DEFAULT.withHeader())) {
final CSVRecord csvRecord = new CSVRecord(parser, null, null, 0L, 0L, 0L);
assertEquals(0, csvRecord.size());
@@ -95,7 +95,7 @@ public class CSVRecordTest {
}
@Test
- public void testDuplicateHeaderGet() throws IOException {
+ void testDuplicateHeaderGet() throws IOException {
final String csv = "A,A,B,B\n1,2,5,6\n";
final CSVFormat format = CSVFormat.DEFAULT.builder().setHeader().get();
@@ -110,7 +110,7 @@ public class CSVRecordTest {
}
@Test
- public void testDuplicateHeaderToMap() throws IOException {
+ void testDuplicateHeaderToMap() throws IOException {
final String csv = "A,A,B,B\n1,2,5,6\n";
final CSVFormat format = CSVFormat.DEFAULT.builder().setHeader().get();
@@ -126,64 +126,64 @@ public class CSVRecordTest {
}
@Test
- public void testGetInt() {
+ void testGetInt() {
assertEquals(values[0], record.get(0));
assertEquals(values[1], record.get(1));
assertEquals(values[2], record.get(2));
}
@Test
- public void testGetNullEnum() {
+ void testGetNullEnum() {
assertThrows(IllegalArgumentException.class, () -> recordWithHeader.get((Enum<?>) null));
}
@Test
- public void testGetString() {
+ void testGetString() {
assertEquals(values[0], recordWithHeader.get(EnumHeader.FIRST.name()));
assertEquals(values[1], recordWithHeader.get(EnumHeader.SECOND.name()));
assertEquals(values[2], recordWithHeader.get(EnumHeader.THIRD.name()));
}
@Test
- public void testGetStringInconsistentRecord() {
+ void testGetStringInconsistentRecord() {
headerMap.put("fourth", Integer.valueOf(4));
assertThrows(IllegalArgumentException.class, () -> recordWithHeader.get("fourth"));
}
@Test
- public void testGetStringNoHeader() {
+ void testGetStringNoHeader() {
assertThrows(IllegalStateException.class, () -> record.get("first"));
}
@Test
- public void testGetUnmappedEnum() {
+ void testGetUnmappedEnum() {
assertThrows(IllegalArgumentException.class, () -> recordWithHeader.get(EnumFixture.UNKNOWN_COLUMN));
}
@Test
- public void testGetUnmappedName() {
+ void testGetUnmappedName() {
assertThrows(IllegalArgumentException.class, () -> assertNull(recordWithHeader.get("fourth")));
}
@Test
- public void testGetUnmappedNegativeInt() {
+ void testGetUnmappedNegativeInt() {
assertThrows(ArrayIndexOutOfBoundsException.class, () -> recordWithHeader.get(Integer.MIN_VALUE));
}
@Test
- public void testGetUnmappedPositiveInt() {
+ void testGetUnmappedPositiveInt() {
assertThrows(ArrayIndexOutOfBoundsException.class, () -> recordWithHeader.get(Integer.MAX_VALUE));
}
@Test
- public void testGetWithEnum() {
+ void testGetWithEnum() {
assertEquals(recordWithHeader.get("FIRST"), recordWithHeader.get(EnumHeader.FIRST));
assertEquals(recordWithHeader.get("SECOND"), recordWithHeader.get(EnumHeader.SECOND));
assertThrows(IllegalArgumentException.class, () -> recordWithHeader.get(EnumFixture.UNKNOWN_COLUMN));
}
@Test
- public void testIsConsistent() {
+ void testIsConsistent() {
assertTrue(record.isConsistent());
assertTrue(recordWithHeader.isConsistent());
final Map<String, Integer> map = recordWithHeader.getParser().getHeaderMap();
@@ -193,7 +193,7 @@ public class CSVRecordTest {
}
@Test
- public void testIsInconsistent() throws IOException {
+ void testIsInconsistent() throws IOException {
final String[] headers = { "first", "second", "third" };
final String rowData = StringUtils.join(values, ',');
try (CSVParser parser = CSVFormat.DEFAULT.withHeader(headers).parse(new StringReader(rowData))) {
@@ -205,14 +205,14 @@ public class CSVRecordTest {
}
@Test
- public void testIsMapped() {
+ void testIsMapped() {
assertFalse(record.isMapped("first"));
assertTrue(recordWithHeader.isMapped(EnumHeader.FIRST.name()));
assertFalse(recordWithHeader.isMapped("fourth"));
}
@Test
- public void testIsSetInt() {
+ void testIsSetInt() {
assertFalse(record.isSet(-1));
assertTrue(record.isSet(0));
assertTrue(record.isSet(2));
@@ -222,14 +222,14 @@ public class CSVRecordTest {
}
@Test
- public void testIsSetString() {
+ void testIsSetString() {
assertFalse(record.isSet("first"));
assertTrue(recordWithHeader.isSet(EnumHeader.FIRST.name()));
assertFalse(recordWithHeader.isSet("DOES NOT EXIST"));
}
@Test
- public void testIterator() {
+ void testIterator() {
int i = 0;
for (final String value : record) {
assertEquals(values[i], value);
@@ -238,7 +238,7 @@ public class CSVRecordTest {
}
@Test
- public void testPutInMap() {
+ void testPutInMap() {
final Map<String, String> map = new ConcurrentHashMap<>();
this.recordWithHeader.putIn(map);
validateMap(map, false);
@@ -248,7 +248,7 @@ public class CSVRecordTest {
}
@Test
- public void testRemoveAndAddColumns() throws IOException {
+ void testRemoveAndAddColumns() throws IOException {
// do:
try (CSVPrinter printer = new CSVPrinter(new StringBuilder(), CSVFormat.DEFAULT)) {
final Map<String, String> map = recordWithHeader.toMap();
@@ -263,7 +263,7 @@ public class CSVRecordTest {
}
@Test
- public void testSerialization() throws IOException, ClassNotFoundException {
+ void testSerialization() throws IOException, ClassNotFoundException {
final CSVRecord shortRec;
try (CSVParser parser = CSVParser.parse("A,B\n#my comment\nOne,Two", CSVFormat.DEFAULT.withHeader().withCommentMarker('#'))) {
shortRec = parser.iterator().next();
@@ -296,7 +296,7 @@ public class CSVRecordTest {
}
@Test
- public void testStream() {
+ void testStream() {
final AtomicInteger i = new AtomicInteger();
record.stream().forEach(value -> {
assertEquals(values[i.get()], value);
@@ -305,7 +305,7 @@ public class CSVRecordTest {
}
@Test
- public void testToListAdd() {
+ void testToListAdd() {
final String[] expected = values.clone();
final List<String> list = record.toList();
list.add("Last");
@@ -315,7 +315,7 @@ public class CSVRecordTest {
}
@Test
- public void testToListFor() {
+ void testToListFor() {
int i = 0;
for (final String value : record.toList()) {
assertEquals(values[i], value);
@@ -324,7 +324,7 @@ public class CSVRecordTest {
}
@Test
- public void testToListForEach() {
+ void testToListForEach() {
final AtomicInteger i = new AtomicInteger();
record.toList().forEach(e -> {
assertEquals(values[i.getAndIncrement()], e);
@@ -332,7 +332,7 @@ public class CSVRecordTest {
}
@Test
- public void testToListSet() {
+ void testToListSet() {
final String[] expected = values.clone();
final List<String> list = record.toList();
list.set(list.size() - 1, "Last");
@@ -342,13 +342,13 @@ public class CSVRecordTest {
}
@Test
- public void testToMap() {
+ void testToMap() {
final Map<String, String> map = this.recordWithHeader.toMap();
validateMap(map, true);
}
@Test
- public void testToMapWithNoHeader() throws Exception {
+ void testToMapWithNoHeader() throws Exception {
try (CSVParser parser = CSVParser.parse("a,b", CSVFormat.newFormat(','))) {
final CSVRecord shortRec = parser.iterator().next();
final Map<String, String> map = shortRec.toMap();
@@ -358,7 +358,7 @@ public class CSVRecordTest {
}
@Test
- public void testToMapWithShortRecord() throws Exception {
+ void testToMapWithShortRecord() throws Exception {
try (CSVParser parser = CSVParser.parse("a,b", CSVFormat.DEFAULT.withHeader("A", "B", "C"))) {
final CSVRecord shortRec = parser.iterator().next();
shortRec.toMap();
@@ -366,7 +366,7 @@ public class CSVRecordTest {
}
@Test
- public void testToString() {
+ void testToString() {
assertNotNull(recordWithHeader.toString());
assertTrue(recordWithHeader.toString().contains("comment="));
assertTrue(recordWithHeader.toString().contains("recordNumber="));
diff --git a/src/test/java/org/apache/commons/csv/ExtendedBufferedReaderTest.java b/src/test/java/org/apache/commons/csv/ExtendedBufferedReaderTest.java
index b7db39f5..9d929c65 100644
--- a/src/test/java/org/apache/commons/csv/ExtendedBufferedReaderTest.java
+++ b/src/test/java/org/apache/commons/csv/ExtendedBufferedReaderTest.java
@@ -44,7 +44,7 @@ public class ExtendedBufferedReaderTest {
}
@Test
- public void testEmptyInput() throws Exception {
+ void testEmptyInput() throws Exception {
try (ExtendedBufferedReader br = createBufferedReader("")) {
assertEquals(EOF, br.read());
assertEquals(EOF, br.peek());
@@ -58,7 +58,7 @@ public class ExtendedBufferedReaderTest {
* Test to illustrate https://issues.apache.org/jira/browse/CSV-75
*/
@Test
- public void testReadChar() throws Exception {
+ void testReadChar() throws Exception {
final String test = "a" + LF + "b" + CR + "c" + LF + LF + "d" + CR + CR + "e" + LFCR + "f " + CRLF;
// EOL eol EOL EOL eol eol EOL+CR EOL
final int eolCount = 9;
@@ -94,7 +94,7 @@ public class ExtendedBufferedReaderTest {
}
@Test
- public void testReadingInDifferentBuffer() throws Exception {
+ void testReadingInDifferentBuffer() throws Exception {
final char[] tmp1 = new char[2];
final char[] tmp2 = new char[4];
try (ExtendedBufferedReader reader = createBufferedReader("1\r\n2\r\n")) {
@@ -105,7 +105,7 @@ public class ExtendedBufferedReaderTest {
}
@Test
- public void testReadLine() throws Exception {
+ void testReadLine() throws Exception {
try (ExtendedBufferedReader br = createBufferedReader("")) {
assertNull(br.readLine());
}
@@ -148,7 +148,7 @@ public class ExtendedBufferedReaderTest {
}
@Test
- public void testReadLookahead1() throws Exception {
+ void testReadLookahead1() throws Exception {
try (ExtendedBufferedReader br = createBufferedReader("1\n2\r3\n")) {
assertEquals(0, br.getLineNumber());
assertEquals('1', br.peek());
@@ -207,7 +207,7 @@ public class ExtendedBufferedReaderTest {
}
@Test
- public void testReadLookahead2() throws Exception {
+ void testReadLookahead2() throws Exception {
final char[] ref = new char[5];
final char[] res = new char[5];
diff --git a/src/test/java/org/apache/commons/csv/JiraCsv196Test.java b/src/test/java/org/apache/commons/csv/JiraCsv196Test.java
index ef94efe0..2beae36a 100644
--- a/src/test/java/org/apache/commons/csv/JiraCsv196Test.java
+++ b/src/test/java/org/apache/commons/csv/JiraCsv196Test.java
@@ -35,7 +35,7 @@ public class JiraCsv196Test {
}
@Test
- public void testParseFourBytes() throws IOException {
+ void testParseFourBytes() throws IOException {
final CSVFormat format = CSVFormat.Builder.create().setDelimiter(',').setQuote('\'').get();
// @formatter:off
try (@SuppressWarnings("resource") // parser closes the reader.
@@ -55,7 +55,7 @@ public class JiraCsv196Test {
}
@Test
- public void testParseThreeBytes() throws IOException {
+ void testParseThreeBytes() throws IOException {
final CSVFormat format = CSVFormat.Builder.create().setDelimiter(',').setQuote('\'').get();
// @formatter:off
try (@SuppressWarnings("resource") // parser closes the reader.
diff --git a/src/test/java/org/apache/commons/csv/LexerTest.java b/src/test/java/org/apache/commons/csv/LexerTest.java
index 38ab1255..2c974269 100644
--- a/src/test/java/org/apache/commons/csv/LexerTest.java
+++ b/src/test/java/org/apache/commons/csv/LexerTest.java
@@ -71,7 +71,7 @@ public class LexerTest {
// simple token with escaping enabled
@Test
- public void testBackslashWithEscaping() throws IOException {
+ void testBackslashWithEscaping() throws IOException {
/*
* file: a,\,,b \,,
*/
@@ -91,7 +91,7 @@ public class LexerTest {
// simple token with escaping not enabled
@Test
- public void testBackslashWithoutEscaping() throws IOException {
+ void testBackslashWithoutEscaping() throws IOException {
/*
* file: a,\,,b \,,
*/
@@ -113,14 +113,14 @@ public class LexerTest {
}
@Test
- public void testBackspace() throws Exception {
+ void testBackspace() throws Exception {
try (Lexer lexer = createLexer("character" + BACKSPACE + "NotEscaped", formatWithEscaping)) {
assertNextToken("character" + BACKSPACE + "NotEscaped", lexer);
}
}
@Test
- public void testComments() throws IOException {
+ void testComments() throws IOException {
final String code = "first,line,\n" + "second,line,tokenWith#no-comment\n" + "# comment line \n" +
"third,line,#no-comment\n" + "# penultimate comment\n" + "# Final comment\n";
final CSVFormat format = CSVFormat.DEFAULT.withCommentMarker('#');
@@ -143,7 +143,7 @@ public class LexerTest {
}
@Test
- public void testCommentsAndEmptyLines() throws IOException {
+ void testCommentsAndEmptyLines() throws IOException {
final String code = "1,2,3,\n" + // 1
"\n" + // 1b
"\n" + // 1c
@@ -189,7 +189,7 @@ public class LexerTest {
}
@Test
- public void testCR() throws Exception {
+ void testCR() throws Exception {
try (Lexer lexer = createLexer("character" + CR + "NotEscaped", formatWithEscaping)) {
assertNextToken("character", lexer);
assertNextToken("NotEscaped", lexer);
@@ -198,7 +198,7 @@ public class LexerTest {
// From CSV-1
@Test
- public void testDelimiterIsWhitespace() throws IOException {
+ void testDelimiterIsWhitespace() throws IOException {
final String code = "one\ttwo\t\tfour \t five\t six";
try (Lexer lexer = createLexer(code, CSVFormat.TDF)) {
assertNextToken(TOKEN, "one", lexer);
@@ -211,7 +211,7 @@ public class LexerTest {
}
@Test
- public void testEOFWithoutClosingQuote() throws Exception {
+ void testEOFWithoutClosingQuote() throws Exception {
final String code = "a,\"b";
try (Lexer lexer = createLexer(code, CSVFormat.Builder.create().setLenientEof(true).get())) {
assertNextToken(TOKEN, "a", lexer);
@@ -224,21 +224,21 @@ public class LexerTest {
}
@Test // TODO is this correct? Do we expect <esc>BACKSPACE to be unescaped?
- public void testEscapedBackspace() throws Exception {
+ void testEscapedBackspace() throws Exception {
try (Lexer lexer = createLexer("character\\" + BACKSPACE + "Escaped", formatWithEscaping)) {
assertNextToken("character" + BACKSPACE + "Escaped", lexer);
}
}
@Test
- public void testEscapedCharacter() throws Exception {
+ void testEscapedCharacter() throws Exception {
try (Lexer lexer = createLexer("character\\aEscaped", formatWithEscaping)) {
assertNextToken("character\\aEscaped", lexer);
}
}
@Test
- public void testEscapedControlCharacter() throws Exception {
+ void testEscapedControlCharacter() throws Exception {
// we are explicitly using an escape different from \ here
try (Lexer lexer = createLexer("character!rEscaped", CSVFormat.DEFAULT.withEscape('!'))) {
assertNextToken("character" + CR + "Escaped", lexer);
@@ -246,35 +246,35 @@ public class LexerTest {
}
@Test
- public void testEscapedControlCharacter2() throws Exception {
+ void testEscapedControlCharacter2() throws Exception {
try (Lexer lexer = createLexer("character\\rEscaped", CSVFormat.DEFAULT.withEscape('\\'))) {
assertNextToken("character" + CR + "Escaped", lexer);
}
}
@Test
- public void testEscapedCR() throws Exception {
+ void testEscapedCR() throws Exception {
try (Lexer lexer = createLexer("character\\" + CR + "Escaped", formatWithEscaping)) {
assertNextToken("character" + CR + "Escaped", lexer);
}
}
@Test // TODO is this correct? Do we expect <esc>FF to be unescaped?
- public void testEscapedFF() throws Exception {
+ void testEscapedFF() throws Exception {
try (Lexer lexer = createLexer("character\\" + FF + "Escaped", formatWithEscaping)) {
assertNextToken("character" + FF + "Escaped", lexer);
}
}
@Test
- public void testEscapedLF() throws Exception {
+ void testEscapedLF() throws Exception {
try (Lexer lexer = createLexer("character\\" + LF + "Escaped", formatWithEscaping)) {
assertNextToken("character" + LF + "Escaped", lexer);
}
}
@Test
- public void testEscapedMySqlNullValue() throws Exception {
+ void testEscapedMySqlNullValue() throws Exception {
// MySQL uses \N to symbolize null values. We have to restore this
try (Lexer lexer = createLexer("character\\NEscaped", formatWithEscaping)) {
assertNextToken("character\\NEscaped", lexer);
@@ -282,7 +282,7 @@ public class LexerTest {
}
@Test // TODO is this correct? Do we expect <esc>TAB to be unescaped?
- public void testEscapedTab() throws Exception {
+ void testEscapedTab() throws Exception {
try (Lexer lexer = createLexer("character\\" + TAB + "Escaped", formatWithEscaping)) {
assertNextToken("character" + TAB + "Escaped", lexer);
}
@@ -290,7 +290,7 @@ public class LexerTest {
}
@Test
- public void testEscapingAtEOF() throws Exception {
+ void testEscapingAtEOF() throws Exception {
final String code = "escaping at EOF is evil\\";
try (Lexer lexer = createLexer(code, formatWithEscaping)) {
assertThrows(IOException.class, () -> lexer.nextToken(new Token()));
@@ -298,14 +298,14 @@ public class LexerTest {
}
@Test
- public void testFF() throws Exception {
+ void testFF() throws Exception {
try (Lexer lexer = createLexer("character" + FF + "NotEscaped", formatWithEscaping)) {
assertNextToken("character" + FF + "NotEscaped", lexer);
}
}
@Test
- public void testIgnoreEmptyLines() throws IOException {
+ void testIgnoreEmptyLines() throws IOException {
final String code = "first,line,\n" + "\n" + "\n" + "second,line\n" + "\n" + "\n" + "third line \n" + "\n" +
"\n" + "last, line \n" + "\n" + "\n" + "\n";
final CSVFormat format = CSVFormat.DEFAULT.withIgnoreEmptyLines();
@@ -324,7 +324,7 @@ public class LexerTest {
}
@Test
- public void testIsMetaCharCommentStart() throws IOException {
+ void testIsMetaCharCommentStart() throws IOException {
try (Lexer lexer = createLexer("#", CSVFormat.DEFAULT.withCommentMarker('#'))) {
final int ch = lexer.readEscape();
assertEquals('#', ch);
@@ -332,7 +332,7 @@ public class LexerTest {
}
@Test
- public void testLF() throws Exception {
+ void testLF() throws Exception {
try (Lexer lexer = createLexer("character" + LF + "NotEscaped", formatWithEscaping)) {
assertNextToken("character", lexer);
assertNextToken("NotEscaped", lexer);
@@ -341,7 +341,7 @@ public class LexerTest {
// encapsulator tokenizer (single line)
@Test
- public void testNextToken4() throws IOException {
+ void testNextToken4() throws IOException {
/*
* file: a,"foo",b a, " foo",b a,"foo " ,b // whitespace after closing encapsulator a, " foo " ,b
*/
@@ -365,7 +365,7 @@ public class LexerTest {
// encapsulator tokenizer (multi line, delimiter in string)
@Test
- public void testNextToken5() throws IOException {
+ void testNextToken5() throws IOException {
final String code = "a,\"foo\n\",b\n\"foo\n baar ,,,\"\n\"\n\t \n\"";
try (Lexer lexer = createLexer(code, CSVFormat.DEFAULT)) {
assertNextToken(TOKEN, "a", lexer);
@@ -378,7 +378,7 @@ public class LexerTest {
// change delimiters, comment, encapsulater
@Test
- public void testNextToken6() throws IOException {
+ void testNextToken6() throws IOException {
/*
* file: a;'b and \' more ' !comment;;;; ;;
*/
@@ -391,7 +391,7 @@ public class LexerTest {
}
@Test
- public void testReadEscapeBackspace() throws IOException {
+ void testReadEscapeBackspace() throws IOException {
try (Lexer lexer = createLexer("b", CSVFormat.DEFAULT.withEscape('\b'))) {
final int ch = lexer.readEscape();
assertEquals(BACKSPACE, ch);
@@ -399,7 +399,7 @@ public class LexerTest {
}
@Test
- public void testReadEscapeFF() throws IOException {
+ void testReadEscapeFF() throws IOException {
try (Lexer lexer = createLexer("f", CSVFormat.DEFAULT.withEscape('\f'))) {
final int ch = lexer.readEscape();
assertEquals(FF, ch);
@@ -407,7 +407,7 @@ public class LexerTest {
}
@Test
- public void testReadEscapeTab() throws IOException {
+ void testReadEscapeTab() throws IOException {
try (Lexer lexer = createLexer("t", CSVFormat.DEFAULT.withEscape('\t'))) {
final int ch = lexer.readEscape();
assertNextToken(EOF, "", lexer);
@@ -416,7 +416,7 @@ public class LexerTest {
}
@Test
- public void testSurroundingSpacesAreDeleted() throws IOException {
+ void testSurroundingSpacesAreDeleted() throws IOException {
final String code = "noSpaces, leadingSpaces,trailingSpaces , surroundingSpaces , ,,";
try (Lexer lexer = createLexer(code, CSVFormat.DEFAULT.withIgnoreSurroundingSpaces())) {
assertNextToken(TOKEN, "noSpaces", lexer);
@@ -430,7 +430,7 @@ public class LexerTest {
}
@Test
- public void testSurroundingTabsAreDeleted() throws IOException {
+ void testSurroundingTabsAreDeleted() throws IOException {
final String code = "noTabs,\tleadingTab,trailingTab\t,\tsurroundingTabs\t,\t\t,,";
try (Lexer lexer = createLexer(code, CSVFormat.DEFAULT.withIgnoreSurroundingSpaces())) {
assertNextToken(TOKEN, "noTabs", lexer);
@@ -444,14 +444,14 @@ public class LexerTest {
}
@Test
- public void testTab() throws Exception {
+ void testTab() throws Exception {
try (Lexer lexer = createLexer("character" + TAB + "NotEscaped", formatWithEscaping)) {
assertNextToken("character" + TAB + "NotEscaped", lexer);
}
}
@Test
- public void testTrailingTextAfterQuote() throws Exception {
+ void testTrailingTextAfterQuote() throws Exception {
final String code = "\"a\" b,\"a\" \" b,\"a\" b \"\"";
try (Lexer lexer = createLexer(code, CSVFormat.Builder.create().setTrailingData(true).get())) {
assertNextToken(TOKEN, "a b", lexer);
@@ -464,7 +464,7 @@ public class LexerTest {
}
@Test
- public void testTrimTrailingSpacesZeroLength() throws Exception {
+ void testTrimTrailingSpacesZeroLength() throws Exception {
final StringBuilder buffer = new StringBuilder("");
try (Lexer lexer = createLexer(buffer.toString(), CSVFormat.DEFAULT)) {
lexer.trimTrailingSpaces(buffer);
diff --git a/src/test/java/org/apache/commons/csv/TokenTest.java b/src/test/java/org/apache/commons/csv/TokenTest.java
index 0f7f2f1e..0a90a11e 100644
--- a/src/test/java/org/apache/commons/csv/TokenTest.java
+++ b/src/test/java/org/apache/commons/csv/TokenTest.java
@@ -32,7 +32,7 @@ public class TokenTest {
@ParameterizedTest
@EnumSource(Token.Type.class)
- public void testToString(final Token.Type type) {
+ void testToString(final Token.Type type) {
// Should never blow up
final Token token = new Token();
final String resetName = Token.Type.INVALID.name();
diff --git a/src/test/java/org/apache/commons/csv/UserGuideTest.java b/src/test/java/org/apache/commons/csv/UserGuideTest.java
index 6b97ccde..6f3f77bf 100644
--- a/src/test/java/org/apache/commons/csv/UserGuideTest.java
+++ b/src/test/java/org/apache/commons/csv/UserGuideTest.java
@@ -54,7 +54,7 @@ public class UserGuideTest {
}
@Test
- public void testBomFull() throws UnsupportedEncodingException, IOException {
+ void testBomFull() throws UnsupportedEncodingException, IOException {
final Path path = tempDir.resolve("test1.csv");
Files.copy(Utils.createUtf8Input("ColumnA, ColumnB, ColumnC\r\nA, B, C\r\n".getBytes(StandardCharsets.UTF_8), true), path);
// @formatter:off
@@ -74,7 +74,7 @@ public class UserGuideTest {
}
@Test
- public void testBomUtil() throws UnsupportedEncodingException, IOException {
+ void testBomUtil() throws UnsupportedEncodingException, IOException {
final Path path = tempDir.resolve("test2.csv");
Files.copy(Utils.createUtf8Input("ColumnA, ColumnB, ColumnC\r\nA, B, C\r\n".getBytes(StandardCharsets.UTF_8), true), path);
try (Reader reader = newReader(path);
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv148Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv148Test.java
index 71b05683..5289b4a9 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv148Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv148Test.java
@@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
public class JiraCsv148Test {
@Test
- public void testWithIgnoreSurroundingSpacesEmpty() {
+ void testWithIgnoreSurroundingSpacesEmpty() {
// @formatter:off
final CSVFormat format = CSVFormat.DEFAULT.builder()
.setQuoteMode(QuoteMode.ALL)
@@ -47,7 +47,7 @@ public class JiraCsv148Test {
* quotation marks, while withIgnoreSurroundingSpace() cannot The same point: you can remove the leading and trailing spaces, tabs and other symbols.
*/
@Test
- public void testWithTrimEmpty() {
+ void testWithTrimEmpty() {
// @formatter:off
final CSVFormat format = CSVFormat.DEFAULT.builder()
.setQuoteMode(QuoteMode.ALL)
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv149Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv149Test.java
index 5b3d40c9..c12574f2 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv149Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv149Test.java
@@ -34,7 +34,7 @@ public class JiraCsv149Test {
private static final String CR_LF = "\r\n";
@Test
- public void testJiraCsv149EndWithEOL() throws IOException {
+ void testJiraCsv149EndWithEOL() throws IOException {
testJiraCsv149EndWithEolAtEof(true);
}
@@ -61,7 +61,7 @@ public class JiraCsv149Test {
}
@Test
- public void testJiraCsv149EndWithoutEOL() throws IOException {
+ void testJiraCsv149EndWithoutEOL() throws IOException {
testJiraCsv149EndWithEolAtEof(false);
}
}
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv150Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv150Test.java
index f1047729..5e9feb7d 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv150Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv150Test.java
@@ -36,19 +36,19 @@ public class JiraCsv150Test {
}
@Test
- public void testDisableComment() throws IOException {
+ void testDisableComment() throws IOException {
final StringReader stringReader = new StringReader("\"66\u2441\",,\"\",\"DeutscheBK\ufffe\",\"000\"\r\n");
testDisable(CSVFormat.DEFAULT.builder().setCommentMarker(null).get(), stringReader);
}
@Test
- public void testDisableEncapsulation() throws IOException {
+ void testDisableEncapsulation() throws IOException {
final StringReader stringReader = new StringReader("66\u2441,,\"\",\ufffeDeutscheBK,\"000\"\r\n");
testDisable(CSVFormat.DEFAULT.builder().setQuote(null).get(), stringReader);
}
@Test
- public void testDisableEscaping() throws IOException {
+ void testDisableEscaping() throws IOException {
final StringReader stringReader = new StringReader("\"66\u2441\",,\"\",\"DeutscheBK\ufffe\",\"000\"\r\n");
testDisable(CSVFormat.DEFAULT.builder().setEscape(null).get(), stringReader);
}
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv154Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv154Test.java
index c045cdd2..6276775c 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv154Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv154Test.java
@@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
public class JiraCsv154Test {
@Test
- public void testJiraCsv154_withCommentMarker() throws IOException {
+ void testJiraCsv154_withCommentMarker() throws IOException {
final String comment = "This is a header comment";
// @formatter:off
final CSVFormat format = CSVFormat.EXCEL.builder()
@@ -48,7 +48,7 @@ public class JiraCsv154Test {
}
@Test
- public void testJiraCsv154_withHeaderComments() throws IOException {
+ void testJiraCsv154_withHeaderComments() throws IOException {
final String comment = "This is a header comment";
// @formatter:off
final CSVFormat format = CSVFormat.EXCEL.builder()
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv167Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv167Test.java
index 5caeecd6..32dd2357 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv167Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv167Test.java
@@ -39,7 +39,7 @@ public class JiraCsv167Test {
}
@Test
- public void testParse() throws IOException {
+ void testParse() throws IOException {
int totcomment = 0;
int totrecs = 0;
try (Reader reader = getTestReader(); BufferedReader br = new BufferedReader(reader)) {
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv198Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv198Test.java
index 641797fe..80b86b61 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv198Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv198Test.java
@@ -42,7 +42,7 @@ public class JiraCsv198Test {
// @formatter:on
@Test
- public void test() throws UnsupportedEncodingException, IOException {
+ void test() throws UnsupportedEncodingException, IOException {
final InputStream pointsOfReference = getClass().getResourceAsStream("/org/apache/commons/csv/CSV-198/optd_por_public.csv");
assertNotNull(pointsOfReference);
try (@SuppressWarnings("resource")
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv203Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv203Test.java
index 8eee0415..f467c678 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv203Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv203Test.java
@@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
public class JiraCsv203Test {
@Test
- public void testQuoteModeAll() throws Exception {
+ void testQuoteModeAll() throws Exception {
// @formatter:off
final CSVFormat format = CSVFormat.EXCEL.builder()
.setNullString("N/A")
@@ -48,7 +48,7 @@ public class JiraCsv203Test {
}
@Test
- public void testQuoteModeAllNonNull() throws Exception {
+ void testQuoteModeAllNonNull() throws Exception {
// @formatter:off
final CSVFormat format = CSVFormat.EXCEL.builder()
.setNullString("N/A")
@@ -64,7 +64,7 @@ public class JiraCsv203Test {
}
@Test
- public void testQuoteModeMinimal() throws Exception {
+ void testQuoteModeMinimal() throws Exception {
// @formatter:off
final CSVFormat format = CSVFormat.EXCEL.builder()
.setNullString("N/A")
@@ -80,7 +80,7 @@ public class JiraCsv203Test {
}
@Test
- public void testQuoteModeNonNumeric() throws Exception {
+ void testQuoteModeNonNumeric() throws Exception {
// @formatter:off
final CSVFormat format = CSVFormat.EXCEL.builder()
.setNullString("N/A")
@@ -96,7 +96,7 @@ public class JiraCsv203Test {
}
@Test
- public void testWithEmptyValues() throws Exception {
+ void testWithEmptyValues() throws Exception {
// @formatter:off
final CSVFormat format = CSVFormat.EXCEL.builder()
.setNullString("N/A")
@@ -113,7 +113,7 @@ public class JiraCsv203Test {
}
@Test
- public void testWithoutNullString() throws Exception {
+ void testWithoutNullString() throws Exception {
// @formatter:off
final CSVFormat format = CSVFormat.EXCEL.builder()
//.setNullString("N/A")
@@ -129,7 +129,7 @@ public class JiraCsv203Test {
}
@Test
- public void testWithoutQuoteMode() throws Exception {
+ void testWithoutQuoteMode() throws Exception {
// @formatter:off
final CSVFormat format = CSVFormat.EXCEL.builder()
.setNullString("N/A")
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv206Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv206Test.java
index 3b69b173..cf9a0ad3 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv206Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv206Test.java
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
public class JiraCsv206Test {
@Test
- public void testJiraCsv206MultipleCharacterDelimiter() throws IOException {
+ void testJiraCsv206MultipleCharacterDelimiter() throws IOException {
// Read with multiple character delimiter
final String source = "FirstName[|]LastName[|]Address\r\nJohn[|]Smith[|]123 Main St.";
final StringReader reader = new StringReader(source);
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv211Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv211Test.java
index a4e3960c..04b4d06d 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv211Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv211Test.java
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
public class JiraCsv211Test {
@Test
- public void testJiraCsv211Format() throws IOException {
+ void testJiraCsv211Format() throws IOException {
// @formatter:off
final CSVFormat printFormat = CSVFormat.DEFAULT.builder()
.setDelimiter('\t')
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv213Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv213Test.java
index d700843f..f32a6fc4 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv213Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv213Test.java
@@ -64,7 +64,7 @@ public class JiraCsv213Test {
}
@Test
- public void test() {
+ void test() {
createEndChannel(new File("src/test/resources/org/apache/commons/csv/CSV-213/999751170.patch.csv"));
}
}
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv247Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv247Test.java
index 85d9676f..a460250b 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv247Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv247Test.java
@@ -37,7 +37,7 @@ import org.junit.jupiter.api.Test;
public class JiraCsv247Test {
@Test
- public void testHeadersMissingOneColumnWhenAllowingMissingColumnNames() throws Exception {
+ void testHeadersMissingOneColumnWhenAllowingMissingColumnNames() throws Exception {
final CSVFormat format = CSVFormat.DEFAULT.builder().setHeader().setAllowMissingColumnNames(true).get();
assertTrue(format.getAllowMissingColumnNames(), "We should allow missing column names");
@@ -63,7 +63,7 @@ public class JiraCsv247Test {
}
@Test
- public void testHeadersMissingThrowsWhenNotAllowingMissingColumnNames() {
+ void testHeadersMissingThrowsWhenNotAllowingMissingColumnNames() {
final CSVFormat format = CSVFormat.DEFAULT.builder().setHeader().get();
assertFalse(format.getAllowMissingColumnNames(), "By default we should not allow missing column names");
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv248Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv248Test.java
index 08cfe13f..7a9c0aa9 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv248Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv248Test.java
@@ -50,7 +50,7 @@ public class JiraCsv248Test {
* @throws ClassNotFoundException If the CSVRecord cannot be deserialized
*/
@Test
- public void testJiraCsv248() throws IOException, ClassNotFoundException {
+ void testJiraCsv248() throws IOException, ClassNotFoundException {
// Record was originally created using CSV version 1.6 with the following code:
// try (CSVParser parser = CSVParser.parse("A,B\n#my comment\nOne,Two",
// CSVFormat.DEFAULT.builder().setHeader().setCommentMarker('#'))) {
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv249Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv249Test.java
index f5fe47ca..8e2a5168 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv249Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv249Test.java
@@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test;
public class JiraCsv249Test {
@Test
- public void testJiraCsv249() throws IOException {
+ void testJiraCsv249() throws IOException {
final CSVFormat format = CSVFormat.DEFAULT.builder().setEscape('\\').get();
final StringWriter stringWriter = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(stringWriter, format)) {
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv253Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv253Test.java
index 5b266a3e..3d749800 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv253Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv253Test.java
@@ -42,7 +42,7 @@ public class JiraCsv253Test {
}
@Test
- public void testHandleAbsentValues() throws IOException {
+ void testHandleAbsentValues() throws IOException {
final String source = "\"John\",,\"Doe\"\n" + ",\"AA\",123\n" + "\"John\",90,\n" + "\"\",,90";
final CSVFormat csvFormat = CSVFormat.DEFAULT.builder().setQuoteMode(QuoteMode.NON_NUMERIC).get();
try (CSVParser parser = csvFormat.parse(new StringReader(source))) {
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv263Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv263Test.java
index abae0ea2..28377bb8 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv263Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv263Test.java
@@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test;
public class JiraCsv263Test {
@Test
- public void testPrintFromReaderWithQuotes() throws IOException {
+ void testPrintFromReaderWithQuotes() throws IOException {
// @formatter:off
final CSVFormat format = CSVFormat.RFC4180.builder()
.setDelimiter(',')
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv264Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv264Test.java
index d910ef58..e6449526 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv264Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv264Test.java
@@ -49,7 +49,7 @@ public class JiraCsv264Test {
"\"6\",\"7\",\"\",\"\",\"10\"";
@Test
- public void testJiraCsv264() {
+ void testJiraCsv264() {
final CSVFormat csvFormat = CSVFormat.DEFAULT
.builder()
.setHeader()
@@ -62,7 +62,7 @@ public class JiraCsv264Test {
}
@Test
- public void testJiraCsv264WithGapAllowEmpty() throws IOException {
+ void testJiraCsv264WithGapAllowEmpty() throws IOException {
final CSVFormat csvFormat = CSVFormat.DEFAULT
.builder()
.setHeader()
@@ -75,7 +75,7 @@ public class JiraCsv264Test {
}
@Test
- public void testJiraCsv264WithGapDisallow() {
+ void testJiraCsv264WithGapDisallow() {
final CSVFormat csvFormat = CSVFormat.DEFAULT
.builder()
.setHeader()
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv265Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv265Test.java
index 4853672d..286fa7f1 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv265Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv265Test.java
@@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
public class JiraCsv265Test {
@Test
- public void testCharacterPositionWithComments() throws IOException {
+ void testCharacterPositionWithComments() throws IOException {
// @formatter:off
final String csv =
"# Comment1\n" +
@@ -62,7 +62,7 @@ public class JiraCsv265Test {
}
@Test
- public void testCharacterPositionWithCommentsSpanningMultipleLines() throws IOException {
+ void testCharacterPositionWithCommentsSpanningMultipleLines() throws IOException {
// @formatter:off
final String csv =
"# Comment1\n" +
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv271Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv271Test.java
index 5ee5e0a0..9abdbbe6 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv271Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv271Test.java
@@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
public class JiraCsv271Test {
@Test
- public void testJiraCsv271_withArray() throws IOException {
+ void testJiraCsv271_withArray() throws IOException {
final CSVFormat csvFormat = CSVFormat.DEFAULT;
final StringWriter stringWriter = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(stringWriter, csvFormat)) {
@@ -43,7 +43,7 @@ public class JiraCsv271Test {
}
@Test
- public void testJiraCsv271_withList() throws IOException {
+ void testJiraCsv271_withList() throws IOException {
final CSVFormat csvFormat = CSVFormat.DEFAULT;
final StringWriter stringWriter = new StringWriter();
try (CSVPrinter printer = new CSVPrinter(stringWriter, csvFormat)) {
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv288Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv288Test.java
index 0be6a52f..6626964f 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv288Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv288Test.java
@@ -42,7 +42,7 @@ public class JiraCsv288Test {
@Test
// Before fix:
// expected: <a,b,c,d,,f> but was: <a,b,c,d,|f>
- public void testParseWithABADelimiter() throws Exception {
+ void testParseWithABADelimiter() throws Exception {
final Reader in = new StringReader("a|~|b|~|c|~|d|~||~|f");
final StringBuilder stringBuilder = new StringBuilder();
try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, CSVFormat.EXCEL);
@@ -57,7 +57,7 @@ public class JiraCsv288Test {
@Test
// Before fix:
// expected: <a,b,c,d,,f> but was: <a,b|c,d,|f>
- public void testParseWithDoublePipeDelimiter() throws Exception {
+ void testParseWithDoublePipeDelimiter() throws Exception {
final Reader in = new StringReader("a||b||c||d||||f");
final StringBuilder stringBuilder = new StringBuilder();
try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, CSVFormat.EXCEL);
@@ -72,7 +72,7 @@ public class JiraCsv288Test {
@Test
// Regression, already passed before fix
- public void testParseWithDoublePipeDelimiterDoubleCharValue() throws Exception {
+ void testParseWithDoublePipeDelimiterDoubleCharValue() throws Exception {
final Reader in = new StringReader("a||bb||cc||dd||f");
final StringBuilder stringBuilder = new StringBuilder();
try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, CSVFormat.EXCEL);
@@ -87,7 +87,7 @@ public class JiraCsv288Test {
@Test
// Before fix:
// expected: <a,b,c,d,,f,> but was: <a,b|c,d,|f>
- public void testParseWithDoublePipeDelimiterEndsWithDelimiter() throws Exception {
+ void testParseWithDoublePipeDelimiterEndsWithDelimiter() throws Exception {
final Reader in = new StringReader("a||b||c||d||||f||");
final StringBuilder stringBuilder = new StringBuilder();
try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, CSVFormat.EXCEL);
@@ -102,7 +102,7 @@ public class JiraCsv288Test {
@Test
// Before fix:
// expected: <a,b||c,d,,f> but was: <a,b||c,d,|f>
- public void testParseWithDoublePipeDelimiterQuoted() throws Exception {
+ void testParseWithDoublePipeDelimiterQuoted() throws Exception {
final Reader in = new StringReader("a||\"b||c\"||d||||f");
final StringBuilder stringBuilder = new StringBuilder();
try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, CSVFormat.EXCEL);
@@ -116,7 +116,7 @@ public class JiraCsv288Test {
@Test
// Regression, already passed before fix
- public void testParseWithSinglePipeDelimiterEndsWithDelimiter() throws Exception {
+ void testParseWithSinglePipeDelimiterEndsWithDelimiter() throws Exception {
final Reader in = new StringReader("a|b|c|d||f|");
final StringBuilder stringBuilder = new StringBuilder();
try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, CSVFormat.EXCEL);
@@ -131,7 +131,7 @@ public class JiraCsv288Test {
@Test
// Before fix:
// expected: <a,b,c,d,,f> but was: <a,b|c,d,|f>
- public void testParseWithTriplePipeDelimiter() throws Exception {
+ void testParseWithTriplePipeDelimiter() throws Exception {
final Reader in = new StringReader("a|||b|||c|||d||||||f");
final StringBuilder stringBuilder = new StringBuilder();
try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, CSVFormat.EXCEL);
@@ -145,7 +145,7 @@ public class JiraCsv288Test {
@Test
// Regression, already passed before fix
- public void testParseWithTwoCharDelimiter1() throws Exception {
+ void testParseWithTwoCharDelimiter1() throws Exception {
final Reader in = new StringReader("a~|b~|c~|d~|~|f");
final StringBuilder stringBuilder = new StringBuilder();
try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, CSVFormat.EXCEL);
@@ -159,7 +159,7 @@ public class JiraCsv288Test {
@Test
// Regression, already passed before fix
- public void testParseWithTwoCharDelimiter2() throws Exception {
+ void testParseWithTwoCharDelimiter2() throws Exception {
final Reader in = new StringReader("a~|b~|c~|d~|~|f~");
final StringBuilder stringBuilder = new StringBuilder();
try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, CSVFormat.EXCEL);
@@ -173,7 +173,7 @@ public class JiraCsv288Test {
@Test
// Regression, already passed before fix
- public void testParseWithTwoCharDelimiter3() throws Exception {
+ void testParseWithTwoCharDelimiter3() throws Exception {
final Reader in = new StringReader("a~|b~|c~|d~|~|f|");
final StringBuilder stringBuilder = new StringBuilder();
try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, CSVFormat.EXCEL);
@@ -187,7 +187,7 @@ public class JiraCsv288Test {
@Test
// Regression, already passed before fix
- public void testParseWithTwoCharDelimiter4() throws Exception {
+ void testParseWithTwoCharDelimiter4() throws Exception {
final Reader in = new StringReader("a~|b~|c~|d~|~|f~~||g");
final StringBuilder stringBuilder = new StringBuilder();
try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, CSVFormat.EXCEL);
@@ -202,7 +202,7 @@ public class JiraCsv288Test {
@Test
// Before fix:
// expected: <a,b,c,d,,f,> but was: <a,b,c,d,,f>
- public void testParseWithTwoCharDelimiterEndsWithDelimiter() throws Exception {
+ void testParseWithTwoCharDelimiterEndsWithDelimiter() throws Exception {
final Reader in = new StringReader("a~|b~|c~|d~|~|f~|");
final StringBuilder stringBuilder = new StringBuilder();
try (CSVPrinter csvPrinter = new CSVPrinter(stringBuilder, CSVFormat.EXCEL);
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv290Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv290Test.java
index f9dd6e95..bfc0f1d5 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv290Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv290Test.java
@@ -84,17 +84,17 @@ public class JiraCsv290Test {
}
@Test
- public void testPostgresqlCsv() throws Exception {
+ void testPostgresqlCsv() throws Exception {
testHelper("psql.csv", CSVFormat.POSTGRESQL_CSV);
}
@Test
- public void testPostgresqlText() throws Exception {
+ void testPostgresqlText() throws Exception {
testHelper("psql.tsv", CSVFormat.POSTGRESQL_TEXT);
}
@Test
- public void testWriteThenRead() throws Exception {
+ void testWriteThenRead() throws Exception {
final StringWriter sw = new StringWriter();
final CSVFormat format = CSVFormat.POSTGRESQL_CSV.builder().setHeader().setSkipHeaderRecord(true).get();
try (CSVPrinter printer = new CSVPrinter(sw, format)) {
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv294Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv294Test.java
index 2cc62628..75e26cf6 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv294Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv294Test.java
@@ -58,24 +58,24 @@ public class JiraCsv294Test {
}
@Test
- public void testDefaultCsvFormatWithBackslashEscapeWorks() throws IOException {
+ void testDefaultCsvFormatWithBackslashEscapeWorks() throws IOException {
testInternal(CSVFormat.Builder.create().setEscape('\\').get(), ",\"b \\\"\\\"\",");
}
@Test
- public void testDefaultCsvFormatWithNullEscapeWorks() throws IOException {
+ void testDefaultCsvFormatWithNullEscapeWorks() throws IOException {
testInternal(CSVFormat.Builder.create().setEscape(null).get(), ",\"b \"\"\"\"\",");
}
@Test
- public void testDefaultCsvFormatWithQuoteEscapeWorks() throws IOException {
+ void testDefaultCsvFormatWithQuoteEscapeWorks() throws IOException {
// this one doesn't actually work but should behave like setEscape(null)
// Printer is writing the expected content but Parser is unable to consume it
testInternal(CSVFormat.Builder.create().setEscape('"').get(), ",\"b \"\"\"\"\",");
}
@Test
- public void testDefaultCsvFormatWorks() throws IOException {
+ void testDefaultCsvFormatWorks() throws IOException {
testInternal(CSVFormat.Builder.create().get(), ",\"b \"\"\"\"\",");
}
}
diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv93Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv93Test.java
index e34a8b02..e52739dd 100644
--- a/src/test/java/org/apache/commons/csv/issues/JiraCsv93Test.java
+++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv93Test.java
@@ -61,7 +61,7 @@ public class JiraCsv93Test {
}
@Test
- public void testWithNotSetNullString() throws IOException {
+ void testWithNotSetNullString() throws IOException {
// @formatter:off
every(CSVFormat.DEFAULT,
objects1,
@@ -91,7 +91,7 @@ public class JiraCsv93Test {
}
@Test
- public void testWithSetNullStringEmptyString() throws IOException {
+ void testWithSetNullStringEmptyString() throws IOException {
// @formatter:off
every(CSVFormat.DEFAULT.builder().setNullString("").get(),
objects1,
@@ -121,7 +121,7 @@ public class JiraCsv93Test {
}
@Test
- public void testWithSetNullStringNULL() throws IOException {
+ void testWithSetNullStringNULL() throws IOException {
// @formatter:off
every(CSVFormat.DEFAULT.builder().setNullString("NULL").get(),
objects2,
diff --git a/src/test/java/org/apache/commons/csv/perf/PerformanceTest.java b/src/test/java/org/apache/commons/csv/perf/PerformanceTest.java
index efdb8f04..a7f08102 100644
--- a/src/test/java/org/apache/commons/csv/perf/PerformanceTest.java
+++ b/src/test/java/org/apache/commons/csv/perf/PerformanceTest.java
@@ -110,7 +110,7 @@ public class PerformanceTest {
}
@Test
- public void testParseBigFileRepeat() throws Exception {
+ void testParseBigFileRepeat() throws Exception {
long bestTime = Long.MAX_VALUE;
for (int i = 0; i < this.max; i++) {
bestTime = Math.min(testParseBigFile(false), bestTime);
@@ -119,7 +119,7 @@ public class PerformanceTest {
}
@Test
- public void testReadBigFile() throws Exception {
+ void testReadBigFile() throws Exception {
long bestTime = Long.MAX_VALUE;
long count;
for (int i = 0; i < this.max; i++) {