use of org.neo4j.kernel.impl.store.record.RelationshipRecord in project neo4j by neo4j.
the class RelationshipCheckTypeTest method inUseRecordEquality.
@Test
public void inUseRecordEquality() {
RelationshipRecord record1 = new RelationshipRecord(1);
record1.initialize(true, 1, 2, 3, 4, 5, 6, 7, 8, true, false);
record1.setSecondaryUnitId(42);
RelationshipRecord record2 = record1.clone();
RelationshipCheckType check = new RelationshipCheckType();
assertTrue(check.equal(record1, record2));
}
use of org.neo4j.kernel.impl.store.record.RelationshipRecord in project neo4j by neo4j.
the class NodeRecordCheckTest method shouldReportRelationshipNotFirstInSourceChain.
@Test
public void shouldReportRelationshipNotFirstInSourceChain() throws Exception {
// given
NodeRecord node = inUse(new NodeRecord(42, false, 7, NONE));
RelationshipRecord relationship = add(inUse(new RelationshipRecord(7, 42, 0, 0)));
relationship.setFirstPrevRel(6);
relationship.setFirstInFirstChain(false);
relationship.setSecondPrevRel(8);
relationship.setFirstInSecondChain(false);
// when
ConsistencyReport.NodeConsistencyReport report = check(node);
// then
verify(report).relationshipNotFirstInSourceChain(relationship);
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.RelationshipRecord in project neo4j by neo4j.
the class NodeRecordCheckTest method shouldNotReportAnythingForNodeWithConsistentReferences.
@Test
public void shouldNotReportAnythingForNodeWithConsistentReferences() throws Exception {
// given
NodeRecord node = inUse(new NodeRecord(42, false, 7, 11));
add(inUse(new RelationshipRecord(7, 42, 0, 0)));
add(inUse(new PropertyRecord(11)));
// when
ConsistencyReport.NodeConsistencyReport report = check(node);
// then
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.RelationshipRecord in project neo4j by neo4j.
the class NodeRecordCheckTest method shouldReportLoopRelationshipNotFirstInTargetAndSourceChains.
@Test
public void shouldReportLoopRelationshipNotFirstInTargetAndSourceChains() throws Exception {
// given
NodeRecord node = inUse(new NodeRecord(42, false, 7, NONE));
RelationshipRecord relationship = add(inUse(new RelationshipRecord(7, 42, 42, 0)));
relationship.setFirstPrevRel(8);
relationship.setFirstInFirstChain(false);
relationship.setSecondPrevRel(8);
relationship.setFirstInSecondChain(false);
// when
ConsistencyReport.NodeConsistencyReport report = check(node);
// then
verify(report).relationshipNotFirstInSourceChain(relationship);
verify(report).relationshipNotFirstInTargetChain(relationship);
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.RelationshipRecord 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);
}
Aggregations