@Test public void testSerialize() { GetConfigReplyMessageFactory serializer = new GetConfigReplyMessageFactory(); SerializerRegistry registry = new NetIdeSerializerRegistryImpl(); registry.init(); ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(message, serializedBuffer); BufferHelper.checkHeaderV13(serializedBuffer, MESSAGE_TYPE, 12); Assert.assertEquals("Wrong Type", message.getFlags().getIntValue(), serializedBuffer.readShort()); Assert.assertEquals("Wrong Code", message.getMissSendLen().intValue(), serializedBuffer.readShort()); }
@Override public void serialize(GetConfigOutput message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); outBuffer.writeShort(message.getFlags().getIntValue()); outBuffer.writeShort(message.getMissSendLen()); ByteBufUtils.updateOFHeaderLength(outBuffer); }
GetConfigReplyMessageFactory implements OFSerializer<GetConfigOutput> { @Override public void serialize(GetConfigOutput message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); outBuffer.writeShort(message.getFlags().getIntValue()); outBuffer.writeShort(message.getMissSendLen()); ByteBufUtils.updateOFHeaderLength(outBuffer); } }
GetConfigReplyMessageFactory implements OFSerializer<GetConfigOutput> { @Override public void serialize(GetConfigOutput message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); outBuffer.writeShort(message.getFlags().getIntValue()); outBuffer.writeShort(message.getMissSendLen()); ByteBufUtils.updateOFHeaderLength(outBuffer); }  }
GetConfigReplyMessageFactory implements OFSerializer<GetConfigOutput> { @Override public void serialize(GetConfigOutput message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); outBuffer.writeShort(message.getFlags().getIntValue()); outBuffer.writeShort(message.getMissSendLen()); ByteBufUtils.updateOFHeaderLength(outBuffer); }  @Override void serialize(GetConfigOutput message, ByteBuf outBuffer); }
GetConfigReplyMessageFactory implements OFSerializer<GetConfigOutput> { @Override public void serialize(GetConfigOutput message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); outBuffer.writeShort(message.getFlags().getIntValue()); outBuffer.writeShort(message.getMissSendLen()); ByteBufUtils.updateOFHeaderLength(outBuffer); }  @Override void serialize(GetConfigOutput message, ByteBuf outBuffer);  }