use of org.junit.jupiter.params.provider.MethodSource in project neo4j by neo4j.
the class FulltextProceduresTest method queryResultsMustIncludeUpdatedValueOfChangedProperties.
@MethodSource("entityTypeProvider")
@ParameterizedTest
void queryResultsMustIncludeUpdatedValueOfChangedProperties(EntityUtil entityUtil) {
createIndexAndWait(entityUtil);
long entityId;
try (Transaction tx = db.beginTx()) {
entityId = entityUtil.createEntityWithProperty(tx, "primo");
tx.commit();
}
entityUtil.assertQueryFindsIdsInOrder(db, "primo", entityId);
try (Transaction tx = db.beginTx()) {
entityUtil.getEntity(tx, entityId).setProperty(PROP, "secundo");
tx.commit();
}
entityUtil.assertQueryFindsIdsInOrder(db, "primo");
entityUtil.assertQueryFindsIdsInOrder(db, "secundo", entityId);
}
use of org.junit.jupiter.params.provider.MethodSource in project neo4j by neo4j.
the class FulltextProceduresTest method mustSupportWildcardEndsLikeStartsWith.
@MethodSource("entityTypeProvider")
@ParameterizedTest
void mustSupportWildcardEndsLikeStartsWith(EntityUtil entityUtil) {
createIndexAndWait(entityUtil);
LongHashSet ids = new LongHashSet();
try (Transaction tx = db.beginTx()) {
ids.add(entityUtil.createEntityWithProperty(tx, "abcdef"));
ids.add(entityUtil.createEntityWithProperty(tx, "abcxyz"));
tx.commit();
}
entityUtil.assertQueryFindsIds(db, "abc*", ids);
}
use of org.junit.jupiter.params.provider.MethodSource in project neo4j by neo4j.
the class FulltextProceduresTest method queryResultsMustBeOrderedByScore.
@MethodSource("entityTypeProvider")
@ParameterizedTest
void queryResultsMustBeOrderedByScore(EntityUtil entityUtil) {
createIndexAndWait(entityUtil);
long firstId;
long secondId;
long thirdId;
try (Transaction tx = db.beginTx()) {
firstId = entityUtil.createEntityWithProperty(tx, "dude sweet dude sweet");
tx.commit();
}
try (Transaction tx = db.beginTx()) {
secondId = entityUtil.createEntityWithProperty(tx, "dude sweet");
tx.commit();
}
try (Transaction tx = db.beginTx()) {
thirdId = entityUtil.createEntityWithProperty(tx, "dude sweet dude dude dude sweet");
tx.commit();
}
entityUtil.assertQueryFindsIdsInOrder(db, "dude", thirdId, firstId, secondId);
}
use of org.junit.jupiter.params.provider.MethodSource in project neo4j by neo4j.
the class FulltextProceduresTest method creatingAndDroppingIndexesInSameTransactionMustNotThrow.
@MethodSource("entityTypeProvider")
@ParameterizedTest
void creatingAndDroppingIndexesInSameTransactionMustNotThrow(EntityUtil entityUtil) {
try (Transaction tx = db.beginTx()) {
entityUtil.createIndex(tx);
entityUtil.dropIndex(tx);
tx.commit();
}
awaitIndexesOnline();
try (Transaction tx = db.beginTx()) {
var result = tx.execute(SHOW_FULLTEXT_INDEXES);
assertThat(result.hasNext()).isFalse().as("Fulltext indexes should not be created");
tx.commit();
}
}
use of org.junit.jupiter.params.provider.MethodSource in project neo4j by neo4j.
the class FulltextProceduresTest method queryResultsMustNotIncludeEntitiesWithRemovedIndexedProperties.
@MethodSource("entityTypeProvider")
@ParameterizedTest
void queryResultsMustNotIncludeEntitiesWithRemovedIndexedProperties(EntityUtil entityUtil) {
createIndexAndWait(entityUtil);
long entityId;
try (Transaction tx = db.beginTx()) {
entityId = entityUtil.createEntityWithProperty(tx, "value");
tx.commit();
}
entityUtil.assertQueryFindsIdsInOrder(db, "value", entityId);
try (Transaction tx = db.beginTx()) {
entityUtil.getEntity(tx, entityId).removeProperty(PROP);
tx.commit();
}
entityUtil.assertQueryFindsIdsInOrder(db, "value");
}
Aggregations