コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void dynamicRecordCursorReadsInUseRecords()
        public virtual void DynamicRecordCursorReadsInUseRecords()
        {
            using (AbstractDynamicStore store = NewTestableDynamicStore())
            {
                DynamicRecord first  = CreateDynamicRecord(1, store, 0);
                DynamicRecord second = CreateDynamicRecord(2, store, 0);
                DynamicRecord third  = CreateDynamicRecord(3, store, 10);
                store.HighId = 3;

                first.NextBlock = second.Id;
                store.UpdateRecord(first);
                second.NextBlock = third.Id;
                store.UpdateRecord(second);

                IEnumerator <DynamicRecord> records = store.GetRecords(1, NORMAL).GetEnumerator();
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                assertTrue(records.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                assertEquals(first, records.next());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                assertTrue(records.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                assertEquals(second, records.next());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                assertTrue(records.hasNext());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                assertEquals(third, records.next());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                assertFalse(records.hasNext());
            }
        }
コード例 #2
0
        private DynamicRecord CreateDynamicRecord(long id, AbstractDynamicStore store, int dataSize)
        {
            DynamicRecord first = new DynamicRecord(id);

            first.InUse = true;
            first.Data  = RandomUtils.NextBytes(dataSize == 0 ? BLOCK_SIZE - _formats.dynamic().RecordHeaderSize : 10);
            store.UpdateRecord(first);
            return(first);
        }