mirror of https://github.com/apache/nifi.git
NIFI-3454: Use FileNameFilter to make test consistent
use the FileNameFilter when not passing down explit jar paths Filter out ^. files when reading lists of files from directories Signed-off-by: Koji Kawamura <ijokarumawak@apache.org>
This commit is contained in:
parent
e4b74b3d71
commit
5cfba6ace3
|
@ -86,7 +86,7 @@ public class TestClassLoaderUtils {
|
||||||
@Test
|
@Test
|
||||||
public void testGetURLsForClasspathWithDirectory() throws MalformedURLException {
|
public void testGetURLsForClasspathWithDirectory() throws MalformedURLException {
|
||||||
final String jarFilePath = "src/test/resources/TestClassLoaderUtils";
|
final String jarFilePath = "src/test/resources/TestClassLoaderUtils";
|
||||||
URL[] urls = ClassLoaderUtils.getURLsForClasspath(jarFilePath, null, false);
|
URL[] urls = ClassLoaderUtils.getURLsForClasspath(jarFilePath, getJarFilenameFilter(), false);
|
||||||
assertEquals(2, urls.length);
|
assertEquals(2, urls.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class TestIdentifyMimeType {
|
||||||
final TestRunner runner = TestRunners.newTestRunner(new IdentifyMimeType());
|
final TestRunner runner = TestRunners.newTestRunner(new IdentifyMimeType());
|
||||||
|
|
||||||
final File dir = new File("src/test/resources/TestIdentifyMimeType");
|
final File dir = new File("src/test/resources/TestIdentifyMimeType");
|
||||||
final File[] files = dir.listFiles();
|
final File[] files = dir.listFiles((ldir,name)-> name != null && !name.startsWith("."));
|
||||||
int fileCount = 0;
|
int fileCount = 0;
|
||||||
for (final File file : files) {
|
for (final File file : files) {
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
|
|
Loading…
Reference in New Issue