use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class NodeInUseWithCorrectLabelsCheckTest method shouldRemainSilentWhenEverythingIsInOrder.
@Test
public void shouldRemainSilentWhenEverythingIsInOrder() throws Exception {
// given
int nodeId = 42;
int labelId = 7;
NodeRecord node = withInlineLabels(inUse(new NodeRecord(nodeId, false, 0, 0)), labelId);
ConsistencyReport.LabelScanConsistencyReport report = mock(ConsistencyReport.LabelScanConsistencyReport.class);
// when
checker(new long[] { labelId }, true).checkReference(null, node, engineFor(report), null);
// then
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class NodeInUseWithCorrectLabelsCheckTest method shouldReportNodeWithoutExpectedLabelWhenLabelsAreInlineBothDirections.
@Test
public void shouldReportNodeWithoutExpectedLabelWhenLabelsAreInlineBothDirections() throws Exception {
// given
int nodeId = 42;
long[] storeLabelIds = new long[] { 7, 9 };
long[] indexLabelIds = new long[] { 9, 10 };
NodeRecord node = inUse(withInlineLabels(new NodeRecord(nodeId, false, 0, 0), storeLabelIds));
ConsistencyReport.LabelScanConsistencyReport report = mock(ConsistencyReport.LabelScanConsistencyReport.class);
// when
checker(indexLabelIds, true).checkReference(null, node, engineFor(report), null);
// then
verify(report).nodeDoesNotHaveExpectedLabel(node, 10);
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class OwnerCheckTest method shouldNotReportAnythingForNodesWithDifferentPropertyChains.
@Test
public void shouldNotReportAnythingForNodesWithDifferentPropertyChains() throws Exception {
// given
OwnerCheck decorator = new OwnerCheck(true);
RecordCheck<NodeRecord, ConsistencyReport.NodeConsistencyReport> nodeChecker = decorator.decorateNodeChecker(dummyNodeCheck());
RecordAccessStub records = new RecordAccessStub();
NodeRecord node1 = records.add(inUse(new NodeRecord(1, false, NONE, 7)));
NodeRecord node2 = records.add(inUse(new NodeRecord(2, false, NONE, 8)));
// when
ConsistencyReport.NodeConsistencyReport report1 = check(ConsistencyReport.NodeConsistencyReport.class, nodeChecker, node1, records);
ConsistencyReport.NodeConsistencyReport report2 = check(ConsistencyReport.NodeConsistencyReport.class, nodeChecker, node2, records);
// then
verifyZeroInteractions(report1);
verifyZeroInteractions(report2);
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportRelationshipGroupChainInconsistencies.
@Test
public void shouldReportRelationshipGroupChainInconsistencies() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
long node = next.node();
long group = next.relationshipGroup();
tx.create(inUse(new NodeRecord(node, true, group, NO_NEXT_PROPERTY.intValue())));
tx.create(withOwner(withNext(inUse(new RelationshipGroupRecord(group, C)), group + 1), node));
}
});
// when
ConsistencySummaryStatistics stats = check();
// then
on(stats).verify(RecordType.RELATIONSHIP_GROUP, 1).andThatsAllFolks();
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class FullCheckIntegrationTest method shouldReportFirstRelationshipGroupOwnerInconsistency.
@Test
public void shouldReportFirstRelationshipGroupOwnerInconsistency() throws Exception {
// given
fixture.apply(new GraphStoreFixture.Transaction() {
@Override
protected void transactionData(GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next) {
// node -[first]-> group -[owner]-> otherNode
long node = next.node();
long otherNode = next.node();
long group = next.relationshipGroup();
tx.create(inUse(new NodeRecord(node, true, group, NO_NEXT_PROPERTY.intValue())));
tx.create(inUse(new NodeRecord(otherNode, false, NO_NEXT_RELATIONSHIP.intValue(), NO_NEXT_PROPERTY.intValue())));
tx.create(withOwner(inUse(new RelationshipGroupRecord(group, C)), otherNode));
}
});
// when
ConsistencySummaryStatistics stats = check();
// then
// - next group has other owner that its previous
// - first group has other owner
on(stats).verify(RecordType.NODE, 1).andThatsAllFolks();
}
Aggregations