Search in sources :

Example 1 with LabelTokenCommand

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

the class NeoStoreTransactionApplierTest method shouldApplyLabelTokenCommandToTheStore.

// LABEL TOKEN COMMAND
@Test
public void shouldApplyLabelTokenCommandToTheStore() throws Exception {
    // given
    final BatchTransactionApplier applier = newApplier(false);
    final LabelTokenRecord before = new LabelTokenRecord(42);
    final LabelTokenRecord after = new LabelTokenRecord(42);
    after.setInUse(true);
    after.setNameId(323);
    final Command command = new LabelTokenCommand(before, after);
    // when
    boolean result = apply(applier, command::handle, transactionToApply);
    // then
    assertFalse(result);
    verify(labelTokenStore, 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) LabelTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.LabelTokenCommand) BatchTransactionApplier(org.neo4j.kernel.impl.api.BatchTransactionApplier) LabelTokenRecord(org.neo4j.kernel.impl.store.record.LabelTokenRecord) Test(org.junit.Test)

Example 2 with LabelTokenCommand

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

the class Commands method createLabelToken.

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

Aggregations

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