use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldReportTargetNextReferencingOtherNodesWhenReferencingSourceNode.
@Test
public void shouldReportTargetNextReferencingOtherNodesWhenReferencingSourceNode() 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 tNext = add(inUse(new RelationshipRecord(51, 1, 0, 0)));
relationship.setSecondNextRel(tNext.getId());
// when
ConsistencyReport.RelationshipConsistencyReport report = check(relationship);
// then
verify(report).targetNextReferencesOtherNodes(tNext);
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldReportPropertyNotInUse.
@Test
public void shouldReportPropertyNotInUse() throws Exception {
// given
checkSingleDirection();
RelationshipRecord relationship = inUse(new RelationshipRecord(42, 1, 2, 4));
add(inUse(new RelationshipTypeTokenRecord(4)));
relationship.setNextProp(11);
add(inUse(new NodeRecord(1, false, 42, NONE)));
add(inUse(new NodeRecord(2, false, 42, NONE)));
PropertyRecord property = add(notInUse(new PropertyRecord(11)));
// when
ConsistencyReport.RelationshipConsistencyReport report = check(relationship);
// then
verify(report).propertyNotInUse(property);
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldReportTargetNodeNotInUse.
@Test
public void shouldReportTargetNodeNotInUse() 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 node = add(notInUse(new NodeRecord(2, false, NONE, NONE)));
// when
ConsistencyReport.RelationshipConsistencyReport report = check(relationship);
// then
verify(report).targetNodeNotInUse(node);
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldReportSourcePrevNotReferencingBack.
@Test
public void shouldReportSourcePrevNotReferencingBack() throws Exception {
// given
RelationshipRecord relationship = inUse(new RelationshipRecord(42, 1, 2, 4));
add(inUse(new RelationshipTypeTokenRecord(4)));
add(inUse(new NodeRecord(1, false, 0, NONE)));
add(inUse(new NodeRecord(2, false, 42, NONE)));
RelationshipRecord sPrev = add(inUse(new RelationshipRecord(51, 1, 3, 0)));
relationship.setFirstPrevRel(sPrev.getId());
relationship.setFirstInFirstChain(false);
// when
ConsistencyReport.RelationshipConsistencyReport report = check(relationship);
// then
verify(report).sourcePrevDoesNotReferenceBack(sPrev);
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldReportTargetPrevNotReferencingBack.
@Test
public void shouldReportTargetPrevNotReferencingBack() 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, 0, NONE)));
RelationshipRecord tPrev = add(inUse(new RelationshipRecord(51, 2, 3, 0)));
relationship.setSecondPrevRel(tPrev.getId());
relationship.setFirstInSecondChain(false);
// when
ConsistencyReport.RelationshipConsistencyReport report = check(relationship);
// then
verify(report).targetPrevDoesNotReferenceBack(tPrev);
verifyNoMoreInteractions(report);
}
Aggregations