From 5cfba6ace324d3537bf70f5c76f883f380503a10 Mon Sep 17 00:00:00 2001 From: Otto Fowler Date: Thu, 9 Feb 2017 17:12:35 -0500 Subject: [PATCH] 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 --- .../apache/nifi/util/file/classloader/TestClassLoaderUtils.java | 2 +- .../apache/nifi/processors/standard/TestIdentifyMimeType.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/util/file/classloader/TestClassLoaderUtils.java b/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/util/file/classloader/TestClassLoaderUtils.java index ba85e07124..6ad3e89a64 100644 --- a/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/util/file/classloader/TestClassLoaderUtils.java +++ b/nifi-commons/nifi-utils/src/test/java/org/apache/nifi/util/file/classloader/TestClassLoaderUtils.java @@ -86,7 +86,7 @@ public class TestClassLoaderUtils { @Test public void testGetURLsForClasspathWithDirectory() throws MalformedURLException { 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); } diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestIdentifyMimeType.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestIdentifyMimeType.java index 871d0f6673..3465b891ac 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestIdentifyMimeType.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestIdentifyMimeType.java @@ -38,7 +38,7 @@ public class TestIdentifyMimeType { final TestRunner runner = TestRunners.newTestRunner(new IdentifyMimeType()); 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; for (final File file : files) { if (file.isDirectory()) {