Skip to content

Commit 666350b

Browse files
committed
Sort members.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1509442 13f79535-47bb-0310-9956-ffa450edef68
1 parent 50b7f79 commit 666350b

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,22 @@ public class CSVRecordBooleanTest {
2626

2727
private CSVRecord record;
2828

29+
/**
30+
* @return
31+
* @throws IOException
32+
*/
33+
private CSVRecord createTestRecord() throws IOException {
34+
String csv = "A,B,C,D\ntrue, TRUE, false, foo";
35+
CSVRecord record = CSVParser.parseString(csv, CSVFormat.DEFAULT.withHeader().withIgnoreSurroundingSpaces(true))
36+
.iterator().next();
37+
return record;
38+
}
39+
2940
@Before
3041
public void setUp() throws IOException {
3142
this.record = createTestRecord();
3243
}
3344

34-
@Test
35-
public void testGetBooleanByString() {
36-
Assert.assertEquals(Boolean.TRUE, Boolean.valueOf(record.getBoolean("A")));
37-
Assert.assertEquals(Boolean.TRUE, Boolean.valueOf(record.getBoolean("B")));
38-
Assert.assertEquals(Boolean.FALSE, Boolean.valueOf(record.getBoolean("C")));
39-
Assert.assertEquals(Boolean.FALSE, Boolean.valueOf(record.getBoolean("D")));
40-
}
41-
4245
@Test(expected = IllegalArgumentException.class)
4346
public void testGetBooleanByMissingString() {
4447
Assert.assertEquals(null, Boolean.valueOf(record.getBoolean("ABSENT")));
@@ -49,15 +52,12 @@ public void testGetBooleanByNullString() {
4952
Assert.assertEquals(null, Boolean.valueOf(record.getBoolean(null)));
5053
}
5154

52-
/**
53-
* @return
54-
* @throws IOException
55-
*/
56-
private CSVRecord createTestRecord() throws IOException {
57-
String csv = "A,B,C,D\ntrue, TRUE, false, foo";
58-
CSVRecord record = CSVParser.parseString(csv, CSVFormat.DEFAULT.withHeader().withIgnoreSurroundingSpaces(true))
59-
.iterator().next();
60-
return record;
55+
@Test
56+
public void testGetBooleanByString() {
57+
Assert.assertEquals(Boolean.TRUE, Boolean.valueOf(record.getBoolean("A")));
58+
Assert.assertEquals(Boolean.TRUE, Boolean.valueOf(record.getBoolean("B")));
59+
Assert.assertEquals(Boolean.FALSE, Boolean.valueOf(record.getBoolean("C")));
60+
Assert.assertEquals(Boolean.FALSE, Boolean.valueOf(record.getBoolean("D")));
6161
}
6262

6363
}

0 commit comments

Comments
 (0)