use of org.apache.druid.guice.ExtensionsConfig in project druid by druid-io.
the class InitializationTest method testGetExtensionFilesToLoad_null_load_list.
/**
* If druid.extension.load is not specified, Initialization.getExtensionFilesToLoad is supposed to return all the
* extension folders under root extensions directory.
*/
@Test
public void testGetExtensionFilesToLoad_null_load_list() throws IOException {
final File extensionsDir = temporaryFolder.newFolder();
final ExtensionsConfig config = new ExtensionsConfig() {
@Override
public String getDirectory() {
return extensionsDir.getAbsolutePath();
}
};
final File mysql_metadata_storage = new File(extensionsDir, "mysql-metadata-storage");
mysql_metadata_storage.mkdir();
final File[] expectedFileList = new File[] { mysql_metadata_storage };
final File[] actualFileList = Initialization.getExtensionFilesToLoad(config);
Arrays.sort(actualFileList);
Assert.assertArrayEquals(expectedFileList, actualFileList);
}
use of org.apache.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.of(), config);
}
use of org.apache.druid.guice.ExtensionsConfig in project druid by druid-io.
the class InitializationTest method testGetHadoopDependencyFilesToLoad_non_exist_version_dir.
@Test(expected = ISE.class)
public void testGetHadoopDependencyFilesToLoad_non_exist_version_dir() throws IOException {
final File rootHadoopDependenciesDir = temporaryFolder.newFolder();
final ExtensionsConfig config = new ExtensionsConfig() {
@Override
public String getHadoopDependenciesDir() {
return rootHadoopDependenciesDir.getAbsolutePath();
}
};
final File hadoopClient = new File(rootHadoopDependenciesDir, "hadoop-client");
hadoopClient.mkdir();
Initialization.getHadoopDependencyFilesToLoad(ImmutableList.of("org.apache.hadoop:hadoop-client:2.3.0"), config);
}
use of org.apache.druid.guice.ExtensionsConfig in project druid by druid-io.
the class InitializationTest method testGetHadoopDependencyFilesToLoad_with_hadoop_coordinates.
@Test
public void testGetHadoopDependencyFilesToLoad_with_hadoop_coordinates() throws IOException {
final File rootHadoopDependenciesDir = temporaryFolder.newFolder();
final ExtensionsConfig config = new ExtensionsConfig() {
@Override
public String getHadoopDependenciesDir() {
return rootHadoopDependenciesDir.getAbsolutePath();
}
};
final File hadoopClient = new File(rootHadoopDependenciesDir, "hadoop-client");
final File versionDir = new File(hadoopClient, "2.3.0");
hadoopClient.mkdir();
versionDir.mkdir();
final File[] expectedFileList = new File[] { versionDir };
final File[] actualFileList = Initialization.getHadoopDependencyFilesToLoad(ImmutableList.of("org.apache.hadoop:hadoop-client:2.3.0"), config);
Assert.assertArrayEquals(expectedFileList, actualFileList);
}
use of org.apache.druid.guice.ExtensionsConfig in project druid by druid-io.
the class InitializationTest method testGetExtensionFilesToLoad_empty_extensions_dir.
@Test
public void testGetExtensionFilesToLoad_empty_extensions_dir() throws IOException {
final File extensionsDir = temporaryFolder.newFolder();
final ExtensionsConfig config = new ExtensionsConfig() {
@Override
public String getDirectory() {
return extensionsDir.getAbsolutePath();
}
};
Assert.assertArrayEquals("Empty root extensionsDir should return an empty array of File", new File[] {}, Initialization.getExtensionFilesToLoad(config));
}
Aggregations