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