Skip to content

Commit 45cbfb1

Browse files
committed
Merge branch 'master' of github.com:Mpdreamz/NEST
Conflicts: src/Nest.Tests.Unit/Search/Sort/SortTests.cs
2 parents 4db9484 + ab0a52e commit 45cbfb1

File tree

11 files changed

+540
-238
lines changed

11 files changed

+540
-238
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using System.Collections.Generic;
2+
using NUnit.Framework;
3+
4+
namespace Nest.Tests.Integration.Cluster
5+
{
6+
[TestFixture]
7+
public class StateTests : IntegrationTests
8+
{
9+
[Test]
10+
public void SimpleState()
11+
{
12+
var r = this._client.ClusterState(ClusterStateInfo.All);
13+
Assert.True(r.IsValid);
14+
Assert.NotNull(r.ClusterName);
15+
Assert.NotNull(r.MasterNode);
16+
Assert.NotNull(r.Metadata);
17+
Assert.NotNull(r.Metadata.Indices);
18+
Assert.True(r.Metadata.Indices.Count > 0);
19+
Assert.NotNull(r.Nodes);
20+
Assert.True(r.Nodes.Count > 0);
21+
Assert.NotNull(r.RoutingNodes);
22+
Assert.True(r.RoutingNodes.Nodes.Count > 0);
23+
Assert.NotNull(r.RoutingTable);
24+
}
25+
[Test]
26+
public void StateWithoutMetadata()
27+
{
28+
var r = this._client.ClusterState(ClusterStateInfo.ExcludeMetadata);
29+
Assert.IsNull(r.Metadata);
30+
}
31+
[Test]
32+
public void StateWithoutNodes()
33+
{
34+
var r = this._client.ClusterState(ClusterStateInfo.ExcludeNodes);
35+
Assert.IsNull(r.Nodes);
36+
}
37+
[Test]
38+
public void StateWithoutRoutingTable()
39+
{
40+
var r = this._client.ClusterState(ClusterStateInfo.ExcludeRoutingTable);
41+
Assert.IsNull(r.RoutingTable);
42+
}
43+
//[Test]
44+
//public void StateWithoutBlocks()
45+
//{
46+
// var r = this._client.ClusterState(ClusterStateInfo.ExcludeRoutingTable);
47+
// Assert.IsNull(r.Blocks);
48+
//}
49+
}
50+
}

src/Nest.Tests.Integration/Nest.Tests.Integration.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
<Compile Include="Indices\Analysis\Analyzers\AnalyzerTest.cs" />
6565
<Compile Include="Indices\Analysis\Analyzers\AnalyzerTestResult.cs" />
6666
<Compile Include="Indices\Analysis\Analyzers\AnalyzerTests.cs" />
67+
<Compile Include="Cluster\StateTests.cs" />
6768
<Compile Include="IntegrationTests.cs" />
6869
<Compile Include="Cluster\HealthTests.cs" />
6970
<Compile Include="Cluster\NodeTests.cs" />

0 commit comments

Comments
 (0)