use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportPropertyInconsistencies.
@Test
public void shouldReportPropertyInconsistencies() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
NodeRecord node = new NodeRecord(next.node());
PropertyRecord property = new PropertyRecord(next.property());
node.setNextProp(property.getId());
// Mess up the prev/next pointers a bit
property.setNextProp(1_000);
PropertyBlock block = new PropertyBlock();
block.setSingleBlock(next.propertyKey() | (((long) PropertyType.INT.intValue()) << 24) | (666L << 28));
property.addPropertyBlock(block);
tx.create(node);
tx.create(property);
}
});
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.PROPERTY, 2).verify(RecordType.NODE, 1).andThatsAllFolks();
}
use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportDuplicatedUniquenessConstraintRules.
@Test
public void shouldReportDuplicatedUniquenessConstraintRules() throws Exception {
// Given
int labelId = createLabel();
int propertyKeyId = createPropertyKey();
createUniquenessConstraintRule(labelId, propertyKeyId);
createUniquenessConstraintRule(labelId, propertyKeyId);
// When
ConsistencySummaryStatistics stats = check();
// Then
// pair of duplicated indexes & pair of duplicated constraints
on(stats).verify(RecordType.SCHEMA, 2).andThatsAllFolks();
}
use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportInvalidPropertyKeyIdInNodePropertyExistenceConstraintRule.
@Test
public void shouldReportInvalidPropertyKeyIdInNodePropertyExistenceConstraintRule() throws Exception {
// Given
int labelId = createLabel();
int propertyKeyId = fixture.idGenerator().propertyKey();
createNodePropertyExistenceConstraint(labelId, propertyKeyId);
// When
ConsistencySummaryStatistics stats = check();
// Then
on(stats).verify(RecordType.SCHEMA, 1).andThatsAllFolks();
}
use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportRelationshipOtherNodeInconsistencies.
@Test
public void shouldReportRelationshipOtherNodeInconsistencies() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
long node1 = next.node();
long node2 = next.node();
long rel = next.relationship();
tx.create(inUse(new RelationshipRecord(rel, node1, node2, 0)));
tx.create(inUse(new NodeRecord(node1, false, rel + 1, -1)));
tx.create(inUse(new NodeRecord(node2, false, rel + 2, -1)));
}
});
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.RELATIONSHIP, 2).verify(RecordType.NODE, 2).verify(RecordType.COUNTS, 2).andThatsAllFolks();
}
use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportInvalidPropertyKeyIdInUniquenessConstraintRule.
@Test
public void shouldReportInvalidPropertyKeyIdInUniquenessConstraintRule() throws Exception {
// Given
int labelId = createLabel();
int propertyKeyId = fixture.idGenerator().propertyKey();
createUniquenessConstraintRule(labelId, propertyKeyId);
// When
ConsistencySummaryStatistics stats = check();
// Then
// invalid property key in both index & owning constraint
on(stats).verify(RecordType.SCHEMA, 2).andThatsAllFolks();
}
Aggregations