Search in sources :

Example 11 with ExtensionsConfig

use of io.druid.guice.ExtensionsConfig in project druid by druid-io.

the class InitializationTest method testGetHadoopDependencyFilesToLoad_wrong_type_root_hadoop_depenencies_dir.

@Test(expected = ISE.class)
public void testGetHadoopDependencyFilesToLoad_wrong_type_root_hadoop_depenencies_dir() throws IOException {
    final File rootHadoopDependenciesDir = temporaryFolder.newFile();
    final ExtensionsConfig config = new ExtensionsConfig() {

        @Override
        public String getHadoopDependenciesDir() {
            return rootHadoopDependenciesDir.getAbsolutePath();
        }
    };
    Initialization.getHadoopDependencyFilesToLoad(ImmutableList.<String>of(), config);
}
Also used : ExtensionsConfig(io.druid.guice.ExtensionsConfig) File(java.io.File) Test(org.junit.Test)

Example 12 with ExtensionsConfig

use of io.druid.guice.ExtensionsConfig in project druid by druid-io.

the class InitializationTest method testGetExtensionFilesToLoad_non_exist_extensions_dir.

@Test
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 an empty array of File", new File[] {}, Initialization.getExtensionFilesToLoad(new ExtensionsConfig() {

        @Override
        public String getDirectory() {
            return tmpDir.getAbsolutePath();
        }
    }));
}
Also used : ExtensionsConfig(io.druid.guice.ExtensionsConfig) File(java.io.File) Test(org.junit.Test)

Example 13 with ExtensionsConfig

use of io.druid.guice.ExtensionsConfig in project druid by druid-io.

the class InitializationTest method testGetExtensionFilesToLoad_wrong_type_extensions_dir.

@Test(expected = ISE.class)
public void testGetExtensionFilesToLoad_wrong_type_extensions_dir() throws IOException {
    final File extensionsDir = temporaryFolder.newFile();
    final ExtensionsConfig config = new ExtensionsConfig() {

        @Override
        public String getDirectory() {
            return extensionsDir.getAbsolutePath();
        }
    };
    Initialization.getExtensionFilesToLoad(config);
}
Also used : ExtensionsConfig(io.druid.guice.ExtensionsConfig) File(java.io.File) Test(org.junit.Test)

Aggregations

ExtensionsConfig (io.druid.guice.ExtensionsConfig)13 File (java.io.File)11 Test (org.junit.Test)10 Injector (com.google.inject.Injector)1 Module (com.google.inject.Module)1 Cli (io.airlift.airline.Cli)1 Help (io.airlift.airline.Help)1 ParseException (io.airlift.airline.ParseException)1 CuratorModule (io.druid.curator.CuratorModule)1 DiscoveryModule (io.druid.curator.discovery.DiscoveryModule)1 AWSModule (io.druid.guice.AWSModule)1 AnnouncerModule (io.druid.guice.AnnouncerModule)1 CoordinatorDiscoveryModule (io.druid.guice.CoordinatorDiscoveryModule)1 DruidProcessingModule (io.druid.guice.DruidProcessingModule)1 DruidSecondaryModule (io.druid.guice.DruidSecondaryModule)1 FirehoseModule (io.druid.guice.FirehoseModule)1 IndexingServiceDiscoveryModule (io.druid.guice.IndexingServiceDiscoveryModule)1 JacksonConfigManagerModule (io.druid.guice.JacksonConfigManagerModule)1 JavaScriptModule (io.druid.guice.JavaScriptModule)1 LifecycleModule (io.druid.guice.LifecycleModule)1