/// <exception cref="System.Exception"></exception>
        public virtual void ChangeTrackerTestWithMode(ChangeTracker.ChangeTrackerMode mode
                                                      )
        {
            CountDownLatch      changeTrackerFinishedSignal = new CountDownLatch(1);
            CountDownLatch      changeReceivedSignal        = new CountDownLatch(1);
            Uri                 testURL = GetReplicationURL();
            ChangeTrackerClient client  = new _ChangeTrackerClient_119(changeTrackerFinishedSignal
                                                                       , changeReceivedSignal);
            ChangeTracker changeTracker = new ChangeTracker(testURL, mode, 0, client);

            changeTracker.Start();
            try
            {
                bool success = changeReceivedSignal.Await(300, TimeUnit.Seconds);
                NUnit.Framework.Assert.IsTrue(success);
            }
            catch (Exception e)
            {
                Sharpen.Runtime.PrintStackTrace(e);
            }
            changeTracker.Stop();
            try
            {
                bool success = changeTrackerFinishedSignal.Await(300, TimeUnit.Seconds);
                NUnit.Framework.Assert.IsTrue(success);
            }
            catch (Exception e)
            {
                Sharpen.Runtime.PrintStackTrace(e);
            }
        }
示例#2
0
        /// <exception cref="System.Exception"></exception>
        private void RunChangeTrackerTransientError(ChangeTracker.ChangeTrackerMode mode,
                                                    int errorCode, string statusMessage, int numExpectedChangeCallbacks)
        {
            CountDownLatch changeTrackerFinishedSignal = new CountDownLatch(1);
            CountDownLatch changeReceivedSignal        = new CountDownLatch(numExpectedChangeCallbacks
                                                                            );
            Uri testURL = GetReplicationURL();
            ChangeTrackerClient client = new _ChangeTrackerClient_197(changeTrackerFinishedSignal
                                                                      , changeReceivedSignal, errorCode, statusMessage);
            ChangeTracker changeTracker = new ChangeTracker(testURL, mode, false, 0, client);

            changeTracker.SetUsePOST(IsTestingAgainstSyncGateway());
            changeTracker.Start();
            try
            {
                bool success = changeReceivedSignal.Await(30, TimeUnit.Seconds);
                NUnit.Framework.Assert.IsTrue(success);
            }
            catch (Exception e)
            {
                Sharpen.Runtime.PrintStackTrace(e);
            }
            changeTracker.Stop();
            try
            {
                bool success = changeTrackerFinishedSignal.Await(30, TimeUnit.Seconds);
                NUnit.Framework.Assert.IsTrue(success);
            }
            catch (Exception e)
            {
                Sharpen.Runtime.PrintStackTrace(e);
            }
        }
示例#3
0
 public ChangeTracker(Uri databaseURL, ChangeTracker.ChangeTrackerMode mode, object
                      lastSequenceID, IChangeTrackerClient client)
 {
     this.databaseURL    = databaseURL;
     this.mode           = mode;
     this.lastSequenceID = lastSequenceID;
     this.client         = client;
     this.requestHeaders = new Dictionary <string, object>();
 }
示例#4
0
 public ChangeTracker(Uri databaseURL, ChangeTracker.ChangeTrackerMode mode, object lastSequenceID,
                      Boolean includeConflicts, IChangeTrackerClient client)
 {
     this.databaseURL      = databaseURL;
     this.mode             = mode;
     this.includeConflicts = includeConflicts;
     this.lastSequenceID   = lastSequenceID;
     this.client           = client;
     this.RequestHeaders   = new Dictionary <string, object>();
     this.tokenSource      = new CancellationTokenSource();
 }
示例#5
0
 public ChangeTracker(Uri databaseURL, ChangeTracker.ChangeTrackerMode mode, bool
                      includeConflicts, object lastSequenceID, ChangeTrackerClient client)
 {
     // does not work, do not use it.
     this.databaseURL      = databaseURL;
     this.mode             = mode;
     this.includeConflicts = includeConflicts;
     this.lastSequenceID   = lastSequenceID;
     this.client           = client;
     this.requestHeaders   = new Dictionary <string, object>();
     this.heartBeatSeconds = 300;
     this.limit            = 50;
 }
示例#6
0
		public ChangeTracker(Uri databaseURL, ChangeTracker.ChangeTrackerMode mode, bool 
			includeConflicts, object lastSequenceID, ChangeTrackerClient client)
		{
			this.databaseURL = databaseURL;
			this.mode = mode;
			this.includeConflicts = includeConflicts;
			this.lastSequenceID = lastSequenceID;
			this.client = client;
			this.requestHeaders = new Dictionary<string, object>();
		}
 public ChangeTracker(Uri databaseURL, ChangeTracker.ChangeTrackerMode mode, bool 
     includeConflicts, object lastSequenceID, ChangeTrackerClient client)
 {
     // does not work, do not use it.
     this.databaseURL = databaseURL;
     this.mode = mode;
     this.includeConflicts = includeConflicts;
     this.lastSequenceID = lastSequenceID;
     this.client = client;
     this.requestHeaders = new Dictionary<string, object>();
     this.heartBeatSeconds = 300;
     this.limit = 50;
 }
示例#8
0
        public ChangeTracker(Uri databaseURL, ChangeTracker.ChangeTrackerMode mode, object lastSequenceID, 
            Boolean includeConflicts, IChangeTrackerClient client)
		{
			this.databaseURL = databaseURL;
			this.mode = mode;
            this.includeConflicts = includeConflicts;
			this.lastSequenceID = lastSequenceID;
			this.client = client;
			this.RequestHeaders = new Dictionary<string, object>();
            this.tokenSource = new CancellationTokenSource();
		}