Search in sources :

Example 6 with DEFAULT_DATABASE_NAME

use of org.neo4j.configuration.GraphDatabaseSettings.DEFAULT_DATABASE_NAME in project neo4j by neo4j.

the class NumberArrayTest method arrays.

public static Collection<NumberArrayTestData> arrays() {
    PageCache pageCache = fixture.pageCache;
    Path dir = fixture.directory;
    NullLog log = NullLog.getInstance();
    Collection<NumberArrayTestData> list = new ArrayList<>();
    Map<String, NumberArrayFactory> factories = new HashMap<>();
    factories.put("HEAP", NumberArrayFactories.HEAP);
    factories.put("OFF_HEAP", NumberArrayFactories.OFF_HEAP);
    factories.put("AUTO_WITHOUT_PAGECACHE", NumberArrayFactories.AUTO_WITHOUT_PAGECACHE);
    factories.put("CHUNKED_FIXED_SIZE", NumberArrayFactories.CHUNKED_FIXED_SIZE);
    factories.put("autoWithPageCacheFallback", NumberArrayFactories.auto(pageCache, NULL, dir, true, NO_MONITOR, log, DEFAULT_DATABASE_NAME));
    factories.put("PageCachedNumberArrayFactory", new PageCachedNumberArrayFactory(pageCache, NULL, dir, log, DEFAULT_DATABASE_NAME));
    for (Map.Entry<String, NumberArrayFactory> entry : factories.entrySet()) {
        String name = entry.getKey() + " => ";
        NumberArrayFactory factory = entry.getValue();
        list.add(arrayData(name + "IntArray", factory.newIntArray(INDEXES, -1, INSTANCE), random -> random.nextInt(1_000_000_000), (array, index, value) -> array.set(index, (Integer) value), IntArray::get));
        list.add(arrayData(name + "DynamicIntArray", factory.newDynamicIntArray(CHUNK_SIZE, -1, INSTANCE), random -> random.nextInt(1_000_000_000), (array, index, value) -> array.set(index, (Integer) value), IntArray::get));
        list.add(arrayData(name + "LongArray", factory.newLongArray(INDEXES, -1, INSTANCE), random -> random.nextLong(1_000_000_000), (array, index, value) -> array.set(index, (Long) value), LongArray::get));
        list.add(arrayData(name + "DynamicLongArray", factory.newDynamicLongArray(CHUNK_SIZE, -1, INSTANCE), random -> random.nextLong(1_000_000_000), (array, index, value) -> array.set(index, (Long) value), LongArray::get));
        list.add(arrayData(name + "ByteArray5", factory.newByteArray(INDEXES, defaultByteArray(5), INSTANCE), random -> random.nextInt(1_000_000_000), (array, index, value) -> array.setInt(index, 1, (Integer) value), (array, index) -> array.getInt(index, 1)));
        list.add(arrayData(name + "DynamicByteArray5", factory.newDynamicByteArray(CHUNK_SIZE, defaultByteArray(5), INSTANCE), random -> random.nextInt(1_000_000_000), (array, index, value) -> array.setInt(index, 1, (Integer) value), (array, index) -> array.getInt(index, 1)));
        Function<RandomRule, Object> valueGenerator = random -> new long[] { random.nextLong(), random.nextInt(), (short) random.nextInt(), (byte) random.nextInt() };
        Writer<ByteArray> writer = (array, index, value) -> {
            long[] values = (long[]) value;
            array.setLong(index, 0, values[0]);
            array.setInt(index, 8, (int) values[1]);
            array.setShort(index, 12, (short) values[2]);
            array.setByte(index, 14, (byte) values[3]);
        };
        Reader<ByteArray> reader = (array, index) -> new long[] { array.getLong(index, 0), array.getInt(index, 8), array.getShort(index, 12), array.getByte(index, 14) };
        list.add(arrayData(name + "ByteArray15", factory.newByteArray(INDEXES, defaultByteArray(15), INSTANCE), valueGenerator, writer, reader));
        list.add(arrayData(name + "DynamicByteArray15", factory.newDynamicByteArray(CHUNK_SIZE, defaultByteArray(15), INSTANCE), valueGenerator, writer, reader));
    }
    return list;
}
Also used : Path(java.nio.file.Path) PageCache(org.neo4j.io.pagecache.PageCache) Arrays(java.util.Arrays) TestFactory(org.junit.jupiter.api.TestFactory) Collection(java.util.Collection) IOException(java.io.IOException) HashMap(java.util.HashMap) NULL(org.neo4j.io.pagecache.tracing.PageCacheTracer.NULL) Function(java.util.function.Function) NO_MONITOR(org.neo4j.internal.batchimport.cache.NumberArrayFactories.NO_MONITOR) ArrayList(java.util.ArrayList) AfterAll(org.junit.jupiter.api.AfterAll) Assertions.assertArrayEquals(org.junit.jupiter.api.Assertions.assertArrayEquals) Integer.max(java.lang.Integer.max) DEFAULT_DATABASE_NAME(org.neo4j.configuration.GraphDatabaseSettings.DEFAULT_DATABASE_NAME) INSTANCE(org.neo4j.memory.EmptyMemoryTracker.INSTANCE) Stream(java.util.stream.Stream) BeforeAll(org.junit.jupiter.api.BeforeAll) RandomRule(org.neo4j.test.rule.RandomRule) Map(java.util.Map) DynamicTest(org.junit.jupiter.api.DynamicTest) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) NullLog(org.neo4j.logging.NullLog) Path(java.nio.file.Path) ThrowingConsumer(org.junit.jupiter.api.function.ThrowingConsumer) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) RandomRule(org.neo4j.test.rule.RandomRule) NullLog(org.neo4j.logging.NullLog) HashMap(java.util.HashMap) Map(java.util.Map) PageCache(org.neo4j.io.pagecache.PageCache)

Example 7 with DEFAULT_DATABASE_NAME

use of org.neo4j.configuration.GraphDatabaseSettings.DEFAULT_DATABASE_NAME in project neo4j by neo4j.

the class DatabaseFileListingTest method verifyLogFilesWithCustomPathListing.

private void verifyLogFilesWithCustomPathListing(Path path) throws IOException {
    DatabaseManagementService managementService = new TestDatabaseManagementServiceBuilder(testDirectory.homePath("customDb")).setConfig(GraphDatabaseSettings.transaction_logs_root_path, path).build();
    GraphDatabaseAPI graphDatabase = (GraphDatabaseAPI) managementService.database(DEFAULT_DATABASE_NAME);
    Database database = graphDatabase.getDependencyResolver().resolveDependency(Database.class);
    LogFiles logFiles = graphDatabase.getDependencyResolver().resolveDependency(LogFiles.class);
    assertTrue(database.listStoreFiles(true).stream().anyMatch(metadata -> metadata.isLogFile() && logFiles.isLogFile(metadata.path())));
    assertEquals(path.getFileName().toString(), logFiles.logFilesDirectory().getParent().getFileName().toString());
    managementService.shutdown();
}
Also used : IndexingService(org.neo4j.kernel.impl.api.index.IndexingService) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) BeforeEach(org.junit.jupiter.api.BeforeEach) LogFiles(org.neo4j.kernel.impl.transaction.log.files.LogFiles) ResourceIterator(org.neo4j.graphdb.ResourceIterator) StoreFileMetadata(org.neo4j.storageengine.api.StoreFileMetadata) IdGeneratorFactory(org.neo4j.internal.id.IdGeneratorFactory) GraphDatabaseSettings(org.neo4j.configuration.GraphDatabaseSettings) Resource(org.neo4j.graphdb.Resource) Mockito.spy(org.mockito.Mockito.spy) DatabaseLayout(org.neo4j.io.layout.DatabaseLayout) ArrayList(java.util.ArrayList) DEFAULT_DATABASE_NAME(org.neo4j.configuration.GraphDatabaseSettings.DEFAULT_DATABASE_NAME) TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) Inject(org.neo4j.test.extension.Inject) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Path(java.nio.file.Path) DEFAULT_FILENAME_FILTER(org.neo4j.kernel.impl.transaction.log.files.TransactionLogFiles.DEFAULT_FILENAME_FILTER) Files(java.nio.file.Files) Iterators(org.neo4j.internal.helpers.collection.Iterators) StorageEngine(org.neo4j.storageengine.api.StorageEngine) Collection(java.util.Collection) Set(java.util.Set) TestDirectory(org.neo4j.test.rule.TestDirectory) IOException(java.io.IOException) DbmsExtension(org.neo4j.test.extension.DbmsExtension) Mockito.when(org.mockito.Mockito.when) Collectors(java.util.stream.Collectors) File(java.io.File) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) UncheckedIOException(java.io.UncheckedIOException) List(java.util.List) Database(org.neo4j.kernel.database.Database) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) DatabaseManagementService(org.neo4j.dbms.api.DatabaseManagementService) Mockito.mock(org.mockito.Mockito.mock) Iterators.asResourceIterator(org.neo4j.internal.helpers.collection.Iterators.asResourceIterator) TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) Database(org.neo4j.kernel.database.Database) LogFiles(org.neo4j.kernel.impl.transaction.log.files.LogFiles) DatabaseManagementService(org.neo4j.dbms.api.DatabaseManagementService)

Example 8 with DEFAULT_DATABASE_NAME

use of org.neo4j.configuration.GraphDatabaseSettings.DEFAULT_DATABASE_NAME in project neo4j by neo4j.

the class TransactionEventsIT method shouldGetSpecifiedUsernameAndMetaDataInTXData.

@Test
void shouldGetSpecifiedUsernameAndMetaDataInTXData() {
    final AtomicReference<String> usernameRef = new AtomicReference<>();
    final AtomicReference<Map<String, Object>> metaDataRef = new AtomicReference<>();
    dbms.registerTransactionEventListener(DEFAULT_DATABASE_NAME, getBeforeCommitListener(txData -> {
        usernameRef.set(txData.username());
        metaDataRef.set(txData.metaData());
    }));
    AuthSubject subject = mock(AuthSubject.class);
    when(subject.username()).thenReturn("Christof");
    LoginContext loginContext = new LoginContext(subject, EMBEDDED_CONNECTION) {

        @Override
        public SecurityContext authorize(IdLookup idLookup, String dbName, AbstractSecurityLog securityLog) {
            return new SecurityContext(subject, AccessMode.Static.WRITE, EMBEDDED_CONNECTION, dbName);
        }
    };
    Map<String, Object> metadata = genericMap("username", "joe");
    runTransaction(loginContext, metadata);
    assertThat(usernameRef.get()).as("Should have specified username").isEqualTo("Christof");
    assertThat(metaDataRef.get()).as("Should have metadata with specified username").isEqualTo(metadata);
}
Also used : Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) Label(org.neo4j.graphdb.Label) AnonymousContext(org.neo4j.kernel.api.security.AnonymousContext) RandomExtension(org.neo4j.test.extension.RandomExtension) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) LoginContext(org.neo4j.internal.kernel.api.security.LoginContext) TransactionFailureException(org.neo4j.graphdb.TransactionFailureException) TransactionData(org.neo4j.graphdb.event.TransactionData) AuthSubject(org.neo4j.internal.kernel.api.security.AuthSubject) Iterators.count(org.neo4j.internal.helpers.collection.Iterators.count) AtomicReference(java.util.concurrent.atomic.AtomicReference) Node(org.neo4j.graphdb.Node) ArrayList(java.util.ArrayList) ImpermanentDbmsExtension(org.neo4j.test.extension.ImpermanentDbmsExtension) DEFAULT_DATABASE_NAME(org.neo4j.configuration.GraphDatabaseSettings.DEFAULT_DATABASE_NAME) Future(java.util.concurrent.Future) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) Inject(org.neo4j.test.extension.Inject) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) RandomRule(org.neo4j.test.rule.RandomRule) Map(java.util.Map) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) TransactionEventListenerAdapter(org.neo4j.graphdb.event.TransactionEventListenerAdapter) SecurityContext(org.neo4j.internal.kernel.api.security.SecurityContext) MapUtil.genericMap(org.neo4j.internal.helpers.collection.MapUtil.genericMap) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Transaction(org.neo4j.graphdb.Transaction) BinaryLatch(org.neo4j.util.concurrent.BinaryLatch) ExecutorService(java.util.concurrent.ExecutorService) EMBEDDED_CONNECTION(org.neo4j.internal.kernel.api.connectioninfo.ClientConnectionInfo.EMBEDDED_CONNECTION) AbstractSecurityLog(org.neo4j.internal.kernel.api.security.AbstractSecurityLog) ExceptionUtils.getRootCause(org.apache.commons.lang3.exception.ExceptionUtils.getRootCause) Mockito.when(org.mockito.Mockito.when) Executors(java.util.concurrent.Executors) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) Test(org.junit.jupiter.api.Test) Consumer(java.util.function.Consumer) TransactionEventListener(org.neo4j.graphdb.event.TransactionEventListener) AccessMode(org.neo4j.internal.kernel.api.security.AccessMode) List(java.util.List) Relationship(org.neo4j.graphdb.Relationship) KernelTransaction(org.neo4j.kernel.api.KernelTransaction) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) RelationshipType(org.neo4j.graphdb.RelationshipType) DatabaseManagementService(org.neo4j.dbms.api.DatabaseManagementService) Collections(java.util.Collections) Mockito.mock(org.mockito.Mockito.mock) AuthSubject(org.neo4j.internal.kernel.api.security.AuthSubject) AtomicReference(java.util.concurrent.atomic.AtomicReference) LoginContext(org.neo4j.internal.kernel.api.security.LoginContext) SecurityContext(org.neo4j.internal.kernel.api.security.SecurityContext) AbstractSecurityLog(org.neo4j.internal.kernel.api.security.AbstractSecurityLog) Map(java.util.Map) MapUtil.genericMap(org.neo4j.internal.helpers.collection.MapUtil.genericMap) Test(org.junit.jupiter.api.Test)

Example 9 with DEFAULT_DATABASE_NAME

use of org.neo4j.configuration.GraphDatabaseSettings.DEFAULT_DATABASE_NAME 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));
}
Also used : Path(java.nio.file.Path) BeforeEach(org.junit.jupiter.api.BeforeEach) NoSuchFileException(java.nio.file.NoSuchFileException) DatabaseReadOnlyChecker.readOnly(org.neo4j.configuration.helpers.DatabaseReadOnlyChecker.readOnly) RandomExtension(org.neo4j.test.extension.RandomExtension) CursorContext(org.neo4j.io.pagecache.context.CursorContext) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Random(java.util.Random) DefaultPageCacheTracer(org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer) ANY_LABEL(org.neo4j.token.api.TokenConstants.ANY_LABEL) ByteBuffer(java.nio.ByteBuffer) NO_MONITOR(org.neo4j.internal.counts.GBPTreeCountsStore.NO_MONITOR) DEFAULT_DATABASE_NAME(org.neo4j.configuration.GraphDatabaseSettings.DEFAULT_DATABASE_NAME) Future(java.util.concurrent.Future) StoreChannel(org.neo4j.io.fs.StoreChannel) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) RandomRule(org.neo4j.test.rule.RandomRule) Map(java.util.Map) Mockito.doAnswer(org.mockito.Mockito.doAnswer) PageCacheTracer(org.neo4j.io.pagecache.tracing.PageCacheTracer) NULL(org.neo4j.io.pagecache.context.CursorContext.NULL) Path(java.nio.file.Path) Exceptions(org.neo4j.internal.helpers.Exceptions) PageCache(org.neo4j.io.pagecache.PageCache) EMPTY_REBUILD(org.neo4j.internal.counts.GBPTreeGenericCountsStore.EMPTY_REBUILD) ArrayQueueOutOfOrderSequence(org.neo4j.util.concurrent.ArrayQueueOutOfOrderSequence) OtherThreadExecutor.command(org.neo4j.test.OtherThreadExecutor.command) DatabaseReadOnlyChecker.writable(org.neo4j.configuration.helpers.DatabaseReadOnlyChecker.writable) StandardOpenOption(java.nio.file.StandardOpenOption) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) TestDirectory(org.neo4j.test.rule.TestDirectory) String.format(java.lang.String.format) Test(org.junit.jupiter.api.Test) INSTANCE(org.neo4j.memory.EmptyMemoryTracker.INSTANCE) GBPTreeCountsStore.nodeKey(org.neo4j.internal.counts.GBPTreeCountsStore.nodeKey) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Rebuilder(org.neo4j.internal.counts.GBPTreeGenericCountsStore.Rebuilder) EMPTY_LONG_ARRAY(org.apache.commons.lang3.ArrayUtils.EMPTY_LONG_ARRAY) Race.throwing(org.neo4j.test.Race.throwing) MutableBoolean(org.apache.commons.lang3.mutable.MutableBoolean) DatabaseReadOnlyChecker(org.neo4j.configuration.helpers.DatabaseReadOnlyChecker) Assertions.assertDoesNotThrow(org.junit.jupiter.api.Assertions.assertDoesNotThrow) Mockito.mock(org.mockito.Mockito.mock) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) OutOfOrderSequence(org.neo4j.util.concurrent.OutOfOrderSequence) TreeFileNotFoundException(org.neo4j.index.internal.gbptree.TreeFileNotFoundException) HashMap(java.util.HashMap) MINUTES(java.util.concurrent.TimeUnit.MINUTES) BASE_TX_ID(org.neo4j.storageengine.api.TransactionIdStore.BASE_TX_ID) AtomicReference(java.util.concurrent.atomic.AtomicReference) ConcurrentMap(java.util.concurrent.ConcurrentMap) ReadOnlyDbException(org.neo4j.kernel.api.exceptions.ReadOnlyDbException) Inject(org.neo4j.test.extension.Inject) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) GBPTreeCountsStore.relationshipKey(org.neo4j.internal.counts.GBPTreeCountsStore.relationshipKey) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) OtherThreadExecutor(org.neo4j.test.OtherThreadExecutor) MemoryTracker(org.neo4j.memory.MemoryTracker) PageCacheExtension(org.neo4j.test.extension.pagecache.PageCacheExtension) IOException(java.io.IOException) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) AtomicLong(java.util.concurrent.atomic.AtomicLong) RecoveryCleanupWorkCollector.immediate(org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector.immediate) AfterEach(org.junit.jupiter.api.AfterEach) ANY_RELATIONSHIP_TYPE(org.neo4j.token.api.TokenConstants.ANY_RELATIONSHIP_TYPE) Race(org.neo4j.test.Race) FileSystemAbstraction(org.neo4j.io.fs.FileSystemAbstraction) ReadOnlyDbException(org.neo4j.kernel.api.exceptions.ReadOnlyDbException) TreeFileNotFoundException(org.neo4j.index.internal.gbptree.TreeFileNotFoundException) Test(org.junit.jupiter.api.Test)

Example 10 with DEFAULT_DATABASE_NAME

use of org.neo4j.configuration.GraphDatabaseSettings.DEFAULT_DATABASE_NAME 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));
}
Also used : Path(java.nio.file.Path) BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) DatabaseReadOnlyChecker.readOnly(org.neo4j.configuration.helpers.DatabaseReadOnlyChecker.readOnly) LongSupplier(java.util.function.LongSupplier) RandomExtension(org.neo4j.test.extension.RandomExtension) CursorContext(org.neo4j.io.pagecache.context.CursorContext) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Assertions.assertNotEquals(org.junit.jupiter.api.Assertions.assertNotEquals) Random(java.util.Random) Config(org.neo4j.configuration.Config) DefaultPageCacheTracer(org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer) MutableLongList(org.eclipse.collections.api.list.primitive.MutableLongList) DEFAULT_DATABASE_NAME(org.neo4j.configuration.GraphDatabaseSettings.DEFAULT_DATABASE_NAME) Future(java.util.concurrent.Future) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) RandomRule(org.neo4j.test.rule.RandomRule) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) IdValidator(org.neo4j.internal.id.IdValidator) NULL(org.neo4j.io.pagecache.context.CursorContext.NULL) Path(java.nio.file.Path) Exceptions(org.neo4j.internal.helpers.Exceptions) PageCache(org.neo4j.io.pagecache.PageCache) DatabaseReadOnlyChecker.writable(org.neo4j.configuration.helpers.DatabaseReadOnlyChecker.writable) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) TestDirectory(org.neo4j.test.rule.TestDirectory) Test(org.junit.jupiter.api.Test) IdType(org.neo4j.internal.id.IdType) Stream(java.util.stream.Stream) Sets.immutable(org.eclipse.collections.impl.factory.Sets.immutable) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) LongArrayList(org.eclipse.collections.impl.list.mutable.primitive.LongArrayList) Race.throwing(org.neo4j.test.Race.throwing) DatabaseReadOnlyChecker(org.neo4j.configuration.helpers.DatabaseReadOnlyChecker) Assertions.assertDoesNotThrow(org.junit.jupiter.api.Assertions.assertDoesNotThrow) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) Mockito.mock(org.mockito.Mockito.mock) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) Assertions.fail(org.junit.jupiter.api.Assertions.fail) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) GraphDatabaseSettings(org.neo4j.configuration.GraphDatabaseSettings) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TreeFileNotFoundException(org.neo4j.index.internal.gbptree.TreeFileNotFoundException) NO_FREE_IDS(org.neo4j.internal.id.FreeIds.NO_FREE_IDS) IDS_PER_ENTRY(org.neo4j.internal.id.indexed.IndexedIdGenerator.IDS_PER_ENTRY) LongList(org.eclipse.collections.api.list.primitive.LongList) FreeIds(org.neo4j.internal.id.FreeIds) Function(java.util.function.Function) ReadOnlyDbException(org.neo4j.kernel.api.exceptions.ReadOnlyDbException) Inject(org.neo4j.test.extension.Inject) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) OtherThreadExecutor(org.neo4j.test.OtherThreadExecutor) Sets(org.eclipse.collections.api.factory.Sets) IdCapacityExceededException(org.neo4j.internal.id.IdCapacityExceededException) ValueSource(org.junit.jupiter.params.provider.ValueSource) ReporterFactories.noopReporterFactory(org.neo4j.annotations.documented.ReporterFactories.noopReporterFactory) Barrier(org.neo4j.test.Barrier) PageCacheExtension(org.neo4j.test.extension.pagecache.PageCacheExtension) MutableLongIterator(org.eclipse.collections.api.iterator.MutableLongIterator) Iterator(java.util.Iterator) Collections.emptySet(java.util.Collections.emptySet) Files(java.nio.file.Files) IOException(java.io.IOException) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) RecoveryCleanupWorkCollector.immediate(org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector.immediate) AfterEach(org.junit.jupiter.api.AfterEach) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Executable(org.junit.jupiter.api.function.Executable) Marker(org.neo4j.internal.id.IdGenerator.Marker) IdRange(org.neo4j.internal.id.IdRange) Comparator(java.util.Comparator) Race(org.neo4j.test.Race) ReadOnlyDbException(org.neo4j.kernel.api.exceptions.ReadOnlyDbException) TreeFileNotFoundException(org.neo4j.index.internal.gbptree.TreeFileNotFoundException) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

DEFAULT_DATABASE_NAME (org.neo4j.configuration.GraphDatabaseSettings.DEFAULT_DATABASE_NAME)14 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)13 Test (org.junit.jupiter.api.Test)12 IOException (java.io.IOException)11 Assertions.assertTrue (org.junit.jupiter.api.Assertions.assertTrue)11 Inject (org.neo4j.test.extension.Inject)11 Path (java.nio.file.Path)10 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)9 PageCache (org.neo4j.io.pagecache.PageCache)9 RandomRule (org.neo4j.test.rule.RandomRule)9 TestDirectory (org.neo4j.test.rule.TestDirectory)9 ArrayList (java.util.ArrayList)8 Assertions.assertFalse (org.junit.jupiter.api.Assertions.assertFalse)8 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)8 Config (org.neo4j.configuration.Config)8 RandomExtension (org.neo4j.test.extension.RandomExtension)8 List (java.util.List)7 Set (java.util.Set)7 AfterEach (org.junit.jupiter.api.AfterEach)7 Assertions.assertThrows (org.junit.jupiter.api.Assertions.assertThrows)7