View Javadoc
1   package edu.jiangxin.apktoolbox.utils;
2   
3   import org.junit.jupiter.api.Test;
4   
5   import java.io.File;
6   import java.util.Collection;
7   
8   import static org.junit.jupiter.api.Assertions.assertEquals;
9   
10  /**
11   * @author jiangxin
12   * @author 2018-09-09
13   *
14   */
15  public class FileUtilsTest {
16  
17      Collection<File> fileList = null;
18      String dirPath = "target/test-classes/FileUtilsTest";
19  
20      @Test
21      public void testListFiles01() {
22          fileList = FileUtils.listFiles(new File(dirPath), new String[]{"java"}, true);
23          assertEquals(4, fileList.size());
24      }
25  
26      @Test
27      public void tesListFiles02() {
28          fileList = FileUtils.listFiles(new File(dirPath), new String[]{"cpp"}, true);
29          assertEquals(2, fileList.size());
30      }
31  }