From 5bc6d61a25a71edf8f1a1ba9e730ab5e94c67d43 Mon Sep 17 00:00:00 2001 From: Charles Allen Date: Tue, 8 Dec 2015 17:37:56 -0800 Subject: [PATCH] Fix InitializationTest --- .../druid/initialization/InitializationTest.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/server/src/test/java/io/druid/initialization/InitializationTest.java b/server/src/test/java/io/druid/initialization/InitializationTest.java index 1c83987a432..e154d6caf2c 100644 --- a/server/src/test/java/io/druid/initialization/InitializationTest.java +++ b/server/src/test/java/io/druid/initialization/InitializationTest.java @@ -187,12 +187,20 @@ public class InitializationTest } @Test - public void testGetExtensionFilesToLoad_non_exist_extensions_dir() + public void testGetExtensionFilesToLoad_non_exist_extensions_dir() throws IOException { + final File tmpDir = temporaryFolder.newFolder(); + Assert.assertTrue("could not create missing folder", !tmpDir.exists() || tmpDir.delete()); Assert.assertArrayEquals( "Non-exist root extensionsDir should return emply array of File", new File[]{}, - Initialization.getExtensionFilesToLoad(new ExtensionsConfig()) + Initialization.getExtensionFilesToLoad(new ExtensionsConfig(){ + @Override + public String getDirectory() + { + return tmpDir.getAbsolutePath(); + } + }) ); } @@ -227,7 +235,7 @@ public class InitializationTest Assert.assertArrayEquals( "Empty root extensionsDir should return emply array of File", new File[]{}, - Initialization.getExtensionFilesToLoad(new ExtensionsConfig()) + Initialization.getExtensionFilesToLoad(config) ); }