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
+ }
0 commit comments