Search in sources :

Example 1 with RelationshipTypeTokenCommand

use of org.neo4j.kernel.impl.transaction.command.Command.RelationshipTypeTokenCommand in project neo4j by neo4j.

the class NeoStoreTransactionApplierTest method shouldApplyRelationshipTypeTokenCommandToTheStore.

// RELATIONSHIP TYPE TOKEN COMMAND
@Test
public void shouldApplyRelationshipTypeTokenCommandToTheStore() throws Exception {
    // given
    final BatchTransactionApplier applier = newApplier(false);
    final RelationshipTypeTokenRecord before = new RelationshipTypeTokenRecord(42);
    final RelationshipTypeTokenRecord after = new RelationshipTypeTokenRecord(42);
    after.setInUse(true);
    after.setNameId(323);
    final Command command = new RelationshipTypeTokenCommand(before, after);
    // when
    boolean result = apply(applier, command::handle, transactionToApply);
    // then
    assertFalse(result);
    verify(relationshipTypeTokenStore, times(1)).updateRecord(after);
}
Also used : RelationshipTypeTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.RelationshipTypeTokenCommand) LabelTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.LabelTokenCommand) PropertyKeyTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.PropertyKeyTokenCommand) RelationshipTypeTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.RelationshipTypeTokenCommand) RelationshipTypeTokenRecord(org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord) BatchTransactionApplier(org.neo4j.kernel.impl.api.BatchTransactionApplier) Test(org.junit.Test)

Example 2 with RelationshipTypeTokenCommand

use of org.neo4j.kernel.impl.transaction.command.Command.RelationshipTypeTokenCommand in project neo4j by neo4j.

the class Commands method createRelationshipTypeToken.

public static RelationshipTypeTokenCommand createRelationshipTypeToken(int id, int nameId) {
    RelationshipTypeTokenRecord before = new RelationshipTypeTokenRecord(id);
    RelationshipTypeTokenRecord after = new RelationshipTypeTokenRecord(id);
    populateTokenRecord(after, nameId);
    return new RelationshipTypeTokenCommand(before, after);
}
Also used : RelationshipTypeTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.RelationshipTypeTokenCommand) RelationshipTypeTokenRecord(org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord)

Aggregations

RelationshipTypeTokenRecord (org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord)2 RelationshipTypeTokenCommand (org.neo4j.kernel.impl.transaction.command.Command.RelationshipTypeTokenCommand)2 Test (org.junit.Test)1 BatchTransactionApplier (org.neo4j.kernel.impl.api.BatchTransactionApplier)1 LabelTokenCommand (org.neo4j.kernel.impl.transaction.command.Command.LabelTokenCommand)1 PropertyKeyTokenCommand (org.neo4j.kernel.impl.transaction.command.Command.PropertyKeyTokenCommand)1