Search in sources :

Example 6 with DynamicDistributionManager

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);
}
Also used : IDynamicConfiguration(org.talend.core.runtime.dynamic.IDynamicConfiguration) IDynamicConfiguration(org.talend.core.runtime.dynamic.IDynamicConfiguration) DynamicConfiguration(org.talend.hadoop.distribution.dynamic.DynamicConfiguration) DynamicDistributionManager(org.talend.hadoop.distribution.dynamic.DynamicDistributionManager) ModuleBean(org.talend.hadoop.distribution.dynamic.bean.ModuleBean) TemplateBean(org.talend.hadoop.distribution.dynamic.bean.TemplateBean) IDependencyResolver(org.talend.hadoop.distribution.dynamic.resolver.IDependencyResolver) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

DynamicDistributionManager (org.talend.hadoop.distribution.dynamic.DynamicDistributionManager)6 DynamicConfiguration (org.talend.hadoop.distribution.dynamic.DynamicConfiguration)4 Test (org.junit.Test)3 IDynamicPluginConfiguration (org.talend.core.runtime.dynamic.IDynamicPluginConfiguration)2 TemplateBean (org.talend.hadoop.distribution.dynamic.bean.TemplateBean)2 IDependencyResolver (org.talend.hadoop.distribution.dynamic.resolver.IDependencyResolver)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 LoginException (org.talend.commons.exception.LoginException)1 PersistenceException (org.talend.commons.exception.PersistenceException)1 IDynamicConfiguration (org.talend.core.runtime.dynamic.IDynamicConfiguration)1 IDynamicExtension (org.talend.core.runtime.dynamic.IDynamicExtension)1 IDynamicPlugin (org.talend.core.runtime.dynamic.IDynamicPlugin)1 DummyDynamicMonitor (org.talend.designer.maven.aether.DummyDynamicMonitor)1 IDynamicMonitor (org.talend.designer.maven.aether.IDynamicMonitor)1 IDynamicDistributionsGroup (org.talend.hadoop.distribution.dynamic.IDynamicDistributionsGroup)1