Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<ProjectGuid>{033442D6-65E4-4A90-A6C0-9608B821A13B}</ProjectGuid>
<RootNamespace>HDInsight.Tests</RootNamespace>
<AssemblyName>HDInsight.Tests</AssemblyName>
<NuGetPackageImportStamp>c7e9322a</NuGetPackageImportStamp>
</PropertyGroup>
<Import Project="..\..\..\..\tools\Library.Settings.targets" />
<Import Project="$(LibraryToolsFolder)\Test.Dependencies.target" />
Expand All @@ -14,13 +15,17 @@
<Compile Include="ScenarioTests\CreateClusterTests.cs" />
<Compile Include="ScenarioTests\GetCapabilitiesTests.cs" />
<Compile Include="ScenarioTests\RdpTests.cs" />
<Compile Include="ScenarioTests\GetConfigurationTests.cs" />
<Compile Include="ScenarioTests\ResizeTests.cs" />
<Compile Include="ScenarioTests\HttpTests.cs" />
<Compile Include="ScenarioTests\ListClusterTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="app.config" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="SessionRecords\HDInsight.Tests.CreateClusterTests\TestCreateDuplicateCluster.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand All @@ -36,6 +41,9 @@
<None Include="SessionRecords\HDInsight.Tests.GetCapabilitiesTests\TestGetCapabilities.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\HDInsight.Tests.GetConfigurationTests\TestGetConfigCoreSiteCluster.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\HDInsight.Tests.HttpTests\TestDisableEnableHttp.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -96,4 +104,11 @@
<Name>HDInsightManagement</Name>
</ProjectReference>
</ItemGroup>
<Import Project="..\..\..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//
// Copyright (c) Microsoft. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

using System.Linq;
using System.Net;
using HDInsight.Tests.Helpers;
using Hyak.Common;
using Microsoft.Azure.Management.HDInsight;
using Microsoft.Azure.Management.HDInsight.Models;
using Microsoft.Azure.Test;
using Xunit;

namespace HDInsight.Tests
{
public class GetConfigurationTests
{
[Fact]
public void TestGetConfigCoreSiteCluster()
{
var handler = new RecordedDelegatingHandler {StatusCodeToReturn = HttpStatusCode.OK};

using (var context = UndoContext.Current)
{
context.Start();

var client = HDInsightManagementTestUtilities.GetHDInsightManagementClient(handler);
var resourceManagementClient = HDInsightManagementTestUtilities.GetResourceManagementClient(handler);

var resourceGroup = HDInsightManagementTestUtilities.CreateResourceGroup(resourceManagementClient);
const string dnsname = "hdisdk-configtest";

var spec = GetClusterSpecHelpers.GetPaasClusterSpec();

client.Clusters.Create(resourceGroup, dnsname, spec);

var configs = client.Clusters.GetClusterConfigurations(resourceGroup, dnsname, "core-site");

Assert.Equal(2, configs.Configuration.Count);

client.Clusters.Delete(resourceGroup, dnsname);
}
}
}
}
Loading