Search in sources :

Example 6 with CachingExpandInto

use of org.neo4j.internal.kernel.api.helpers.CachingExpandInto in project neo4j by neo4j.

the class CachingExpandIntoTest method shouldRecomputeIfSameNodesAndTypesIfCacheIsFull.

@Test
void shouldRecomputeIfSameNodesAndTypesIfCacheIsFull() throws Exception {
    // Given
    CachingExpandInto expandInto = new CachingExpandInto(mock(Read.class), OUTGOING, memoryTracker, 0, true);
    findConnections(expandInto, mockCursor(), 42, 43, 100, 101);
    NodeCursor cursor = mockCursor();
    // When
    findConnections(expandInto, cursor, 42, 43, 100, 101);
    // Then
    verify(cursor, atLeastOnce()).next();
    assertReleasesHeap(expandInto);
}
Also used : Read(org.neo4j.internal.kernel.api.Read) CachingExpandInto(org.neo4j.internal.kernel.api.helpers.CachingExpandInto) NodeCursor(org.neo4j.internal.kernel.api.NodeCursor) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)6 NodeCursor (org.neo4j.internal.kernel.api.NodeCursor)6 Read (org.neo4j.internal.kernel.api.Read)6 CachingExpandInto (org.neo4j.internal.kernel.api.helpers.CachingExpandInto)6 RelationshipSelection (org.neo4j.storageengine.api.RelationshipSelection)4