use of org.neo4j.consistency.store.RecordAccessStub in project neo4j by neo4j.
the class OwnerCheckTest method shouldNotReportAnythingForRelationshipsWithDifferentPropertyChains.
@Test
public void shouldNotReportAnythingForRelationshipsWithDifferentPropertyChains() throws Exception {
// given
OwnerCheck decorator = new OwnerCheck(true);
RecordCheck<RelationshipRecord, ConsistencyReport.RelationshipConsistencyReport> relationshipChecker = decorator.decorateRelationshipChecker(dummyRelationshipChecker());
RecordAccessStub records = new RecordAccessStub();
RelationshipRecord relationship1 = records.add(inUse(new RelationshipRecord(1, 0, 1, 0)));
relationship1.setNextProp(7);
RelationshipRecord relationship2 = records.add(inUse(new RelationshipRecord(2, 0, 1, 0)));
relationship2.setNextProp(8);
// when
ConsistencyReport.RelationshipConsistencyReport report1 = check(ConsistencyReport.RelationshipConsistencyReport.class, relationshipChecker, relationship1, records);
ConsistencyReport.RelationshipConsistencyReport report2 = check(ConsistencyReport.RelationshipConsistencyReport.class, relationshipChecker, relationship2, records);
// then
verifyZeroInteractions(report1);
verifyZeroInteractions(report2);
}
use of org.neo4j.consistency.store.RecordAccessStub in project neo4j by neo4j.
the class OwnerCheckTest method shouldReportOrphanPropertyChain.
@Test
public void shouldReportOrphanPropertyChain() throws Exception {
// given
RecordAccessStub records = new RecordAccessStub();
OwnerCheck decorator = new OwnerCheck(true);
RecordCheck<PropertyRecord, ConsistencyReport.PropertyConsistencyReport> checker = decorator.decoratePropertyChecker(dummyPropertyChecker());
PropertyRecord record = inUse(new PropertyRecord(42));
ConsistencyReport.PropertyConsistencyReport report = check(ConsistencyReport.PropertyConsistencyReport.class, checker, record, records);
// when
decorator.scanForOrphanChains(ProgressMonitorFactory.NONE);
records.checkDeferred();
// then
verify(report).orphanPropertyChain();
}
use of org.neo4j.consistency.store.RecordAccessStub in project neo4j by neo4j.
the class OwnerCheckTest method shouldReportTwoNodesWithSamePropertyChain.
@Test
public void shouldReportTwoNodesWithSamePropertyChain() 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, 7)));
// when
ConsistencyReport.NodeConsistencyReport report1 = check(ConsistencyReport.NodeConsistencyReport.class, nodeChecker, node1, records);
ConsistencyReport.NodeConsistencyReport report2 = check(ConsistencyReport.NodeConsistencyReport.class, nodeChecker, node2, records);
// then
verifyZeroInteractions(report1);
verify(report2).multipleOwners(node1);
}
Aggregations