use of org.talend.hadoop.distribution.model.DistributionVersion in project tbd-studio-se by Talend.
the class DistributionHelperTest method test_doSupportService_HadoopComponent.
@Test
public void test_doSupportService_HadoopComponent() {
HadoopComponent hadoopComponent = Mockito.mock(HadoopComponent.class);
DistributionBean distribution = Mockito.mock(DistributionBean.class);
Assert.assertTrue(DistributionHelper.doSupportService(new DistributionVersion(hadoopComponent, distribution, "ABC_10", "Abc 1.0"), IHDConstants.SERVICE_HADOOP));
// because the SparkComponent is sub class of HadoopComponent
SparkComponent sparkComponent = Mockito.mock(SparkComponent.class);
Assert.assertTrue(DistributionHelper.doSupportService(new DistributionVersion(sparkComponent, distribution, "ABC_10", "Abc 1.0"), IHDConstants.SERVICE_HADOOP));
}
use of org.talend.hadoop.distribution.model.DistributionVersion in project tbd-studio-se by Talend.
the class DistributionHelperTest method test_doSupportService_SparkComponent.
@Test
public void test_doSupportService_SparkComponent() {
HadoopComponent hadoopComponent = Mockito.mock(HadoopComponent.class);
DistributionBean distribution = Mockito.mock(DistributionBean.class);
Assert.assertFalse(DistributionHelper.doSupportService(new DistributionVersion(hadoopComponent, distribution, "ABC_10", "Abc 1.0"), IHDConstants.SERVICE_SPARK));
SparkComponent sparkComponent = Mockito.mock(SparkComponent.class);
Assert.assertTrue(DistributionHelper.doSupportService(new DistributionVersion(sparkComponent, distribution, "ABC_10", "Abc 1.0"), IHDConstants.SERVICE_SPARK));
// because the SparkStreamingComponent is sub class of SparkComponent
SparkStreamingComponent sparkStreamingComponent = Mockito.mock(SparkStreamingComponent.class);
Assert.assertTrue(DistributionHelper.doSupportService(new DistributionVersion(sparkStreamingComponent, distribution, "ABC_10", "Abc 1.0"), IHDConstants.SERVICE_SPARK));
}
use of org.talend.hadoop.distribution.model.DistributionVersion in project tbd-studio-se by Talend.
the class HadoopDistributionsHelperTest method testDistributionOnly.
private void testDistributionOnly(String distributionName, String distributionDisplay, String[][] supportVersions) {
DistributionBean distribution = HadoopDistributionsHelper.HADOOP.getDistribution(distributionName, false);
Assert.assertNotNull("Can't find the Distribution: " + distributionName, distribution);
Assert.assertEquals(distributionName, distribution.name);
Assert.assertEquals(distributionDisplay, distribution.displayName);
Assert.assertNull("Because get all Hadoop distributions via HadoopComponent, so no ComponentType to be matched.", distribution.componentType);
if (supportVersions != null) {
for (String[] supportVersion : supportVersions) {
String versionName = supportVersion[0];
String versionDisplay = supportVersion[1];
String hadoopVersion = supportVersion[2];
DistributionVersion version = TestUtils.getDistributionVersion(distribution, versionDisplay);
Assert.assertNotNull("No support of version : " + versionDisplay, version);
Assert.assertEquals(versionName, version.version);
Assert.assertEquals(versionDisplay, TestUtils.getVersionDisplayDeprecatedSuffixRemoved(version.displayVersion));
Assert.assertEquals(distribution, version.distribution);
Assert.assertNotNull(version.hadoopComponent);
Assert.assertEquals(distributionName, version.hadoopComponent.getDistribution());
Assert.assertEquals(distributionDisplay, version.hadoopComponent.getDistributionName());
Assert.assertEquals(versionName, version.hadoopComponent.getVersion());
Assert.assertEquals(versionDisplay, TestUtils.getVersionDisplayDeprecatedSuffixRemoved(version.hadoopComponent.getVersionName(distribution.componentType)));
if (version.hadoopComponent.getHadoopVersion() != null) {
Assert.assertEquals(hadoopVersion, version.hadoopComponent.getHadoopVersion().name());
}
}
}
}
Aggregations