use of org.talend.hadoop.distribution.dynamic.DynamicDistributionManager in project tbd-studio-se by Talend.
the class DynamicModuleAdapterTest method testAdapt.
@Test
public void testAdapt() throws Exception {
TemplateBean templateBean = new TemplateBean();
// $NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
ModuleBean moduleBean = new ModuleBean(ModuleBean.TYPE_BASE, "org.apache.hive", "hive-jdbc", "2.1.0.2.6.5.5000-33");
DynamicDistributionManager dynamicDistributionManager = DynamicDistributionManager.getInstance();
DynamicConfiguration configuration = new DynamicConfiguration();
// $NON-NLS-1$
configuration.setDistribution("HORTONWORKS");
// $NON-NLS-1$
configuration.setVersion("2.6.5.5000-33");
IDependencyResolver dependencyResolver = dynamicDistributionManager.getDependencyResolver(configuration);
Set<String> registeredModules = new HashSet<String>();
DynamicModuleAdapter dynamicModuleAdapter = new DynamicModuleAdapter(templateBean, configuration, moduleBean, dependencyResolver, registeredModules);
List<IDynamicConfiguration> librariesNeeded = dynamicModuleAdapter.adapt(null, false);
librariesNeeded.stream().forEach(l -> System.out.println(l.toString()));
Assert.assertTrue(librariesNeeded.size() > 1);
}
Aggregations