use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method retryMustClearTheOutOfBoundsFlags.
@Test
public void retryMustClearTheOutOfBoundsFlags() throws Exception {
PageCursor pageCursor = CompositePageCursor.compose(first, PAGE_SIZE, second, PAGE_SIZE);
first.raiseOutOfBounds();
second.raiseOutOfBounds();
pageCursor.raiseOutOfBounds();
first.setNeedsRetry(true);
pageCursor.shouldRetry();
assertFalse(first.checkAndClearBoundsFlag());
assertFalse(second.checkAndClearBoundsFlag());
assertFalse(pageCursor.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method getShortMustHitFirstCursorBeforeFlip.
@Test
public void getShortMustHitFirstCursorBeforeFlip() throws Exception {
PageCursor c = CompositePageCursor.compose(first, 2, second, 2);
assertThat(c.getShort(), is((short) 0xA0A1));
assertFalse(c.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method getShortWithOffsetMustHitCorrectCursors.
@Test
public void getShortWithOffsetMustHitCorrectCursors() throws Exception {
first.setOffset(1);
second.setOffset(2);
PageCursor c = CompositePageCursor.compose(first, 1 + 2, second, 2);
assertThat(c.getShort(1), is((short) 0xA2A3));
assertThat(c.getShort(1 + 2), is((short) 0xB2B3));
assertFalse(c.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method nextWithPageIdIsNotSupportedOperation.
@Test(expected = UnsupportedOperationException.class)
public void nextWithPageIdIsNotSupportedOperation() throws Exception {
PageCursor pageCursor = CompositePageCursor.compose(first, PAGE_SIZE, second, PAGE_SIZE);
pageCursor.next(12);
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method getBytesMustHitSecondCursorAfterFlip.
@Test
public void getBytesMustHitSecondCursorAfterFlip() throws Exception {
PageCursor c = CompositePageCursor.compose(first, 4, second, 4);
c.getBytes(bytes);
assertThat(bytes, byteArray(0xA0, 0xA1, 0xA2, 0xA3));
c.getBytes(bytes);
assertThat(bytes, byteArray(0xB0, 0xB1, 0xB2, 0xB3));
assertFalse(c.checkAndClearBoundsFlag());
}
Aggregations