use of com.sequenceiq.cloudbreak.blueprint.BlueprintConfigurationEntry in project cloudbreak by hortonworks.
the class AbstractFileSystemConfiguratorTest method testGetDefaultFsProperties.
@Test
public void testGetDefaultFsProperties() {
FileSystemConfiguration fsConfig = new FileSystemConfiguration();
List<BlueprintConfigurationEntry> actual = underTest.getDefaultFsProperties(fsConfig);
List<BlueprintConfigurationEntry> expected = Arrays.asList(new BlueprintConfigurationEntry("core-site", "fs.defaultFS", "default-fs-value"), new BlueprintConfigurationEntry("hbase-site", "hbase.rootdir", "default-fs-value/apps/hbase/data"), new BlueprintConfigurationEntry("accumulo-site", "instance.volumes", "default-fs-value/apps/accumulo/data"), new BlueprintConfigurationEntry("webhcat-site", "templeton.hive.archive", "default-fs-value/hdp/apps/${hdp.version}/hive/hive.tar.gz"), new BlueprintConfigurationEntry("webhcat-site", "templeton.pig.archive", "default-fs-value/hdp/apps/${hdp.version}/pig/pig.tar.gz"), new BlueprintConfigurationEntry("webhcat-site", "templeton.sqoop.archive", "default-fs-value/hdp/apps/${hdp.version}/sqoop/sqoop.tar.gz"), new BlueprintConfigurationEntry("webhcat-site", "templeton.streaming.jar", "default-fs-value/hdp/apps/${hdp.version}/mapreduce/hadoop-streaming.jar"), new BlueprintConfigurationEntry("oozie-site", "oozie.service.HadoopAccessorService.supported.filesystems", "*"));
Assert.assertEquals(expected, actual);
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintConfigurationEntry in project cloudbreak by hortonworks.
the class BlueprintTextProcessorTest method testAddConfigEntriesAddsConfigEntriesToExistingConfigPropertiesBlockAndKeepsExistingEntries.
@Test
public void testAddConfigEntriesAddsConfigEntriesToExistingConfigPropertiesBlockAndKeepsExistingEntries() throws Exception {
String testBlueprint = FileReaderUtils.readFileFromClasspath("blueprints-jackson/test-bp-with-core-site-properties.bp");
List<BlueprintConfigurationEntry> configurationEntries = new ArrayList<>();
configurationEntries.add(new BlueprintConfigurationEntry("core-site", "fs.AbstractFileSystem.wasb.impl", "org.apache.hadoop.fs.azure.Wasb"));
configurationEntries.add(new BlueprintConfigurationEntry("core-site", "io.serializations", "org.apache.hadoop.io.serializer.WritableSerialization"));
String result = underTest.get(testBlueprint).addConfigEntries(configurationEntries, true).asText();
String configValue1 = JsonUtil.readTree(result).findPath("core-site").path("properties").path("fs.AbstractFileSystem.wasb.impl").textValue();
Assert.assertEquals("org.apache.hadoop.fs.azure.Wasb", configValue1);
String configValue2 = JsonUtil.readTree(result).findPath("core-site").path("properties").path("io.serializations").textValue();
Assert.assertEquals("org.apache.hadoop.io.serializer.WritableSerialization", configValue2);
String configValue3 = JsonUtil.readTree(result).findPath("core-site").path("properties").path("fs.trash.interval").textValue();
Assert.assertEquals("360", configValue3);
String configValue4 = JsonUtil.readTree(result).findPath("core-site").path("properties").path("io.file.buffer.size").textValue();
Assert.assertEquals("131072", configValue4);
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintConfigurationEntry in project cloudbreak by hortonworks.
the class BlueprintTextProcessorTest method testAddConfigEntriesAddsRootConfigurationsNodeIfMissing.
@Test
public void testAddConfigEntriesAddsRootConfigurationsNodeIfMissing() throws Exception {
String testBlueprint = FileReaderUtils.readFileFromClasspath("blueprints-jackson/test-bp-without-config-block.bp");
List<BlueprintConfigurationEntry> configurationEntries = new ArrayList<>();
String result = underTest.get(testBlueprint).addConfigEntries(configurationEntries, true).asText();
JsonNode configNode = JsonUtil.readTree(result).path("configurations");
Assert.assertFalse(configNode.isMissingNode());
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintConfigurationEntry in project cloudbreak by hortonworks.
the class BlueprintTextProcessorTest method testAddConfigEntriesAddsConfigFileEntryIfMissing.
@Test
public void testAddConfigEntriesAddsConfigFileEntryIfMissing() throws Exception {
String testBlueprint = FileReaderUtils.readFileFromClasspath("blueprints-jackson/test-bp-with-empty-config-block.bp");
List<BlueprintConfigurationEntry> configurationEntries = new ArrayList<>();
configurationEntries.add(new BlueprintConfigurationEntry("core-site", "fs.AbstractFileSystem.wasb.impl", "org.apache.hadoop.fs.azure.Wasb"));
String result = underTest.get(testBlueprint).addConfigEntries(configurationEntries, true).asText();
JsonNode coreSiteNode = JsonUtil.readTree(result).findPath("core-site");
Assert.assertFalse(coreSiteNode.isMissingNode());
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintConfigurationEntry in project cloudbreak by hortonworks.
the class BlueprintTextProcessorTest method testAddConfigEntriesBehavesCorrectlyWhenThereIsNoConfigurationsNode.
@Test
public void testAddConfigEntriesBehavesCorrectlyWhenThereIsNoConfigurationsNode() throws Exception {
String testBlueprint = FileReaderUtils.readFileFromClasspath("blueprints-jackson/test-bp-without-config-block.bp");
List<BlueprintConfigurationEntry> configurationEntries = new ArrayList<>();
configurationEntries.add(new BlueprintConfigurationEntry("core-site", "fs.defaultFS", "wasb://cloudbreak@dduihoab6jt1jl.cloudapp.net"));
configurationEntries.add(new BlueprintConfigurationEntry("core-site", "io.serializations", "org.apache.hadoop.io.serializer.WritableSerialization"));
String result = underTest.get(testBlueprint).addConfigEntries(configurationEntries, false).asText();
String configValue1 = JsonUtil.readTree(result).findPath("core-site").path("fs.defaultFS").textValue();
Assert.assertEquals("wasb://cloudbreak@dduihoab6jt1jl.cloudapp.net", configValue1);
String configValue2 = JsonUtil.readTree(result).findPath("core-site").path("io.serializations").textValue();
Assert.assertEquals("org.apache.hadoop.io.serializer.WritableSerialization", configValue2);
}
Aggregations