use of org.talend.hadoop.distribution.DistributionModuleGroup in project tbd-studio-se by Talend.
the class DBR550SparkBatchModuleGroupTest method testModuleGroups.
@Test
public void testModuleGroups() throws Exception {
Map<String, String> results = new HashMap<>();
// $NON-NLS-1$
results.put(DBR550Constant.SPARK_MRREQUIRED_MODULE_GROUP.getModuleName(), null);
// $NON-NLS-1$
results.put(DBR550Constant.BIGDATALAUNCHER_MODULE_GROUP.getModuleName(), null);
// $NON-NLS-1$
results.put(DBR550Constant.SPARK_HIVE_MRREQUIRED_MODULE_GROUP.getModuleName(), null);
Set<DistributionModuleGroup> moduleGroups = DBR550SparkBatchModuleGroup.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 Spark31xNodeModuleGroup method getModuleGroup.
public static Set<DistributionModuleGroup> getModuleGroup(String moduleGroupName, String sparkConfigLinkedParameter, ESparkVersion sparkVersion) {
Set<DistributionModuleGroup> hs = new HashSet<>();
DistributionModuleGroup dmg = new DistributionModuleGroup(moduleGroupName, true, spark311Condition(sparkConfigLinkedParameter, sparkVersion));
hs.add(dmg);
return hs;
}
use of org.talend.hadoop.distribution.DistributionModuleGroup in project tbd-studio-se by Talend.
the class DBR640SparkBatchModuleGroupTest method testModuleGroups.
@Test
public void testModuleGroups() throws Exception {
Map<String, String> results = new HashMap<>();
// $NON-NLS-1$
results.put(DBR640Constant.SPARK_LIB_MRREQUIRED_DBR640.getModuleName(), null);
// $NON-NLS-1$
results.put(DBR640Constant.BIGDATA_LAUNCHER_LIB_DBR640.getModuleName(), null);
// $NON-NLS-1$
results.put(DBR640Constant.HIVEONSPARK_LIB_MRREQUIRED_DBR640.getModuleName(), null);
Set<DistributionModuleGroup> moduleGroups = DBR640SparkBatchModuleGroup.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 DBR73xSparkBatchModuleGroupTest method testModuleGroups.
@Test
public void testModuleGroups() throws Exception {
Map<String, String> expected = new HashMap<>();
expected.put(DBR73xConstant.HIVEONSPARK_LIB_MRREQUIRED_DBR73X.getModuleName(), null);
expected.put(DBR73xConstant.SPARK_LIB_MRREQUIRED_DBR73X.getModuleName(), null);
expected.put(DBR73xConstant.BIGDATA_LAUNCHER_LIB_DBR73X.getModuleName(), null);
expected.put(DBR73xConstant.SNOWFLAKE_GROUP_DBR73x.getModuleName(), null);
expected.put(DBR73xConstant.DYNAMODB_GROUP_DBR73x.getModuleName(), null);
Set<DistributionModuleGroup> moduleGroups = DBR73xSparkBatchModuleGroup.getModuleGroups();
assertEquals(expected.size(), moduleGroups.size());
moduleGroups.iterator();
for (DistributionModuleGroup module : moduleGroups) {
assertTrue("Should contain module " + module.getModuleName(), expected.containsKey(module.getModuleName()));
// $NON-NLS-1$
if (expected.get(module.getModuleName()) == null) {
assertTrue("The condition of the module " + module.getModuleName() + " is not null.", // $NON-NLS-1$ //$NON-NLS-2$
expected.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 " + expected.get(module.getModuleName()) + ".", expected.get(module.getModuleName()) != null);
// $NON-NLS-1$
assertEquals(expected.get(module.getModuleName()), module.getRequiredIf().getConditionString());
}
}
}
use of org.talend.hadoop.distribution.DistributionModuleGroup in project tbd-studio-se by Talend.
the class DBR73xAzureNodeModuleGroupTest method testModuleGroups.
@Test
public void testModuleGroups() throws Exception {
Map<String, String> expected = new HashMap<>();
expected.put(DBR73xConstant.SPARK_AZURE_LIB_MRREQUIRED_DBR73X.getModuleName(), "((#LINK@NODE.STORAGE_CONFIGURATION.DISTRIBUTION=='DATABRICKS') AND (#LINK@NODE.STORAGE_CONFIGURATION.SPARK_VERSION=='DATABRICKS_7_3')) AND (#LINK@NODE.STORAGE_CONFIGURATION.SPARK_LOCAL_MODE=='false')");
// $NON-NLS-1$
Set<DistributionModuleGroup> moduleGroups = DBR73xAzureNodeModuleGroup.getModuleGroups(DBR73xDistribution.DISTRIBUTION_NAME, DBR73xDistribution.VERSION);
assertEquals(expected.size(), moduleGroups.size());
for (DistributionModuleGroup module : moduleGroups) {
assertTrue("Should contain module " + module.getModuleName(), expected.containsKey(module.getModuleName()));
// $NON-NLS-1$
if (expected.get(module.getModuleName()) == null) {
assertTrue("The condition of the module " + module.getModuleName() + " is not null.", // $NON-NLS-1$ //$NON-NLS-2$
expected.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 " + expected.get(module.getModuleName()) + ".", expected.get(module.getModuleName()) != null);
// $NON-NLS-1$
// assertEquals(expected.get(module.getModuleName()), module.getRequiredIf().getConditionString());
}
}
}
Aggregations