use of org.neo4j.consistency.report.ConsistencyReport.DynamicLabelConsistencyReport in project neo4j by neo4j.
the class NodeDynamicLabelOrphanChainStartCheckTest method shouldReportMissingOwnerId.
@Test
public void shouldReportMissingOwnerId() throws Exception {
// given
DynamicRecord record = new DynamicRecord(0);
inUse(record);
allocateFromNumbers(new ArrayList<>(), new long[] {}, new ReusableRecordsAllocator(66, record));
// when
DynamicLabelConsistencyReport report = check(record);
// then
verify(report).orphanDynamicLabelRecord();
}
use of org.neo4j.consistency.report.ConsistencyReport.DynamicLabelConsistencyReport in project neo4j by neo4j.
the class NodeDynamicLabelOrphanChainStartCheckTest method shouldReportOwningNodeRecordNotInUse.
@Test
public void shouldReportOwningNodeRecordNotInUse() throws Exception {
// given
NodeRecord nodeRecord = notInUse(new NodeRecord(12L, false, -1, -1));
add(nodeRecord);
DynamicRecord nodeDynamicLabelRecord = inUse(new DynamicRecord(0));
allocateFromNumbers(new ArrayList<>(), new long[] { 12L }, new ReusableRecordsAllocator(66, nodeDynamicLabelRecord));
// when
DynamicLabelConsistencyReport report = check(nodeDynamicLabelRecord);
// then
verify(report).orphanDynamicLabelRecordDueToInvalidOwner(nodeRecord);
}
use of org.neo4j.consistency.report.ConsistencyReport.DynamicLabelConsistencyReport in project neo4j by neo4j.
the class NodeDynamicLabelOrphanChainStartCheckTest method shouldReportOwningNodeRecordNotPointingBack.
@Test
public void shouldReportOwningNodeRecordNotPointingBack() throws Exception {
// given
long nodeId = 12L;
Collection<DynamicRecord> validLabelRecords = new ArrayList<>();
DynamicRecord dynamicRecord = inUse(new DynamicRecord(0));
allocateFromNumbers(validLabelRecords, new long[] { nodeId }, new ReusableRecordsAllocator(66, dynamicRecord));
Collection<DynamicRecord> fakePointedToRecords = new ArrayList<>();
DynamicRecord dynamicRecord1 = inUse(new DynamicRecord(1));
allocateFromNumbers(fakePointedToRecords, new long[] { nodeId }, new ReusableRecordsAllocator(66, dynamicRecord1));
NodeRecord nodeRecord = inUse(new NodeRecord(nodeId, false, -1, -1));
nodeRecord.setLabelField(dynamicPointer(fakePointedToRecords), fakePointedToRecords);
add(nodeRecord);
// when
DynamicLabelConsistencyReport report = check(Iterators.single(validLabelRecords.iterator()));
// then
verify(report).orphanDynamicLabelRecordDueToInvalidOwner(nodeRecord);
}
Aggregations