16
16
* limitations under the License.
17
17
*/
18
18
19
+ import static org .junit .Assert .assertEquals ;
20
+ import static org .junit .Assert .assertFalse ;
21
+ import static org .junit .Assert .assertTrue ;
22
+ import static org .junit .Assert .fail ;
23
+
19
24
import java .io .File ;
20
25
import java .io .IOException ;
21
26
import java .net .URI ;
25
30
import java .util .Arrays ;
26
31
import java .util .List ;
27
32
33
+ import org .junit .Test ;
34
+
28
35
/**
29
36
* Base class for testcases doing tests with files.
30
37
*
@@ -35,6 +42,7 @@ public class DirectoryScannerTest
35
42
{
36
43
private static String testDir = getTestDirectory ().getPath ();
37
44
45
+ @ Test
38
46
public void testCrossPlatformIncludesString ()
39
47
throws IOException , URISyntaxException
40
48
{
@@ -59,6 +67,7 @@ public void testCrossPlatformIncludesString()
59
67
assertEquals ( 1 , files .length );
60
68
}
61
69
70
+ @ Test
62
71
public void testCrossPlatformExcludesString ()
63
72
throws IOException , URISyntaxException
64
73
{
@@ -110,6 +119,7 @@ private void createTestFiles()
110
119
this .createFile ( new File ( testDir + "/scanner5.dat" ), 0 );
111
120
}
112
121
122
+ @ Test
113
123
public void testGeneral ()
114
124
throws IOException
115
125
{
@@ -127,6 +137,7 @@ public void testGeneral()
127
137
128
138
}
129
139
140
+ @ Test
130
141
public void testIncludesExcludesWithWhiteSpaces ()
131
142
throws IOException
132
143
{
@@ -144,6 +155,7 @@ public void testIncludesExcludesWithWhiteSpaces()
144
155
assertTrue ( "5 not found." , fileNames .contains ( new File ( "scanner5.dat" ) ) );
145
156
}
146
157
158
+ @ Test
147
159
public void testFollowSymlinksFalse ()
148
160
{
149
161
DirectoryScanner ds = new DirectoryScanner ();
@@ -175,6 +187,7 @@ private void assertAlwaysIncluded( List<String> included )
175
187
assertTrue ( included .contains ( "symLinkToFileOnTheOutside" ) );
176
188
}
177
189
190
+ @ Test
178
191
public void testFollowSymlinks ()
179
192
{
180
193
DirectoryScanner ds = new DirectoryScanner ();
@@ -211,6 +224,7 @@ private void createTestDirectories()
211
224
+ File .separator + "file1.dat" ), 0 );
212
225
}
213
226
227
+ @ Test
214
228
public void testDirectoriesWithHyphens ()
215
229
throws IOException
216
230
{
@@ -229,6 +243,7 @@ public void testDirectoriesWithHyphens()
229
243
assertEquals ( "Wrong number of results." , 3 , files .length );
230
244
}
231
245
246
+ @ Test
232
247
public void testAntExcludesOverrideIncludes ()
233
248
throws IOException
234
249
{
@@ -263,6 +278,7 @@ public void testAntExcludesOverrideIncludes()
263
278
assertInclusionsAndExclusions ( ds .getIncludedFiles (), excludedPaths , includedPaths );
264
279
}
265
280
281
+ @ Test
266
282
public void testAntExcludesOverrideIncludesWithExplicitAntPrefix ()
267
283
throws IOException
268
284
{
@@ -298,6 +314,7 @@ public void testAntExcludesOverrideIncludesWithExplicitAntPrefix()
298
314
assertInclusionsAndExclusions ( ds .getIncludedFiles (), excludedPaths , includedPaths );
299
315
}
300
316
317
+ @ Test
301
318
public void testRegexIncludeWithExcludedPrefixDirs ()
302
319
throws IOException
303
320
{
@@ -328,6 +345,7 @@ public void testRegexIncludeWithExcludedPrefixDirs()
328
345
assertInclusionsAndExclusions ( ds .getIncludedFiles (), excludedPaths , includedPaths );
329
346
}
330
347
348
+ @ Test
331
349
public void testRegexExcludeWithNegativeLookahead ()
332
350
throws IOException
333
351
{
@@ -366,6 +384,7 @@ public void testRegexExcludeWithNegativeLookahead()
366
384
assertInclusionsAndExclusions ( ds .getIncludedFiles (), excludedPaths , includedPaths );
367
385
}
368
386
387
+ @ Test
369
388
public void testRegexWithSlashInsideCharacterClass ()
370
389
throws IOException
371
390
{
@@ -405,6 +424,7 @@ public void testRegexWithSlashInsideCharacterClass()
405
424
assertInclusionsAndExclusions ( ds .getIncludedFiles (), excludedPaths , includedPaths );
406
425
}
407
426
427
+ @ Test
408
428
public void testIsSymbolicLink ()
409
429
throws IOException
410
430
{
@@ -422,6 +442,7 @@ public void testIsSymbolicLink()
422
442
assertFalse ( ds .isSymbolicLink ( directory , "aRegularDir" ) );
423
443
}
424
444
445
+ @ Test
425
446
public void testIsParentSymbolicLink ()
426
447
throws IOException
427
448
{
0 commit comments