use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class NodeRecordCheckTest method shouldReportDuplicateDynamicLabels.
@Test
public void shouldReportDuplicateDynamicLabels() throws Exception {
// given
long[] labelIds = createLabels(100);
NodeRecord node = inUse(new NodeRecord(42, false, NONE, NONE));
add(node);
DynamicRecord labelsRecord1 = inUse(array(new DynamicRecord(1)));
DynamicRecord labelsRecord2 = inUse(array(new DynamicRecord(2)));
Collection<DynamicRecord> labelRecords = asList(labelsRecord1, labelsRecord2);
labelIds[12] = 11;
DynamicArrayStore.allocateFromNumbers(new ArrayList<>(), labelIds, new ReusableRecordsAllocator(52, labelRecords));
assertDynamicRecordChain(labelsRecord1, labelsRecord2);
node.setLabelField(DynamicNodeLabels.dynamicPointer(labelRecords), labelRecords);
addNodeDynamicLabels(labelsRecord1);
addNodeDynamicLabels(labelsRecord2);
// when
ConsistencyReport.NodeConsistencyReport report = check(node);
// then
verify(report).labelDuplicate(11);
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldReportTargetNodeNotReferencingBackForFirstRelationshipInTargetChain.
@Test
public void shouldReportTargetNodeNotReferencingBackForFirstRelationshipInTargetChain() throws Exception {
// given
checkSingleDirection();
initialize(RELATIONSHIPS, NODES);
RelationshipRecord relationship = inUse(new RelationshipRecord(42, 1, 2, 4));
add(inUse(new RelationshipTypeTokenRecord(4)));
add(inUse(new NodeRecord(1, false, 42, NONE)));
NodeRecord target = add(inUse(new NodeRecord(2, false, 7, NONE)));
// when
ConsistencyReport.RelationshipConsistencyReport report = check(relationship);
// then
verify(report).targetNodeDoesNotReferenceBack(target);
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldReportSourceNodeNotInUse.
@Test
public void shouldReportSourceNodeNotInUse() throws Exception {
// given
checkSingleDirection();
initialize(RELATIONSHIPS, NODES);
RelationshipRecord relationship = inUse(new RelationshipRecord(42, 1, 2, 4));
add(inUse(new RelationshipTypeTokenRecord(4)));
NodeRecord node = add(notInUse(new NodeRecord(1, false, NONE, NONE)));
add(inUse(new NodeRecord(2, false, 42, NONE)));
// when
ConsistencyReport.RelationshipConsistencyReport report = check(relationship);
// then
verify(report).sourceNodeNotInUse(node);
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldReportSourceNextReferencingOtherNodes.
@Test
public void shouldReportSourceNextReferencingOtherNodes() throws Exception {
// given
RelationshipRecord relationship = inUse(new RelationshipRecord(42, 1, 2, 4));
add(inUse(new RelationshipTypeTokenRecord(4)));
add(inUse(new NodeRecord(1, false, 42, NONE)));
add(inUse(new NodeRecord(2, false, 42, NONE)));
RelationshipRecord sNext = add(inUse(new RelationshipRecord(51, 8, 9, 0)));
relationship.setFirstNextRel(sNext.getId());
// when
ConsistencyReport.RelationshipConsistencyReport report = check(relationship);
// then
verify(report).sourceNextReferencesOtherNodes(sNext);
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldNotReportAnythingForRelationshipThatDoesNotReferenceOtherRecords.
@Test
public void shouldNotReportAnythingForRelationshipThatDoesNotReferenceOtherRecords() throws Exception {
// given
RelationshipRecord relationship = inUse(new RelationshipRecord(42, 1, 2, 4));
add(inUse(new RelationshipTypeTokenRecord(4)));
add(inUse(new NodeRecord(1, false, 42, NONE)));
add(inUse(new NodeRecord(2, false, 42, NONE)));
// when
ConsistencyReport.RelationshipConsistencyReport report = check(relationship);
// then
verifyNoMoreInteractions(report);
}
Aggregations