Search in sources :

Example 21 with IDynamicConfiguration

use of org.talend.core.runtime.dynamic.IDynamicConfiguration 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

IDynamicConfiguration (org.talend.core.runtime.dynamic.IDynamicConfiguration)21 IDynamicExtension (org.talend.core.runtime.dynamic.IDynamicExtension)7 ArrayList (java.util.ArrayList)6 DynamicConfiguration (org.talend.hadoop.distribution.dynamic.DynamicConfiguration)5 HashSet (java.util.HashSet)4 MavenArtifact (org.talend.core.runtime.maven.MavenArtifact)4 DynamicPluginAdapter (org.talend.hadoop.distribution.dynamic.adapter.DynamicPluginAdapter)4 TemplateBean (org.talend.hadoop.distribution.dynamic.bean.TemplateBean)4 DynamicAttributeComparator (org.talend.hadoop.distribution.dynamic.comparator.DynamicAttributeComparator)4 DynamicModuleGroupData (org.talend.repository.hadoopcluster.ui.dynamic.DynamicModuleGroupData)4 List (java.util.List)3 ModuleNeeded (org.talend.core.model.general.ModuleNeeded)3 HashMap (java.util.HashMap)2 DependencyNode (org.talend.designer.maven.aether.node.DependencyNode)2 ESparkVersion (org.talend.hadoop.distribution.ESparkVersion)2 ModuleBean (org.talend.hadoop.distribution.dynamic.bean.ModuleBean)2 FileNotFoundException (java.io.FileNotFoundException)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 Test (org.junit.Test)1 ExclusionNode (org.talend.designer.maven.aether.node.ExclusionNode)1