Search in sources :

Example 21 with DirectoryNotEmptyException

use of java.nio.file.DirectoryNotEmptyException in project neo4j by neo4j.

the class BatchingNeoStoresTest method shouldNotOpenStoreWithNodesOrRelationshipsInIt.

@Test
void shouldNotOpenStoreWithNodesOrRelationshipsInIt() throws Throwable {
    Config config = Config.defaults();
    // GIVEN
    someDataInTheDatabase(config);
    // WHEN
    DirectoryNotEmptyException exception = assertThrows(DirectoryNotEmptyException.class, () -> {
        try (JobScheduler jobScheduler = new ThreadPoolJobScheduler()) {
            RecordFormats recordFormats = selectForConfig(Config.defaults(), NullLogProvider.getInstance());
            try (BatchingNeoStores store = batchingNeoStores(fileSystem, databaseLayout, recordFormats, Configuration.DEFAULT, NullLogService.getInstance(), EMPTY, Config.defaults(), jobScheduler, PageCacheTracer.NULL, INSTANCE)) {
                store.createNew();
            }
        }
    });
    assertThat(exception.getMessage()).contains("already contains");
}
Also used : JobScheduler(org.neo4j.scheduler.JobScheduler) ThreadPoolJobScheduler(org.neo4j.test.scheduler.ThreadPoolJobScheduler) RecordFormats(org.neo4j.kernel.impl.store.format.RecordFormats) ForcedSecondaryUnitRecordFormats(org.neo4j.kernel.impl.store.format.ForcedSecondaryUnitRecordFormats) Config(org.neo4j.configuration.Config) RecordFormatSelector.selectForConfig(org.neo4j.kernel.impl.store.format.RecordFormatSelector.selectForConfig) DirectoryNotEmptyException(java.nio.file.DirectoryNotEmptyException) ThreadPoolJobScheduler(org.neo4j.test.scheduler.ThreadPoolJobScheduler) Test(org.junit.jupiter.api.Test)

Aggregations

DirectoryNotEmptyException (java.nio.file.DirectoryNotEmptyException)21 NoSuchFileException (java.nio.file.NoSuchFileException)12 IOException (java.io.IOException)10 FileAlreadyExistsException (java.nio.file.FileAlreadyExistsException)8 Path (java.nio.file.Path)8 AccessDeniedException (java.nio.file.AccessDeniedException)6 AtomicMoveNotSupportedException (java.nio.file.AtomicMoveNotSupportedException)6 NotDirectoryException (java.nio.file.NotDirectoryException)6 FileSystemException (java.nio.file.FileSystemException)5 FileNotFoundException (java.io.FileNotFoundException)4 FileSystemLoopException (java.nio.file.FileSystemLoopException)4 EOFException (java.io.EOFException)3 File (java.io.File)3 CorruptIndexException (org.apache.lucene.index.CorruptIndexException)3 IndexFormatTooNewException (org.apache.lucene.index.IndexFormatTooNewException)3 IndexFormatTooOldException (org.apache.lucene.index.IndexFormatTooOldException)3 AlreadyClosedException (org.apache.lucene.store.AlreadyClosedException)3 LockObtainFailedException (org.apache.lucene.store.LockObtainFailedException)3 MCRDirectory (org.mycore.datamodel.ifs.MCRDirectory)3 MCRPath (org.mycore.datamodel.niofs.MCRPath)3