use of com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs in project cloudbreak by hortonworks.
the class BlueprintTemplateProcessorTest method testMustacheGeneratorWithSimpleUseCase.
@Test
public void testMustacheGeneratorWithSimpleUseCase() throws Exception {
String testBlueprint = FileReaderUtils.readFileFromClasspath("blueprints-jackson/bp-mustache-test.bp");
Cluster cluster = cluster();
BlueprintStackInfo blueprintStackInfo = new BlueprintStackInfo("hdp", "2.4");
GeneralClusterConfigs generalClusterConfigs = generalClusterConfigs();
generalClusterConfigs.setClusterName("dummyCluster");
generalClusterConfigs.setStackName("dummyCluster");
Map<String, Object> properties = new HashMap<>();
properties.put("S3_BUCKET", "testbucket");
BlueprintPreparationObject blueprintPreparationObject = BlueprintPreparationObject.Builder.builder().withRdsConfigs(cluster.getRdsConfigs()).withGateway(cluster.getGateway()).withLdapConfig(cluster.getLdapConfig()).withGeneralClusterConfigs(generalClusterConfigs).withBlueprintView(new BlueprintView(testBlueprint, new Json(properties), blueprintStackInfo.getVersion(), blueprintStackInfo.getType())).build();
String result = underTest.process(testBlueprint, blueprintPreparationObject, Maps.newHashMap());
assertTrue(result.contains("testbucket"));
assertTrue(result.contains("{{ zookeeper_quorum }}"));
assertTrue(result.contains("{{default('/configurations/hadoop-env/hdfs_log_dir_prefix', '/var/log/hadoop')}}"));
assertTrue(result.contains(cluster.getName()));
assertTrue(result.contains("jdbc:postgresql://10.1.1.1:5432/ranger"));
assertTrue(result.contains("cn=users,dc=example,dc=org"));
assertTrue(result.contains("ldap://localhost:389"));
}
use of com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs in project cloudbreak by hortonworks.
the class BlueprintTestUtil method generalClusterConfigs.
public static GeneralClusterConfigs generalClusterConfigs(Cluster cluster) {
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setAmbariIp(cluster.getAmbariIp());
generalClusterConfigs.setInstanceGroupsPresented(true);
generalClusterConfigs.setGatewayInstanceMetadataPresented(true);
generalClusterConfigs.setClusterName(cluster.getName());
generalClusterConfigs.setExecutorType(cluster.getExecutorType());
generalClusterConfigs.setStackName(cluster.getName());
generalClusterConfigs.setUuid("111-222-333-444");
generalClusterConfigs.setUserName(cluster.getUserName());
generalClusterConfigs.setPassword(cluster.getPassword());
generalClusterConfigs.setNodeCount(1);
generalClusterConfigs.setIdentityUserEmail(IDENTITY_USER_EMAIL);
generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.ofNullable("fqdn.loal.com"));
return generalClusterConfigs;
}
use of com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs in project cloudbreak by hortonworks.
the class BlueprintTestUtil method generalClusterConfigs.
public static GeneralClusterConfigs generalClusterConfigs() {
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setAmbariIp("10.1.1.1");
generalClusterConfigs.setInstanceGroupsPresented(true);
generalClusterConfigs.setGatewayInstanceMetadataPresented(true);
generalClusterConfigs.setClusterName("clustername");
generalClusterConfigs.setExecutorType(ExecutorType.DEFAULT);
generalClusterConfigs.setStackName("clustername");
generalClusterConfigs.setUuid("111-222-333-444");
generalClusterConfigs.setUserName("username");
generalClusterConfigs.setPassword("Passw0rd");
generalClusterConfigs.setNodeCount(1);
generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.ofNullable("fqdn.loal.com"));
generalClusterConfigs.setIdentityUserEmail(IDENTITY_USER_EMAIL);
return generalClusterConfigs;
}
use of com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs in project cloudbreak by hortonworks.
the class BlueprintModelProvider method blueprintObjectWhenHiveInteractivePresentedTheLlapShouldConfigured.
static BlueprintPreparationObject blueprintObjectWhenHiveInteractivePresentedTheLlapShouldConfigured() throws JsonProcessingException {
GeneralClusterConfigs conf = BlueprintTestUtil.generalClusterConfigs();
conf.setNodeCount(5);
return BlueprintPreparationObject.Builder.builder().withGeneralClusterConfigs(conf).withBlueprintView(BlueprintTestUtil.generalBlueprintView("", "2.6", "HDP")).withHostgroups(getHostGroups("master", "slave_1")).withGateway(TestUtil.gateway()).build();
}
use of com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs in project cloudbreak by hortonworks.
the class BlueprintModelProvider method blueprintObjectWhereExecutioTypeHasConfiguredAsContainer.
static BlueprintPreparationObject blueprintObjectWhereExecutioTypeHasConfiguredAsContainer() throws JsonProcessingException {
GeneralClusterConfigs configs = BlueprintTestUtil.generalClusterConfigs();
configs.setExecutorType(ExecutorType.CONTAINER);
return BlueprintPreparationObject.Builder.builder().withBlueprintView(BlueprintTestUtil.generalBlueprintView("", "2.6", "HDP")).withHostgroups(getHostGroups("master", "slave_1")).withGeneralClusterConfigs(configs).withGateway(TestUtil.gateway()).build();
}
Aggregations