public void CanAddHiveAdditionalLibrariesValues()
        {
            var config = new AzureHDInsightConfig();
            IAddAzureHDInsightConfigValuesCommand addCoreConfigValues =
                ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateAddConfig();

            addCoreConfigValues.Hive.AdditionalLibraries = new AzureHDInsightDefaultStorageAccount
            {
                StorageAccountKey    = Guid.NewGuid().ToString(),
                StorageAccountName   = Guid.NewGuid().ToString(),
                StorageContainerName = Guid.NewGuid().ToString()
            };

            addCoreConfigValues.Config = config;
            addCoreConfigValues.EndProcessing();

            AzureHDInsightConfig newConfig = addCoreConfigValues.Output.First();

            Assert.AreEqual(config.ClusterSizeInNodes, newConfig.ClusterSizeInNodes);
            Assert.AreEqual(config.DefaultStorageAccount, newConfig.DefaultStorageAccount);
            Assert.IsNotNull(newConfig.HiveConfiguration.AdditionalLibraries);
            Assert.AreEqual(
                newConfig.HiveConfiguration.AdditionalLibraries.Container, addCoreConfigValues.Hive.AdditionalLibraries.StorageContainerName);
            Assert.AreEqual(newConfig.HiveConfiguration.AdditionalLibraries.Key, addCoreConfigValues.Hive.AdditionalLibraries.StorageAccountKey);
            Assert.AreEqual(newConfig.HiveConfiguration.AdditionalLibraries.Name, addCoreConfigValues.Hive.AdditionalLibraries.StorageAccountName);
        }
        public void CanAddOozieConfigValues()
        {
            var config = new AzureHDInsightConfig();
            IAddAzureHDInsightConfigValuesCommand addCoreConfigValues =
                ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateAddConfig();

            addCoreConfigValues.Oozie.AdditionalSharedLibraries = new AzureHDInsightDefaultStorageAccount
            {
                StorageAccountKey    = Guid.NewGuid().ToString(),
                StorageAccountName   = Guid.NewGuid().ToString(),
                StorageContainerName = Guid.NewGuid().ToString()
            };

            addCoreConfigValues.Oozie.AdditionalActionExecutorLibraries = new AzureHDInsightDefaultStorageAccount
            {
                StorageAccountKey    = Guid.NewGuid().ToString(),
                StorageAccountName   = Guid.NewGuid().ToString(),
                StorageContainerName = Guid.NewGuid().ToString()
            };

            addCoreConfigValues.Oozie.Configuration.Add("hadoop.log.file.size", "12345");
            addCoreConfigValues.Config = config;
            addCoreConfigValues.EndProcessing();

            AzureHDInsightConfig newConfig = addCoreConfigValues.Output.First();

            Assert.AreEqual(config.ClusterSizeInNodes, newConfig.ClusterSizeInNodes);
            Assert.AreEqual(config.DefaultStorageAccount, newConfig.DefaultStorageAccount);
            Assert.IsTrue(
                newConfig.OozieConfiguration.ConfigurationCollection.Any(
                    configOption => configOption.Key == "hadoop.log.file.size" && configOption.Value == "12345"));
            Assert.IsNotNull(newConfig.OozieConfiguration.AdditionalSharedLibraries);
            Assert.AreEqual(
                newConfig.OozieConfiguration.AdditionalSharedLibraries.Container,
                addCoreConfigValues.Oozie.AdditionalSharedLibraries.StorageContainerName);
            Assert.AreEqual(
                newConfig.OozieConfiguration.AdditionalSharedLibraries.Key, addCoreConfigValues.Oozie.AdditionalSharedLibraries.StorageAccountKey);
            Assert.AreEqual(
                newConfig.OozieConfiguration.AdditionalSharedLibraries.Name, addCoreConfigValues.Oozie.AdditionalSharedLibraries.StorageAccountName);

            Assert.IsNotNull(newConfig.OozieConfiguration.AdditionalActionExecutorLibraries);
            Assert.AreEqual(
                newConfig.OozieConfiguration.AdditionalActionExecutorLibraries.Container,
                addCoreConfigValues.Oozie.AdditionalActionExecutorLibraries.StorageContainerName);
            Assert.AreEqual(
                newConfig.OozieConfiguration.AdditionalActionExecutorLibraries.Key,
                addCoreConfigValues.Oozie.AdditionalActionExecutorLibraries.StorageAccountKey);
            Assert.AreEqual(
                newConfig.OozieConfiguration.AdditionalActionExecutorLibraries.Name,
                addCoreConfigValues.Oozie.AdditionalActionExecutorLibraries.StorageAccountName);
        }
        public void CanAddHdfsConfigValues()
        {
            var config = new AzureHDInsightConfig();
            IAddAzureHDInsightConfigValuesCommand addCoreConfigValues =
                ServiceLocator.Instance.Locate <IAzureHDInsightCommandFactory>().CreateAddConfig();

            addCoreConfigValues.Hdfs.Add("hadoop.log.file.size", "12345");
            addCoreConfigValues.Config = config;
            addCoreConfigValues.EndProcessing();

            AzureHDInsightConfig newConfig = addCoreConfigValues.Output.First();

            Assert.AreEqual(config.ClusterSizeInNodes, newConfig.ClusterSizeInNodes);
            Assert.AreEqual(config.DefaultStorageAccount, newConfig.DefaultStorageAccount);
            Assert.IsTrue(
                newConfig.HdfsConfiguration.Any(configOption => configOption.Key == "hadoop.log.file.size" && configOption.Value == "12345"));
        }