//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldNotMessUpUnrelatedSegmentOnReadBytes() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ShouldNotMessUpUnrelatedSegmentOnReadBytes()
        {
            // Given
            sbyte[] buf  = new sbyte[4];
            sbyte[] page = new sbyte[] { 7 };
            AdversarialReadPageCursor cursor = new AdversarialReadPageCursor(new ByteArrayPageCursor(page), new PageCacheRule.AtomicBooleanInconsistentReadAdversary(new AtomicBoolean(true)));

            // When
            cursor.Next(0);
            cursor.GetBytes(buf, buf.Length - 1, 1);
            cursor.ShouldRetry();
            cursor.GetBytes(buf, buf.Length - 1, 1);

            // Then the range outside of buf.length-1, buf.length should be pristine
            assertEquals(0, buf[0]);
            assertEquals(0, buf[1]);
            assertEquals(0, buf[2]);
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.io.pagecache.PageCursor openLinkedCursor(long pageId) throws java.io.IOException
        public override PageCursor OpenLinkedCursor(long pageId)
        {
            return(_linkedCursor = new AdversarialReadPageCursor(Delegate.openLinkedCursor(pageId), _state));
        }
Exemplo n.º 3
0
 public override void Close()
 {
     Delegate.close();
     _linkedCursor = null;
 }