Search in sources :

Example 26 with DistributionBean

use of org.talend.hadoop.distribution.model.DistributionBean 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));
}
Also used : IHDistributionVersion(org.talend.core.runtime.hd.IHDistributionVersion) DistributionVersion(org.talend.hadoop.distribution.model.DistributionVersion) SparkComponent(org.talend.hadoop.distribution.component.SparkComponent) HadoopComponent(org.talend.hadoop.distribution.component.HadoopComponent) DistributionBean(org.talend.hadoop.distribution.model.DistributionBean) Test(org.junit.Test)

Example 27 with DistributionBean

use of org.talend.hadoop.distribution.model.DistributionBean 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));
}
Also used : IHDistributionVersion(org.talend.core.runtime.hd.IHDistributionVersion) DistributionVersion(org.talend.hadoop.distribution.model.DistributionVersion) SparkComponent(org.talend.hadoop.distribution.component.SparkComponent) HadoopComponent(org.talend.hadoop.distribution.component.HadoopComponent) SparkStreamingComponent(org.talend.hadoop.distribution.component.SparkStreamingComponent) DistributionBean(org.talend.hadoop.distribution.model.DistributionBean) Test(org.junit.Test)

Example 28 with DistributionBean

use of org.talend.hadoop.distribution.model.DistributionBean in project tbd-studio-se by Talend.

the class ImpalaDistributionsTest method testImpalaDistribution_CDH.

@Test
public void testImpalaDistribution_CDH() {
    DistributionBean distribution = HadoopDistributionsHelper.IMPALA.getDistribution(IClouderaDistribution.DISTRIBUTION_NAME, false);
    Assert.assertNotNull(distribution);
    String[] versionsDisplay = TestUtils.getVersionsDisplayDeprecatedSuffixRemoved(distribution.getVersionsDisplay());
    List<String> versions = Arrays.asList(versionsDisplay);
    String message = "Should contain the version";
    // arrayContain(versions, "Cloudera CDH5.5(YARN mode)", message);
    // arrayContain(versions, "Cloudera CDH5.6(YARN mode)", message);
    arrayContain(versions, "Cloudera CDH5.7(YARN mode)", message);
}
Also used : DistributionBean(org.talend.hadoop.distribution.model.DistributionBean) Test(org.junit.Test)

Example 29 with DistributionBean

use of org.talend.hadoop.distribution.model.DistributionBean 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());
            }
        }
    }
}
Also used : DistributionVersion(org.talend.hadoop.distribution.model.DistributionVersion) DistributionBean(org.talend.hadoop.distribution.model.DistributionBean)

Aggregations

DistributionBean (org.talend.hadoop.distribution.model.DistributionBean)29 DistributionVersion (org.talend.hadoop.distribution.model.DistributionVersion)15 Test (org.junit.Test)8 IHDistributionVersion (org.talend.core.runtime.hd.IHDistributionVersion)8 HadoopClusterConnection (org.talend.repository.model.hadoopcluster.HadoopClusterConnection)7 HadoopComponent (org.talend.hadoop.distribution.component.HadoopComponent)6 HadoopClusterConnectionItem (org.talend.repository.model.hadoopcluster.HadoopClusterConnectionItem)6 SparkComponent (org.talend.hadoop.distribution.component.SparkComponent)4 IHadoopDistributionService (org.talend.core.hadoop.IHadoopDistributionService)2 SparkStreamingComponent (org.talend.hadoop.distribution.component.SparkStreamingComponent)2 AbstractDynamicDistributionTemplate (org.talend.hadoop.distribution.dynamic.template.AbstractDynamicDistributionTemplate)2 DynamicDistributionVersion (org.talend.hadoop.distribution.model.DynamicDistributionVersion)2 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 GridData (org.eclipse.swt.layout.GridData)1