use of org.talend.hadoop.distribution.DistributionModuleGroup in project tbd-studio-se by Talend.
the class ModuleGroupsUtilsTest method getModuleGroupsTest_withoutAdditionCondition.
@Test
public void getModuleGroupsTest_withoutAdditionCondition() {
String condition = null;
Set<DistributionModuleGroup> groups = ModuleGroupsUtils.getModuleGroups(distribution, version, condition, groupName, true);
assertEquals(groups.size(), 1);
DistributionModuleGroup dmg = groups.iterator().next();
SparkBatchLinkedNodeCondition underlyingCondition = new SparkBatchLinkedNodeCondition(distribution, version);
assertEquals(dmg.getModuleName(), groupName);
// Without an additional condition, the returned module group is actually a SparkBatchLinkedNodeCondition
assertEquals(dmg.getRequiredIf().getConditionString(), underlyingCondition.getCondition().getConditionString());
}
use of org.talend.hadoop.distribution.DistributionModuleGroup in project tbd-studio-se by Talend.
the class EMR5290HCatalogModuleGroupTest method testModuleGroups.
@Test
public void testModuleGroups() throws Exception {
Map<String, String> results = new HashMap<>();
results.put(EMR5290Constant.HDFS_MODULE_GROUP.getModuleName(), null);
Set<DistributionModuleGroup> moduleGroups = EMR5290HCatalogModuleGroup.getModuleGroups();
assertEquals(results.size(), moduleGroups.size());
moduleGroups.iterator();
for (DistributionModuleGroup module : moduleGroups) {
// $NON-NLS-1$
assertTrue("Should contain module " + module.getModuleName(), results.containsKey(module.getModuleName()));
if (results.get(module.getModuleName()) == null) {
assertTrue(// $NON-NLS-1$ //$NON-NLS-2$
"The condition of the module " + module.getModuleName() + " is not null.", results.get(module.getModuleName()) == null);
} else {
assertTrue(// $NON-NLS-1$ //$NON-NLS-2$
"The condition of the module " + module.getModuleName() + " is null, but it should be " + results.get(module.getModuleName()) + ".", // $NON-NLS-1$
results.get(module.getModuleName()) != null);
assertEquals(results.get(module.getModuleName()), module.getRequiredIf().getConditionString());
}
}
}
use of org.talend.hadoop.distribution.DistributionModuleGroup in project tbd-studio-se by Talend.
the class EMR5290HiveModuleGroupTest method testModuleGroups.
@Test
public void testModuleGroups() throws Exception {
Map<String, String> results = new HashMap<>();
results.put(EMR5290Constant.HIVE_MODULE_GROUP.getModuleName(), null);
results.put(EMR5290Constant.HIVE_HBASE_MODULE_GROUP.getModuleName(), null);
results.put(EMR5290Constant.HDFS_MODULE_GROUP.getModuleName(), null);
results.put(EMR5290Constant.MAPREDUCE_MODULE_GROUP.getModuleName(), null);
Set<DistributionModuleGroup> moduleGroups = EMR5290HiveModuleGroup.getModuleGroups();
assertEquals(results.size(), moduleGroups.size());
for (DistributionModuleGroup module : moduleGroups) {
// $NON-NLS-1$
assertTrue("Should contain module " + module.getModuleName(), results.containsKey(module.getModuleName()));
if (results.get(module.getModuleName()) == null) {
assertTrue(// $NON-NLS-1$ //$NON-NLS-2$
"The condition of the module " + module.getModuleName() + " is not null.", results.get(module.getModuleName()) == null);
} else {
assertTrue(// $NON-NLS-1$ //$NON-NLS-2$
"The condition of the module " + module.getModuleName() + " is null, but it should be " + results.get(module.getModuleName()) + ".", // $NON-NLS-1$
results.get(module.getModuleName()) != null);
assertEquals(results.get(module.getModuleName()), module.getRequiredIf().getConditionString());
}
}
}
use of org.talend.hadoop.distribution.DistributionModuleGroup in project tbd-studio-se by Talend.
the class EMR5290WebHDFSModuleGroupTest method testModuleGroups.
@Test
public void testModuleGroups() throws Exception {
Map<String, String> results = new HashMap<>();
results.put(EMR5290Constant.WEBHDFS_MODULE_GROUP.getModuleName(), null);
Set<DistributionModuleGroup> moduleGroups = EMR5290WebHDFSModuleGroup.getModuleGroups(EMR5290Distribution.DISTRIBUTION_NAME, EMR5290Distribution.VERSION);
assertEquals(results.size(), moduleGroups.size());
moduleGroups.iterator();
for (DistributionModuleGroup module : moduleGroups) {
// $NON-NLS-1$
assertTrue("Should contain module " + module.getModuleName(), results.containsKey(module.getModuleName()));
if (results.get(module.getModuleName()) == null) {
assertTrue(// $NON-NLS-1$ //$NON-NLS-2$
"The condition of the module " + module.getModuleName() + " is not null.", results.get(module.getModuleName()) == null);
} else {
assertTrue(// $NON-NLS-1$ //$NON-NLS-2$
"The condition of the module " + module.getModuleName() + " is null, but it should be " + results.get(module.getModuleName()) + ".", // $NON-NLS-1$
results.get(module.getModuleName()) != null);
assertEquals(results.get(module.getModuleName()), module.getRequiredIf().getConditionString());
}
}
}
use of org.talend.hadoop.distribution.DistributionModuleGroup in project tbd-studio-se by Talend.
the class EMR5290SparkBatchGraphFramesNodeModuleGroupTest method testModuleGroups.
@Test
public void testModuleGroups() throws Exception {
Map<String, String> results = new HashMap<>();
results.put(EMR5290Constant.SPARK_PARQUET_MRREQUIRED_MODULE_GROUP.getModuleName(), // $NON-NLS-1$
"((#LINK@NODE.SPARK_CONFIGURATION.DISTRIBUTION=='AMAZON_EMR') AND (#LINK@NODE.SPARK_CONFIGURATION.SPARK_VERSION=='EMR_5_29_0')) AND (#LINK@NODE.SPARK_CONFIGURATION.SPARK_LOCAL_MODE=='false')");
Set<DistributionModuleGroup> moduleGroups = EMR5290GraphFramesNodeModuleGroup.getModuleGroups(EMR5290Distribution.DISTRIBUTION_NAME, EMR5290Distribution.VERSION);
assertEquals(results.size(), moduleGroups.size());
for (DistributionModuleGroup module : moduleGroups) {
// $NON-NLS-1$
assertTrue("Should contain module " + module.getModuleName(), results.containsKey(module.getModuleName()));
if (results.get(module.getModuleName()) == null) {
assertTrue(// $NON-NLS-1$ //$NON-NLS-2$
"The condition of the module " + module.getModuleName() + " is not null.", results.get(module.getModuleName()) == null);
} else {
assertTrue(// $NON-NLS-1$ //$NON-NLS-2$
"The condition of the module " + module.getModuleName() + " is null, but it should be " + results.get(module.getModuleName()) + ".", // $NON-NLS-1$
results.get(module.getModuleName()) != null);
assertEquals(results.get(module.getModuleName()), module.getRequiredIf().getConditionString());
}
}
}
Aggregations