@@ -27,15 +27,19 @@ public class EncryptDataTest {
27
27
private static final String PASSWORD = "123456" ;
28
28
private static File file07 ;
29
29
private static File file03 ;
30
+ private static File fileCsv ;
30
31
private static File file07OutputStream ;
31
32
private static File file03OutputStream ;
33
+ private static File fileCsvOutputStream ;
32
34
33
35
@ BeforeAll
34
36
public static void init () {
35
37
file07 = TestFileUtil .createNewFile ("encrypt07.xlsx" );
36
38
file03 = TestFileUtil .createNewFile ("encrypt03.xls" );
39
+ fileCsv = TestFileUtil .createNewFile ("encryptCsv.csv" );
37
40
file07OutputStream = TestFileUtil .createNewFile ("encryptOutputStream07.xlsx" );
38
41
file03OutputStream = TestFileUtil .createNewFile ("encryptOutputStream03.xls" );
42
+ fileCsvOutputStream = TestFileUtil .createNewFile ("encryptOutputStreamCsv.csv" );
39
43
}
40
44
41
45
@ Test
@@ -64,6 +68,19 @@ public void t02ReadAndWrite03() throws Exception {
64
68
readAndWrite (file03OutputStream , ExcelTypeEnum .XLSX , true , true );
65
69
}
66
70
71
+ @ Test
72
+ public void t03ReadAndWriteCSV () throws Exception {
73
+ readAndWrite (fileCsv , null , false , false );
74
+ readAndWrite (fileCsv , null , true , false );
75
+ readAndWrite (fileCsv , ExcelTypeEnum .CSV , false , false );
76
+ readAndWrite (fileCsv , ExcelTypeEnum .CSV , true , false );
77
+
78
+ readAndWrite (fileCsvOutputStream , null , false , true );
79
+ readAndWrite (fileCsvOutputStream , null , true , true );
80
+ readAndWrite (fileCsvOutputStream , ExcelTypeEnum .CSV , false , true );
81
+ readAndWrite (fileCsvOutputStream , ExcelTypeEnum .CSV , true , true );
82
+ }
83
+
67
84
private void readAndWrite (File file , ExcelTypeEnum excelType , boolean hasPassword , boolean isStream )
68
85
throws Exception {
69
86
log .info ("file:{}, isStream:{}, excelType:{}, hasPassword:{}" , file .getName (), isStream , excelType , hasPassword );
0 commit comments