Search in sources :

Example 96 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.

the class SqlStreamBuilderAdminDatabaseConfigProviderTest method testConfigNeeded.

@Test
public void testConfigNeeded() {
    CmTemplateProcessor cmTemplateProcessor = initTemplateProcessor("7.2.11");
    TemplatePreparationObject preparationObject = initTemplatePreparationObject(cmTemplateProcessor);
    assertTrue(underTest.isConfigurationNeeded(cmTemplateProcessor, preparationObject));
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) Test(org.junit.Test)

Example 97 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.

the class SqlStreamBuilderAdminDatabaseConfigProviderTest method testNoConfigNeeded.

@Test
public void testNoConfigNeeded() {
    CmTemplateProcessor cmTemplateProcessor = initTemplateProcessor("7.2.10");
    TemplatePreparationObject preparationObject = initTemplatePreparationObject(cmTemplateProcessor);
    assertFalse(underTest.isConfigurationNeeded(cmTemplateProcessor, preparationObject));
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) Test(org.junit.Test)

Example 98 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.

the class SqlStreamBuilderSnapperDatabaseConfigProviderTest method testConfigNeeded.

@Test
public void testConfigNeeded() {
    CmTemplateProcessor cmTemplateProcessor = initTemplateProcessor("7.2.11");
    TemplatePreparationObject preparationObject = initTemplatePreparationObject(cmTemplateProcessor);
    assertTrue(underTest.isConfigurationNeeded(cmTemplateProcessor, preparationObject));
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) Test(org.junit.Test)

Example 99 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.

the class SqlStreamBuilderSnapperDatabaseConfigProviderTest method testProperSnapperDbConfig.

@Test
public void testProperSnapperDbConfig() {
    CmTemplateProcessor cmTemplateProcessor = initTemplateProcessor("7.2.11");
    TemplatePreparationObject preparationObject = initTemplatePreparationObject(cmTemplateProcessor);
    List<ApiClusterTemplateConfig> roleConfigs = underTest.getRoleConfigs(SqlStreamBuilderRoles.MATERIALIZED_VIEW_ENGINE, preparationObject);
    assertThat(roleConfigs).hasSameElementsAs(List.of(config("ssb.mve.datasource.url", "jdbc:postgresql://testhost:5432/eventador_snapper"), config("ssb.mve.datasource.username", "ssb_test_user"), config("ssb.mve.datasource.password", "ssb_test_pw")));
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.Test)

Example 100 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.

the class TezRoleConfigProviderTest method validateClientConfig.

protected void validateClientConfig(String hmsExternalDirLocation, String protoDirLocation) {
    TemplatePreparationObject preparationObject = getTemplatePreparationObject(hmsExternalDirLocation);
    String inputJson = getBlueprintText("input/clouderamanager-ds.bp");
    CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
    Map<String, List<ApiClusterTemplateConfig>> roleConfigs = underTest.getRoleConfigs(cmTemplateProcessor, preparationObject);
    List<ApiClusterTemplateConfig> tezConfigs = roleConfigs.get("tez-GATEWAY-BASE");
    assertEquals(1, tezConfigs.size());
    assertEquals("tez-conf/tez-site.xml_client_config_safety_valve", tezConfigs.get(0).getName());
    assertEquals("<property><name>tez.history.logging.proto-base-dir</name><value>" + protoDirLocation + "</value></property>", tezConfigs.get(0).getValue());
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) ArrayList(java.util.ArrayList) List(java.util.List) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig)

Aggregations

CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)149 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)115 Test (org.junit.Test)84 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)75 List (java.util.List)46 ArrayList (java.util.ArrayList)33 Test (org.junit.jupiter.api.Test)19 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)18 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)15 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)13 HashSet (java.util.HashSet)12 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)10 Builder (com.sequenceiq.cloudbreak.template.TemplatePreparationObject.Builder)10 Set (java.util.Set)10 ApiClusterTemplateService (com.cloudera.api.swagger.model.ApiClusterTemplateService)9 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)8 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)8 Map (java.util.Map)8 BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)7 Collectors (java.util.stream.Collectors)7