1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.commons.csv;
21
22 import static org.junit.jupiter.api.Assertions.assertEquals;
23
24 import org.junit.jupiter.api.Test;
25
26
27
28
29 class CSVFormatPredefinedTest {
30
31 private void test(final CSVFormat format, final String enumName) {
32 assertEquals(format, CSVFormat.Predefined.valueOf(enumName).getFormat());
33 assertEquals(format, CSVFormat.valueOf(enumName));
34 }
35
36 @Test
37 void testDefault() {
38 test(CSVFormat.DEFAULT, "Default");
39 }
40
41 @Test
42 void testExcel() {
43 test(CSVFormat.EXCEL, "Excel");
44 }
45
46 @Test
47 void testMongoDbCsv() {
48 test(CSVFormat.MONGODB_CSV, "MongoDBCsv");
49 }
50
51 @Test
52 void testMongoDbTsv() {
53 test(CSVFormat.MONGODB_TSV, "MongoDBTsv");
54 }
55
56 @Test
57 void testMySQL() {
58 test(CSVFormat.MYSQL, "MySQL");
59 }
60
61 @Test
62 void testOracle() {
63 test(CSVFormat.ORACLE, "Oracle");
64 }
65
66 @Test
67 void testPostgreSqlCsv() {
68 test(CSVFormat.POSTGRESQL_CSV, "PostgreSQLCsv");
69 }
70
71 @Test
72 void testPostgreSqlText() {
73 test(CSVFormat.POSTGRESQL_TEXT, "PostgreSQLText");
74 }
75
76 @Test
77 void testRFC4180() {
78 test(CSVFormat.RFC4180, "RFC4180");
79 }
80
81 @Test
82 void testTDF() {
83 test(CSVFormat.TDF, "TDF");
84 }
85 }