Пример #1
0
            public void CanCatchUpOnSegment()
            {
                var endpoint = new NodeEndpoint
                {
                    Async = new Uri("rhino.queues://localhost:2202/replication"),
                    Sync  = new Uri("rhino.dht://localhost:2201")
                };

                masterProxy.Join(new NodeEndpoint
                {
                    Async = new Uri("rhino.queues://other:2202/replication"),
                    Sync  = new Uri("rhino.dht://other:2201")
                });
                var segments = masterProxy.Join(endpoint);

                masterProxy.CaughtUp(endpoint, ReplicationType.Ownership, segments[0].Index, segments[1].Index);

                var topology = masterProxy.GetTopology();

                Assert.Equal(endpoint, topology.Segments[segments[0].Index].AssignedEndpoint);
                Assert.Equal(endpoint, topology.Segments[segments[1].Index].AssignedEndpoint);

                Assert.NotEqual(endpoint, topology.Segments[segments[2].Index].AssignedEndpoint);
                Assert.Equal(endpoint, topology.Segments[segments[2].Index].InProcessOfMovingToEndpoint);
            }