-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileUtilsDemoTest.java
More file actions
62 lines (55 loc) · 1.33 KB
/
FileUtilsDemoTest.java
File metadata and controls
62 lines (55 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com;
import file.FileUtilsDemo;
import org.junit.Test;
import org.junit.Before;
import org.junit.After;
import java.util.ArrayList;
import java.util.List;
/**
* FileUtilsDemo Tester.
*
* @author <Authors name>
* @since <pre>02/06/2018</pre>
* @version 1.0
*/
public class FileUtilsDemoTest {
private String fileName;
private String encoding;
private List<String> lineList;
@Before
public void before() throws Exception {
fileName="E:\\java编程\\IO文件.txt";
encoding="UTF-8";
lineList =new ArrayList<String>();
lineList.add("\n欢迎访问:");
lineList.add("github.com");
}
@After
public void after() throws Exception {
}
/**
*
* Method: readFile(String fileName)
*
*/
@Test
public void testReadFile() throws Exception {
//TODO: Test goes here...
FileUtilsDemo.readFile(fileName,encoding);
}
@Test
public void testReadFileByLine() throws Exception {
//TODO: Test goes here...
FileUtilsDemo.readFileByLine(fileName,encoding);
}
@Test
public void testWriteFile() throws Exception {
//TODO: Test goes here...
FileUtilsDemo.writeFile(fileName,"test3",encoding);
}
@Test
public void testWriteFileByLines() throws Exception {
//TODO: Test goes here...
FileUtilsDemo.writeFileByLines(fileName, lineList);
}
}