Search in sources :

Example 6 with CursorException

use of org.neo4j.io.pagecache.CursorException in project neo4j by neo4j.

the class CompositePageCursorTest method checkAndClearCursorErrorMustThrowIfFirstCursorHasError.

@Test
public void checkAndClearCursorErrorMustThrowIfFirstCursorHasError() throws Exception {
    PageCursor cursor = CompositePageCursor.compose(first, PAGE_SIZE, second, PAGE_SIZE);
    first.setCursorException("boo");
    try {
        cursor.checkAndClearCursorException();
        fail("composite cursor checkAndClearCursorError should have thrown");
    } catch (CursorException e) {
        assertThat(e.getMessage(), is("boo"));
    }
}
Also used : CursorException(org.neo4j.io.pagecache.CursorException) PageCursor(org.neo4j.io.pagecache.PageCursor) StubPageCursor(org.neo4j.io.pagecache.StubPageCursor) Test(org.junit.Test)

Aggregations

CursorException (org.neo4j.io.pagecache.CursorException)6 PageCursor (org.neo4j.io.pagecache.PageCursor)6 Test (org.junit.Test)5 StubPageCursor (org.neo4j.io.pagecache.StubPageCursor)4 MutableLong (org.apache.commons.lang3.mutable.MutableLong)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1