use of org.neo4j.kernel.impl.store.record.RelationshipRecord 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.RelationshipRecord 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.RelationshipRecord 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);
}
use of org.neo4j.kernel.impl.store.record.RelationshipRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldReportIllegalRelationshipType.
@Test
public void shouldReportIllegalRelationshipType() throws Exception {
// given
checkSingleDirection();
RelationshipRecord relationship = inUse(new RelationshipRecord(42, 1, 2, NONE));
add(inUse(new NodeRecord(1, false, 42, NONE)));
add(inUse(new NodeRecord(2, false, 42, NONE)));
// when
ConsistencyReport.RelationshipConsistencyReport report = check(relationship);
// then
verify(report).illegalRelationshipType();
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.RelationshipRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldReportSourceNextNotReferencingBack.
@Test
public void shouldReportSourceNextNotReferencingBack() 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, 3, 1, 0)));
relationship.setFirstNextRel(sNext.getId());
// when
ConsistencyReport.RelationshipConsistencyReport report = check(relationship);
// then
verify(report).sourceNextDoesNotReferenceBack(sNext);
verifyNoMoreInteractions(report);
}
Aggregations