Lucene.Net.Index.TestDocumentsWriterDeleteQueue.TestPartiallyAppliedGlobalSlice C# (CSharp) Метод

TestPartiallyAppliedGlobalSlice() приватный Метод

private TestPartiallyAppliedGlobalSlice ( ) : void
Результат void
        public virtual void TestPartiallyAppliedGlobalSlice()
        {
            DocumentsWriterDeleteQueue queue = new DocumentsWriterDeleteQueue();
            System.Reflection.FieldInfo field = typeof(DocumentsWriterDeleteQueue).GetField("GlobalBufferLock", 
                BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);
            ReentrantLock @lock = (ReentrantLock)field.GetValue(queue);
            @lock.Lock();
            ThreadClass t = new ThreadAnonymousInnerClassHelper(this, queue);
            t.Start();
            t.Join();
            @lock.Unlock();
            Assert.IsTrue(queue.AnyChanges(), "changes in del queue but not in slice yet");
            queue.TryApplyGlobalSlice();
            Assert.IsTrue(queue.AnyChanges(), "changes in global buffer");
            FrozenBufferedUpdates freezeGlobalBuffer = queue.FreezeGlobalBuffer(null);
            Assert.IsTrue(freezeGlobalBuffer.Any());
            Assert.AreEqual(1, freezeGlobalBuffer.TermCount);
            Assert.IsFalse(queue.AnyChanges(), "all changes applied");
        }