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()));
}
Aggregations