1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.vfs2;
18
19 import static org.junit.jupiter.api.Assertions.assertEquals;
20
21 import org.junit.jupiter.api.AfterAll;
22 import org.junit.jupiter.api.BeforeAll;
23 import org.junit.jupiter.api.Test;
24
25 public class InvertIncludeFileSelectorTest {
26
27 @BeforeAll
28 public static void setUpClass() throws Exception {
29 PatternFileSelectorTest.setUpClass();
30 }
31
32 @AfterAll
33 public static void tearDownClass() throws Exception {
34 PatternFileSelectorTest.tearDownClass();
35 }
36
37 @Test
38 public void testInvertMatchAll() throws Exception {
39 final FileObject[] list = PatternFileSelectorTest.getBaseFolder()
40 .findFiles(new InvertIncludeFileSelector(new PatternFileSelector(".*")));
41 assertEquals(0, list.length);
42 }
43
44 @Test
45 public void testInvertMatchSome() throws Exception {
46 final FileObject[] list = PatternFileSelectorTest.getBaseFolder()
47 .findFiles(new InvertIncludeFileSelector(new PatternFileSelector(".*\\.html")));
48 assertEquals(7, list.length);
49 }
50
51 }