use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class TransactionWriter method relationshipType.
public void relationshipType(int id, String label, int... dynamicIds) {
RelationshipTypeTokenRecord before = new RelationshipTypeTokenRecord(id);
RelationshipTypeTokenRecord after = withName(new RelationshipTypeTokenRecord(id), dynamicIds, label);
otherCommands.add(new Command.RelationshipTypeTokenCommand(before, after));
}
use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldReportRelationshipTypeNotInUse.
@Test
public void shouldReportRelationshipTypeNotInUse() throws Exception {
// given
checkSingleDirection();
RelationshipRecord relationship = inUse(new RelationshipRecord(42, 1, 2, 4));
RelationshipTypeTokenRecord relationshipType = add(notInUse(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
verify(report).relationshipTypeNotInUse(relationshipType);
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldReportTargetNextReferencingOtherNodes.
@Test
public void shouldReportTargetNextReferencingOtherNodes() 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, 8, 9, 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 shouldReportSourceNodeWithoutChainForRelationshipInTheMiddleOfChain.
@Test
public void shouldReportSourceNodeWithoutChainForRelationshipInTheMiddleOfChain() throws Exception {
// given
checkSingleDirection();
initialize(RELATIONSHIPS, NODES);
RelationshipRecord relationship = inUse(new RelationshipRecord(42, 1, 2, 4));
add(inUse(new RelationshipTypeTokenRecord(4)));
NodeRecord source = add(inUse(new NodeRecord(1, false, NONE, NONE)));
add(inUse(new NodeRecord(2, false, 42, NONE)));
RelationshipRecord sPrev = add(inUse(new RelationshipRecord(51, 1, 0, 0)));
relationship.setFirstPrevRel(sPrev.getId());
relationship.setFirstInFirstChain(false);
sPrev.setFirstNextRel(relationship.getId());
// when
ConsistencyReport.RelationshipConsistencyReport report = check(relationship);
// then
verify(report).sourceNodeHasNoRelationships(source);
verifyNoMoreInteractions(report);
}
use of org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord in project neo4j by neo4j.
the class RelationshipRecordCheckTest method shouldReportSourcePrevReferencingOtherNodesWhenReferencingTargetNode.
@Test
public void shouldReportSourcePrevReferencingOtherNodesWhenReferencingTargetNode() 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, 2, 0, 0)));
relationship.setFirstPrevRel(sPrev.getId());
relationship.setFirstInFirstChain(false);
// when
ConsistencyReport.RelationshipConsistencyReport report = check(relationship);
// then
verify(report).sourcePrevReferencesOtherNodes(sPrev);
verifyNoMoreInteractions(report);
}
Aggregations