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:
Otto Fowler 2017-02-09 17:12:35 -05:00 committed by Koji Kawamura
parent e4b74b3d71
commit 5cfba6ace3
2 changed files with 2 additions and 2 deletions

View File

@ -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);
} }

View File

@ -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()) {