use of org.neo4j.storageengine.api.StorageSchemaReader in project neo4j by neo4j.
the class RecordStorageReaderSchemaTest method shouldListAllConstraintsAtTimeOfSnapshot.
@Test
void shouldListAllConstraintsAtTimeOfSnapshot() throws Exception {
// Given
createUniquenessConstraint(label1, propertyKey);
// When
StorageSchemaReader snapshot = storageReader.schemaSnapshot();
createUniquenessConstraint(label2, propertyKey);
Set<ConstraintDescriptor> constraints = asSet(snapshot.constraintsGetAll());
// Then
Set<ConstraintDescriptor> expectedConstraints = asSet(uniqueConstraintDescriptor(label1, propertyKey));
assertEquals(expectedConstraints, constraints);
}
use of org.neo4j.storageengine.api.StorageSchemaReader in project neo4j by neo4j.
the class RecordStorageReaderSchemaTest method shouldListAllIndexesAtTimeOfSnapshot.
@Test
void shouldListAllIndexesAtTimeOfSnapshot() throws Exception {
// Given
IndexDescriptor expectedIndex = createIndex(label1, propertyKey);
// When
StorageSchemaReader snapshot = storageReader.schemaSnapshot();
createIndex(label2, propertyKey);
Set<IndexDescriptor> indexes = asSet(snapshot.indexesGetAll());
// Then
assertEquals(asSet(expectedIndex), indexes);
}
use of org.neo4j.storageengine.api.StorageSchemaReader in project neo4j by neo4j.
the class RecordStorageReaderSchemaTest method shouldListAllIndexesForLabelAtTimeOfSnapshot.
@Test
void shouldListAllIndexesForLabelAtTimeOfSnapshot() throws Exception {
// Given
IndexDescriptor expectedUniquenessIndex = createUniquenessConstraint(label1, propertyKey);
IndexDescriptor expectedIndex = createIndex(label1, otherPropertyKey);
createUniquenessConstraint(label2, propertyKey);
createIndex(label2, otherPropertyKey);
// When
StorageSchemaReader snapshot = storageReader.schemaSnapshot();
Set<IndexDescriptor> indexes = asSet(snapshot.indexesGetForLabel(labelId(label1)));
// Then
Set<IndexDescriptor> expectedIndexes = asSet(expectedIndex, expectedUniquenessIndex);
assertEquals(expectedIndexes, indexes);
}
Aggregations