use of org.eclipse.collections.api.list.primitive.LongList in project neo4j by neo4j.
the class TokenIndexAccessorTest method readerShouldHandleNestedQueries.
@ParameterizedTest
@MethodSource("orderCombinations")
void readerShouldHandleNestedQueries(IndexOrder outerOrder, IndexOrder innerOrder) throws Exception {
int outerTokenId = 1;
int innerTokenId = 2;
long[] outerIds = new long[] { 1, 2, 3, 64, 65, 1000, 2001 };
long[] innerIds = new long[] { 1, 2, 4, 64, 66, 1000, 2000 };
LongList outerExpectedIds = LongLists.immutable.of(outerIds);
LongList innerExpectedIds = LongLists.immutable.of(innerIds);
addToIndex(outerTokenId, outerIds);
addToIndex(innerTokenId, innerIds);
try (var reader = accessor.newTokenReader()) {
assertReaderFindsExpected(reader, outerOrder, outerTokenId, outerExpectedIds, indexReader -> assertReaderFindsExpected(indexReader, innerOrder, innerTokenId, innerExpectedIds, ThrowingConsumer.noop()));
}
}
use of org.eclipse.collections.api.list.primitive.LongList in project neo4j by neo4j.
the class TokenIndexAccessorTest method readerShouldFindManyWithNoOtherTokens.
@ParameterizedTest
@EnumSource(IndexOrder.class)
void readerShouldFindManyWithNoOtherTokens(IndexOrder indexOrder) throws Exception {
// Given
int tokenId = 1;
long[] entityIds = new long[] { 1, 2, 3, 64, 65, 1000, 2000 };
addToIndex(tokenId, entityIds);
LongList expectedIds = LongLists.immutable.of(entityIds);
// When
assertReaderFindsExpected(indexOrder, tokenId, expectedIds);
}
use of org.eclipse.collections.api.list.primitive.LongList in project neo4j by neo4j.
the class TokenIndexAccessorTest method readerShouldFindSingleWithNoOtherTokens.
@Test
void readerShouldFindSingleWithNoOtherTokens() throws Exception {
// Given
int tokenId = 1;
long entityId = 1;
addToIndex(tokenId, entityId);
LongList expectedIds = LongLists.immutable.of(entityId);
// When
assertReaderFindsExpected(tokenId, expectedIds);
}
use of org.eclipse.collections.api.list.primitive.LongList in project neo4j by neo4j.
the class TokenIndexAccessorTest method readerShouldFindSingleWithOtherTokens.
@Test
void readerShouldFindSingleWithOtherTokens() throws Exception {
// Given
int tokenId = 1;
long entityId = 1;
addToIndex(tokenId, entityId);
addToIndex(2, 2);
LongList expectedIds = LongLists.immutable.of(entityId);
// When
assertReaderFindsExpected(tokenId, expectedIds);
}
Aggregations