Exemple #1
0
        private void PutReplicationOffline(Replication replication)
        {
            var doneEvent = new ManualResetEvent(false);

            replication.Changed += (object sender, ReplicationChangeEventArgs e) =>
            {
                if (!e.Source.online)
                {
                    doneEvent.Set();
                }
            };

            replication.GoOffline();

            var success = doneEvent.WaitOne(TimeSpan.FromSeconds(30));

            Assert.IsTrue(success);
        }
        private void PutReplicationOffline(Replication replication)
        {
            var doneEvent = new ManualResetEvent(false);
            replication.Changed += (object sender, ReplicationChangeEventArgs e) => 
            {
                if (e.Source.Status == ReplicationStatus.Offline) {
                    doneEvent.Set();
                }
            };

            replication.GoOffline();

            var success = doneEvent.WaitOne(TimeSpan.FromSeconds(30));
            Assert.IsTrue(success);
        }
 /// <exception cref="System.Exception"></exception>
 private void PutReplicationOffline(Replication replication)
 {
     CountDownLatch wentOffline = new CountDownLatch(1);
     Replication.ChangeListener offlineChangeListener = new _ChangeListener_1894(wentOffline
         );
     replication.AddChangeListener(offlineChangeListener);
     replication.GoOffline();
     bool succeeded = wentOffline.Await(30, TimeUnit.Seconds);
     NUnit.Framework.Assert.IsTrue(succeeded);
     replication.RemoveChangeListener(offlineChangeListener);
 }