diff --git a/src/Common/Configuration.Tests/CloudConfigurationManagerTest.cs b/src/Common/Configuration.Tests/CloudConfigurationManagerTest.cs index b84fb583ffdb8..a4661f4caf6e3 100644 --- a/src/Common/Configuration.Tests/CloudConfigurationManagerTest.cs +++ b/src/Common/Configuration.Tests/CloudConfigurationManagerTest.cs @@ -13,6 +13,8 @@ // limitations under the License. // +using System; +using System.Configuration; using Microsoft.Azure; using Xunit; namespace Microsoft.WindowsAzure.Configuration.Test @@ -28,5 +30,37 @@ public void TestGetSettingWithNonExistingSettings() Assert.Null(actual); } + + [Fact] + public void TestGetSettingWithNullParamThrowsArgumentNullException() + { + Assert.Throws(() => + { + string actual = CloudConfigurationManager.GetSetting(null); + }); + } + + [Fact] + public void TestGetSettingWithEmptyStringThrowsArgumentException() + { + Assert.Throws(() => + { + string actual = CloudConfigurationManager.GetSetting(""); + }); + } + + [Fact] + public void TestGetSettingOverloadThatRequiresGettingSettingFromServiceRuntimeWithNonExistingSettingThrowsException() + { + Assert.Throws(() => + { + string actual = CloudConfigurationManager + .GetSetting( + name: "notExistingSettingName", + outputResultsToTrace: true, + throwIfNotFoundInRuntime: true); + } + ); + } } } diff --git a/src/Common/Configuration/Microsoft.WindowsAzure.ConfigurationManager.nuget.proj b/src/Common/Configuration/Microsoft.WindowsAzure.ConfigurationManager.nuget.proj index 7f2d49f9311d6..03b2a9fbc663e 100644 --- a/src/Common/Configuration/Microsoft.WindowsAzure.ConfigurationManager.nuget.proj +++ b/src/Common/Configuration/Microsoft.WindowsAzure.ConfigurationManager.nuget.proj @@ -5,7 +5,7 @@ Microsoft.WindowsAzure.ConfigurationManager --> - 3.2.2 + 3.2.3 $(MSBuildThisFileDirectory) diff --git a/src/Common/Configuration/Properties/AssemblyInfo.cs b/src/Common/Configuration/Properties/AssemblyInfo.cs index 9abb3cd0a50e0..224513f32671a 100644 --- a/src/Common/Configuration/Properties/AssemblyInfo.cs +++ b/src/Common/Configuration/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ [assembly: Guid("3a4d8eda-db18-4c6f-9f84-4576bb255f30")] [assembly: AssemblyVersion("3.0.0.0")] -[assembly: AssemblyFileVersion("3.2.2.0")] +[assembly: AssemblyFileVersion("3.2.3.0")] [assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/src/Common/Configuration/Properties/Resources.Designer.cs b/src/Common/Configuration/Properties/Resources.Designer.cs index 2cfe120dc0938..9f62768142729 100644 --- a/src/Common/Configuration/Properties/Resources.Designer.cs +++ b/src/Common/Configuration/Properties/Resources.Designer.cs @@ -39,7 +39,7 @@ internal Resources() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.WindowsAzure.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.WindowsAzure.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/src/ResourceManagement/HDInsight/HDInsight.Tests/ScenarioTests/ScriptActionsOnRunningCluster.cs b/src/ResourceManagement/HDInsight/HDInsight.Tests/ScenarioTests/ScriptActionsOnRunningCluster.cs index 7baa732f0d366..c122911aa4410 100644 --- a/src/ResourceManagement/HDInsight/HDInsight.Tests/ScenarioTests/ScriptActionsOnRunningCluster.cs +++ b/src/ResourceManagement/HDInsight/HDInsight.Tests/ScenarioTests/ScriptActionsOnRunningCluster.cs @@ -122,7 +122,7 @@ public void TestScriptActionsOnRunningCluster() var result = client.Clusters.ExecuteScriptActions(resourceGroup, dnsName, executeScriptActionParams); Assert.Equal(result.StatusCode, HttpStatusCode.OK); Assert.Equal(result.State, AsyncOperationState.Failed); - // Assert.Equal(result.ErrorInfo.Message, "ScriptExecutionFailed"); + Assert.Equal(result.ErrorInfo.Message, "ScriptExecutionFailed"); var scriptActionParams = GetExecuteScriptActionParams(true, "script" + Guid.NewGuid().ToString().Substring(0, 10), InstallGiraph); diff --git a/src/ResourceManagement/HDInsightJob/HDInsightJob.Tests/ScenarioTests/SubmitJobTests.cs b/src/ResourceManagement/HDInsightJob/HDInsightJob.Tests/ScenarioTests/SubmitJobTests.cs index 89f6ac442408e..7ab3e423f1e41 100644 --- a/src/ResourceManagement/HDInsightJob/HDInsightJob.Tests/ScenarioTests/SubmitJobTests.cs +++ b/src/ResourceManagement/HDInsightJob/HDInsightJob.Tests/ScenarioTests/SubmitJobTests.cs @@ -693,9 +693,10 @@ private static string Convert(Stream stream) private IStorageAccess GetStorageAccessObject(bool IsWindowsCluster = false) { - return new AzureStorageAccess(IsWindowsCluster ? TestUtils.WinStorageAccountName : TestUtils.StorageAccountName, - IsWindowsCluster ? TestUtils.WinStorageAccountKey : TestUtils.StorageAccountKey, - IsWindowsCluster ? TestUtils.WinDefaultContainer : TestUtils.DefaultContainer); + return new AzureStorageAccess(IsWindowsCluster ? TestUtils.WinStorageAccountName : TestUtils.StorageAccountName, + IsWindowsCluster ? TestUtils.WinStorageAccountKey : TestUtils.StorageAccountKey, + IsWindowsCluster ? TestUtils.WinDefaultContainer : TestUtils.DefaultContainer, TestUtils.storageAccountSuffix); + } } } diff --git a/src/ResourceManagement/HDInsightJob/HDInsightJob.Tests/TestUtils.cs b/src/ResourceManagement/HDInsightJob/HDInsightJob.Tests/TestUtils.cs index 2cf8b9a1280aa..42cc1e011a6c4 100644 --- a/src/ResourceManagement/HDInsightJob/HDInsightJob.Tests/TestUtils.cs +++ b/src/ResourceManagement/HDInsightJob/HDInsightJob.Tests/TestUtils.cs @@ -36,6 +36,8 @@ public static class TestUtils public static string WinDefaultContainer = "pattipakawin33"; public static string WinUserName = "admin"; public static string WinPassword = ""; + //set storage account suffix appropriately for different environments, for example:core.chinacloudapi.cn + public static string storageAccountSuffix = ""; public static string SQLServerUserName = ""; public static string SQLServerPassword = ""; diff --git a/src/ResourceManagement/HDInsightJob/HDInsightJob/Customizations/Models/Storage/AzureStorageAccess.cs b/src/ResourceManagement/HDInsightJob/HDInsightJob/Customizations/Models/Storage/AzureStorageAccess.cs index 90c9d110579a7..bf1028840e3f1 100644 --- a/src/ResourceManagement/HDInsightJob/HDInsightJob/Customizations/Models/Storage/AzureStorageAccess.cs +++ b/src/ResourceManagement/HDInsightJob/HDInsightJob/Customizations/Models/Storage/AzureStorageAccess.cs @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // - +using System; using System.IO; using System.Net; using Hyak.Common; @@ -34,6 +34,7 @@ public class AzureStorageAccess : IStorageAccess private string DefaultStorageContainer { get; set; } + private string storageAccountSuffix { get; set; } /// /// Initializes a new instance of the AzureStorageAccess class. /// @@ -46,18 +47,23 @@ public class AzureStorageAccess : IStorageAccess /// /// Required. The default storage container name. /// - public AzureStorageAccess(string storageAccountName, string storageAccountKey, string defaultStorageContainer) + /// + /// Optional. The storage account URI suffix. For example, "core.chinacloudapi.cn". + /// + + public AzureStorageAccess(string storageAccountName, string storageAccountKey, string defaultStorageContainer, string storageAccountSuffix = null) { this.StorageAccountName = storageAccountName; this.StorageAccountKey = storageAccountKey; this.DefaultStorageContainer = defaultStorageContainer; + this.storageAccountSuffix = storageAccountSuffix; } private CloudBlobClient GetStorageClient() { var accountName = StorageAccountName.Contains(".") ? StorageAccountName.Substring(0, StorageAccountName.IndexOf('.')) : StorageAccountName; var storageCredentials = new StorageCredentials(accountName, StorageAccountKey); - var storageAccount = new CloudStorageAccount(storageCredentials, true); + var storageAccount = new CloudStorageAccount(storageCredentials, storageAccountSuffix, true); return storageAccount.CreateCloudBlobClient(); } diff --git a/src/ResourceManagement/HDInsightJob/HDInsightJob/Microsoft.Azure.Management.HDInsight.Job.nuget.proj b/src/ResourceManagement/HDInsightJob/HDInsightJob/Microsoft.Azure.Management.HDInsight.Job.nuget.proj index a8628e76b9b73..c0fdc637e14e6 100644 --- a/src/ResourceManagement/HDInsightJob/HDInsightJob/Microsoft.Azure.Management.HDInsight.Job.nuget.proj +++ b/src/ResourceManagement/HDInsightJob/HDInsightJob/Microsoft.Azure.Management.HDInsight.Job.nuget.proj @@ -2,7 +2,7 @@ - 2.0.3 + 2.0.4 $(MSBuildThisFileDirectory) diff --git a/src/ResourceManagement/HDInsightJob/HDInsightJob/Microsoft.Azure.Management.HDInsight.Job.nuspec b/src/ResourceManagement/HDInsightJob/HDInsightJob/Microsoft.Azure.Management.HDInsight.Job.nuspec index 3efaaba368284..ce14ee288ad44 100644 --- a/src/ResourceManagement/HDInsightJob/HDInsightJob/Microsoft.Azure.Management.HDInsight.Job.nuspec +++ b/src/ResourceManagement/HDInsightJob/HDInsightJob/Microsoft.Azure.Management.HDInsight.Job.nuspec @@ -4,6 +4,16 @@ Microsoft.Azure.Management.HDInsight.Job Microsoft Azure HDInsight Job Management Library