use of org.neo4j.io.pagecache.impl.ByteBufferPage in project neo4j by neo4j.
the class PageSwapperTest method vectoredReadMustNotReopenExplicitlyClosedChannel.
@Test
public void vectoredReadMustNotReopenExplicitlyClosedChannel() throws Exception {
String filename = "a";
File file = file(filename);
ByteBufferPage page = createPage();
PageSwapperFactory swapperFactory = createSwapperFactory();
PageSwapper swapper = createSwapperAndFile(swapperFactory, file);
swapper.write(0, page);
swapper.close();
try {
swapper.read(0, new Page[] { page }, 0, 1);
fail("Should have thrown because the channel should be closed");
} catch (ClosedChannelException ignore) {
// This is fine.
}
}
Aggregations