use of org.neo4j.kernel.api.exceptions.ReadOnlyDbException in project neo4j by neo4j.
the class IndexStatisticsStoreTest method shouldNotStartWithoutFileIfReadOnly.
@Test
void shouldNotStartWithoutFileIfReadOnly() {
final IndexStatisticsStore indexStatisticsStore = new IndexStatisticsStore(pageCache, testDirectory.file("non-existing"), immediate(), readOnly(), DEFAULT_DATABASE_NAME, PageCacheTracer.NULL);
final Exception e = assertThrows(Exception.class, indexStatisticsStore::init);
assertTrue(Exceptions.contains(e, t -> t instanceof ReadOnlyDbException));
assertTrue(Exceptions.contains(e, t -> t instanceof TreeFileNotFoundException));
assertTrue(Exceptions.contains(e, t -> t instanceof IllegalStateException));
}
use of org.neo4j.kernel.api.exceptions.ReadOnlyDbException in project neo4j by neo4j.
the class GBPTreeGenericCountsStoreTest method shouldNotStartWithoutFileIfReadOnly.
@Test
void shouldNotStartWithoutFileIfReadOnly() {
final Path file = directory.file("non-existing");
final IllegalStateException e = assertThrows(IllegalStateException.class, () -> new GBPTreeCountsStore(pageCache, file, fs, immediate(), CountsBuilder.EMPTY, readOnly(), PageCacheTracer.NULL, NO_MONITOR, DEFAULT_DATABASE_NAME, randomMaxCacheSize()));
assertTrue(Exceptions.contains(e, t -> t instanceof ReadOnlyDbException));
assertTrue(Exceptions.contains(e, t -> t instanceof TreeFileNotFoundException));
assertTrue(Exceptions.contains(e, t -> t instanceof IllegalStateException));
}
use of org.neo4j.kernel.api.exceptions.ReadOnlyDbException in project neo4j by neo4j.
the class IndexedIdGeneratorTest method shouldNotStartWithoutFileIfReadOnly.
@Test
void shouldNotStartWithoutFileIfReadOnly() {
Path file = directory.file("non-existing");
final IllegalStateException e = assertThrows(IllegalStateException.class, () -> new IndexedIdGenerator(pageCache, file, immediate(), IdType.LABEL_TOKEN, false, () -> 0, MAX_ID, readOnly(), Config.defaults(), DEFAULT_DATABASE_NAME, NULL));
assertTrue(Exceptions.contains(e, t -> t instanceof ReadOnlyDbException));
assertTrue(Exceptions.contains(e, t -> t instanceof TreeFileNotFoundException));
assertTrue(Exceptions.contains(e, t -> t instanceof IllegalStateException));
}
Aggregations