Skip to content

Commit 46f9211

Browse files
committed
Sort members.
1 parent d7b1574 commit 46f9211

14 files changed

Lines changed: 398 additions & 398 deletions

src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,6 @@ int lookAhead() throws IOException {
122122
return c;
123123
}
124124

125-
/**
126-
* Returns the next n characters in the current reader without consuming them. The next call to {@link #read()} will still return the next value. This
127-
* doesn't affect line number or last character.
128-
*
129-
* @param n the number characters look ahead.
130-
* @return the next n characters.
131-
* @throws IOException If an I/O error occurs
132-
*/
133-
char[] lookAhead(final int n) throws IOException {
134-
final char[] buf = new char[n];
135-
return lookAhead(buf);
136-
}
137-
138125
/**
139126
* Populates the buffer with the next {@code buf.length} characters in the
140127
* current reader without consuming them. The next call to {@link #read()} will
@@ -154,6 +141,19 @@ char[] lookAhead(final char[] buf) throws IOException {
154141
return buf;
155142
}
156143

144+
/**
145+
* Returns the next n characters in the current reader without consuming them. The next call to {@link #read()} will still return the next value. This
146+
* doesn't affect line number or last character.
147+
*
148+
* @param n the number characters look ahead.
149+
* @return the next n characters.
150+
* @throws IOException If an I/O error occurs
151+
*/
152+
char[] lookAhead(final int n) throws IOException {
153+
final char[] buf = new char[n];
154+
return lookAhead(buf);
155+
}
156+
157157
@Override
158158
public int read() throws IOException {
159159
final int current = super.read();

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ public class CSVFileParserTest {
4242

4343
private static final File BASE_DIR = new File("src/test/resources/org/apache/commons/csv/CSVFileParser");
4444

45+
public static Stream<File> generateData() {
46+
final File[] files = BASE_DIR.listFiles((dir, name) -> name.startsWith("test") && name.endsWith(".txt"));
47+
return files != null ? Stream.of(files) : Stream.empty();
48+
}
49+
4550
private String readTestData(final BufferedReader reader) throws IOException {
4651
String line;
4752
do {
@@ -50,11 +55,6 @@ private String readTestData(final BufferedReader reader) throws IOException {
5055
return line;
5156
}
5257

53-
public static Stream<File> generateData() {
54-
final File[] files = BASE_DIR.listFiles((dir, name) -> name.startsWith("test") && name.endsWith(".txt"));
55-
return files != null ? Stream.of(files) : Stream.empty();
56-
}
57-
5858
@ParameterizedTest
5959
@MethodSource("generateData")
6060
public void testCSVFile(final File testFile) throws Exception {

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,28 @@ public void testExcel() {
4242
}
4343

4444
@Test
45-
public void testMySQL() {
46-
test(CSVFormat.MYSQL, "MySQL");
45+
public void testMongoDbCsv() {
46+
test(CSVFormat.MONGODB_CSV, "MongoDBCsv");
4747
}
4848

4949
@Test
50-
public void testOracle() {
51-
test(CSVFormat.ORACLE, "Oracle");
50+
public void testMongoDbTsv() {
51+
test(CSVFormat.MONGODB_TSV, "MongoDBTsv");
5252
}
5353

5454
@Test
55-
public void testPostgreSqlCsv() {
56-
test(CSVFormat.POSTGRESQL_CSV, "PostgreSQLCsv");
55+
public void testMySQL() {
56+
test(CSVFormat.MYSQL, "MySQL");
5757
}
5858

5959
@Test
60-
public void testMongoDbCsv() {
61-
test(CSVFormat.MONGODB_CSV, "MongoDBCsv");
60+
public void testOracle() {
61+
test(CSVFormat.ORACLE, "Oracle");
6262
}
6363

6464
@Test
65-
public void testMongoDbTsv() {
66-
test(CSVFormat.MONGODB_TSV, "MongoDBTsv");
65+
public void testPostgreSqlCsv() {
66+
test(CSVFormat.POSTGRESQL_CSV, "PostgreSQLCsv");
6767
}
6868

6969
@Test

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,15 @@ public void testSerialization() throws IOException, ClassNotFoundException {
264264
}
265265
}
266266

267+
@Test
268+
public void testStream() {
269+
final AtomicInteger i = new AtomicInteger();
270+
record.stream().forEach(value -> {
271+
assertEquals(values[i.get()], value);
272+
i.incrementAndGet();
273+
});
274+
}
275+
267276
@Test
268277
public void testToList() {
269278
int i = 0;
@@ -297,15 +306,6 @@ public void testToMapWithShortRecord() throws Exception {
297306
}
298307
}
299308

300-
@Test
301-
public void testStream() {
302-
final AtomicInteger i = new AtomicInteger();
303-
record.stream().forEach(value -> {
304-
assertEquals(values[i.get()], value);
305-
i.incrementAndGet();
306-
});
307-
}
308-
309309
@Test
310310
public void testToString() {
311311
assertNotNull(recordWithHeader.toString());

0 commit comments

Comments
 (0)