Search in sources :

Example 1 with PhysicalLogCommandReaderV2_2

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

the class RelationshipGroupCommandV2_2Test method assertSerializationWorksFor.

private void assertSerializationWorksFor(Command.RelationshipGroupCommand cmd) throws IOException {
    InMemoryClosableChannel channel = new InMemoryClosableChannel();
    cmd.serialize(channel);
    CommandReader commandReader = new PhysicalLogCommandReaderV2_2();
    Command.RelationshipGroupCommand result = (Command.RelationshipGroupCommand) commandReader.read(channel);
    RelationshipGroupRecord recordBefore = cmd.getBefore();
    RelationshipGroupRecord recordAfter = result.getAfter();
    // Then
    assertThat(recordBefore.getFirstIn(), equalTo(recordAfter.getFirstIn()));
    assertThat(recordBefore.getFirstOut(), equalTo(recordAfter.getFirstOut()));
    assertThat(recordBefore.getFirstLoop(), equalTo(recordAfter.getFirstLoop()));
    assertThat(recordBefore.getNext(), equalTo(recordAfter.getNext()));
    assertThat(recordBefore.getOwningNode(), equalTo(recordAfter.getOwningNode()));
    assertThat(recordBefore.getPrev(), equalTo(recordAfter.getPrev()));
    assertThat(recordBefore.getType(), equalTo(recordAfter.getType()));
}
Also used : CommandReader(org.neo4j.storageengine.api.CommandReader) RelationshipGroupRecord(org.neo4j.kernel.impl.store.record.RelationshipGroupRecord) InMemoryClosableChannel(org.neo4j.kernel.impl.transaction.log.InMemoryClosableChannel) Command(org.neo4j.kernel.impl.transaction.command.Command) PhysicalLogCommandReaderV2_2(org.neo4j.kernel.impl.transaction.command.PhysicalLogCommandReaderV2_2)

Aggregations

RelationshipGroupRecord (org.neo4j.kernel.impl.store.record.RelationshipGroupRecord)1 Command (org.neo4j.kernel.impl.transaction.command.Command)1 PhysicalLogCommandReaderV2_2 (org.neo4j.kernel.impl.transaction.command.PhysicalLogCommandReaderV2_2)1 InMemoryClosableChannel (org.neo4j.kernel.impl.transaction.log.InMemoryClosableChannel)1 CommandReader (org.neo4j.storageengine.api.CommandReader)1