use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportMismatchedInlinedLabels.
@Test
public void shouldReportMismatchedInlinedLabels() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
NodeRecord node = new NodeRecord(42, false, -1, -1);
node.setInUse(true);
node.setLabelField(inlinedLabelsLongRepresentation(label1, label2), Collections.<DynamicRecord>emptySet());
tx.create(node);
}
});
write(fixture.directStoreAccess().labelScanStore(), asList(labelChanges(42, new long[] { label1, label2 }, new long[] { label1 })));
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.LABEL_SCAN_DOCUMENT, 1).andThatsAllFolks();
}
use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportInlineNodeLabelInconsistencies.
@Test
public void shouldReportInlineNodeLabelInconsistencies() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
NodeRecord nodeRecord = new NodeRecord(next.node(), false, -1, -1);
NodeLabelsField.parseLabelsField(nodeRecord).add(10, null, null);
tx.create(nodeRecord);
}
});
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.NODE, 1).andThatsAllFolks();
}
use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportLabelScanStoreInconsistencies.
@Test
public void shouldReportLabelScanStoreInconsistencies() throws Exception {
// given
GraphStoreFixture.IdGenerator idGenerator = fixture.idGenerator();
long nodeId1 = idGenerator.node();
long labelId = idGenerator.label() - 1;
LabelScanStore labelScanStore = fixture.directStoreAccess().labelScanStore();
Iterable<NodeLabelUpdate> nodeLabelUpdates = asIterable(labelChanges(nodeId1, new long[] {}, new long[] { labelId }));
write(labelScanStore, nodeLabelUpdates);
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.LABEL_SCAN_DOCUMENT, 1).andThatsAllFolks();
}
use of org.neo4j.consistency.report.ConsistencySummaryStatistics in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportInvalidLabelIdInNodePropertyExistenceConstraintRule.
@Test
public void shouldReportInvalidLabelIdInNodePropertyExistenceConstraintRule() throws Exception {
// Given
int labelId = fixture.idGenerator().label();
int propertyKeyId = createPropertyKey();
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 shouldReportRelationshipGroupRelationshipOfOtherTypeInconsistencies.
@Test
public void shouldReportRelationshipGroupRelationshipOfOtherTypeInconsistencies() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
/*
* node -----> groupA
* |
* v
* otherNode <--> relB
*/
long node = next.node();
long otherNode = next.node();
long group = next.relationshipGroup();
long rel = next.relationship();
tx.create(new NodeRecord(node, true, group, NO_NEXT_PROPERTY.intValue()));
tx.create(new NodeRecord(otherNode, false, rel, NO_NEXT_PROPERTY.intValue()));
tx.create(new RelationshipRecord(rel, otherNode, otherNode, T));
tx.create(withOwner(withRelationships(new RelationshipGroupRecord(group, C), rel, rel, rel), node));
tx.incrementRelationshipCount(ANY_LABEL, ANY_RELATIONSHIP_TYPE, ANY_LABEL, 1);
tx.incrementRelationshipCount(ANY_LABEL, T, ANY_LABEL, 1);
}
});
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.RELATIONSHIP_GROUP, 3).andThatsAllFolks();
}
Aggregations