Skip to content

Commit d047f83

Browse files
committed
[CSV-248] CSVRecord is not Serializable.
Sort members.
1 parent d6778b7 commit d047f83

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ private enum EnumFixture {
4141
UNKNOWN_COLUMN
4242
}
4343

44-
private String[] values;
45-
private CSVRecord record, recordWithHeader;
4644
private Map<String, Integer> headerMap;
45+
private CSVRecord record, recordWithHeader;
46+
private String[] values;
4747

4848
@BeforeEach
4949
public void setUp() throws Exception {
@@ -133,13 +133,6 @@ public void testIsMapped() {
133133
assertFalse(recordWithHeader.isMapped("fourth"));
134134
}
135135

136-
@Test
137-
public void testIsSetString() {
138-
assertFalse(record.isSet("first"));
139-
assertTrue(recordWithHeader.isSet("first"));
140-
assertFalse(recordWithHeader.isSet("fourth"));
141-
}
142-
143136
@Test
144137
public void testIsSetInt() {
145138
assertFalse(record.isSet(-1));
@@ -150,6 +143,13 @@ public void testIsSetInt() {
150143
assertFalse(recordWithHeader.isSet(1000));
151144
}
152145

146+
@Test
147+
public void testIsSetString() {
148+
assertFalse(record.isSet("first"));
149+
assertTrue(recordWithHeader.isSet("first"));
150+
assertFalse(recordWithHeader.isSet("fourth"));
151+
}
152+
153153
@Test
154154
public void testIterator() {
155155
int i = 0;
@@ -190,14 +190,6 @@ public void testToMap() {
190190
this.validateMap(map, true);
191191
}
192192

193-
@Test
194-
public void testToMapWithShortRecord() throws Exception {
195-
try (final CSVParser parser = CSVParser.parse("a,b", CSVFormat.DEFAULT.withHeader("A", "B", "C"))) {
196-
final CSVRecord shortRec = parser.iterator().next();
197-
shortRec.toMap();
198-
}
199-
}
200-
201193
@Test
202194
public void testToMapWithNoHeader() throws Exception {
203195
try (final CSVParser parser = CSVParser.parse("a,b", CSVFormat.newFormat(','))) {
@@ -208,6 +200,14 @@ public void testToMapWithNoHeader() throws Exception {
208200
}
209201
}
210202

203+
@Test
204+
public void testToMapWithShortRecord() throws Exception {
205+
try (final CSVParser parser = CSVParser.parse("a,b", CSVFormat.DEFAULT.withHeader("A", "B", "C"))) {
206+
final CSVRecord shortRec = parser.iterator().next();
207+
shortRec.toMap();
208+
}
209+
}
210+
211211
private void validateMap(final Map<String, String> map, final boolean allowsNulls) {
212212
assertTrue(map.containsKey("first"));
213213
assertTrue(map.containsKey("second"));

0 commit comments

Comments
 (0)