use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method putByteArrayBeyondEndOfViewMustRaiseBoundsFlag.
@Test
public void putByteArrayBeyondEndOfViewMustRaiseBoundsFlag() throws Exception {
PageCursor pageCursor = CompositePageCursor.compose(first, PAGE_SIZE, second, PAGE_SIZE);
for (int i = 0; i < 3 * PAGE_SIZE; i++) {
pageCursor.putBytes(bytes);
}
assertTrue(pageCursor.checkAndClearBoundsFlag());
assertFalse(pageCursor.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method getIntOffsettedBeyondEndOfViewMustRaiseBoundsFlag.
@Test
public void getIntOffsettedBeyondEndOfViewMustRaiseBoundsFlag() throws Exception {
PageCursor pageCursor = CompositePageCursor.compose(first, PAGE_SIZE, second, PAGE_SIZE);
for (int i = 0; i < 3 * PAGE_SIZE; i++) {
pageCursor.getInt(i);
}
assertTrue(pageCursor.checkAndClearBoundsFlag());
assertFalse(pageCursor.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method getLongBeyondEndOfViewMustRaiseBoundsFlag.
@Test
public void getLongBeyondEndOfViewMustRaiseBoundsFlag() throws Exception {
PageCursor pageCursor = CompositePageCursor.compose(first, PAGE_SIZE, second, PAGE_SIZE);
for (int i = 0; i < 3 * PAGE_SIZE; i++) {
pageCursor.getLong();
}
assertTrue(pageCursor.checkAndClearBoundsFlag());
assertFalse(pageCursor.checkAndClearBoundsFlag());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method retryShouldCheckAndResetBothCursors.
@Test
public void retryShouldCheckAndResetBothCursors() throws Exception {
PageCursor pageCursor = CompositePageCursor.compose(first, PAGE_SIZE, second, PAGE_SIZE);
assertFalse(pageCursor.shouldRetry());
first.setNeedsRetry(true);
assertTrue(pageCursor.shouldRetry());
first.setNeedsRetry(false);
assertFalse(pageCursor.shouldRetry());
second.setNeedsRetry(true);
assertTrue(pageCursor.shouldRetry());
}
use of org.neo4j.io.pagecache.PageCursor in project neo4j by neo4j.
the class CompositePageCursorTest method putBytesMustHitFirstCursorBeforeFlip.
@Test
public void putBytesMustHitFirstCursorBeforeFlip() throws Exception {
PageCursor c = CompositePageCursor.compose(first, 4, second, 4);
c.putBytes(new byte[] { 1, 2, 3, 4 });
c.setOffset(0);
c.getBytes(bytes);
assertThat(bytes, byteArray(1, 2, 3, 4));
assertFalse(c.checkAndClearBoundsFlag());
}
Aggregations