@Test public void testSerialize() { GetAsyncReplyMessageFactory serializer = new GetAsyncReplyMessageFactory(); SerializerRegistry registry = new NetIdeSerializerRegistryImpl(); registry.init(); ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(message, serializedBuffer); BufferHelper.checkHeaderV13(serializedBuffer, MESSAGE_TYPE, 32); Assert.assertEquals("Wrong packetInMask", 7, serializedBuffer.readUnsignedInt()); Assert.assertEquals("Wrong packetInMask", 0, serializedBuffer.readUnsignedInt()); Assert.assertEquals("Wrong portStatusMask", 7, serializedBuffer.readUnsignedInt()); Assert.assertEquals("Wrong portStatusMask", 0, serializedBuffer.readUnsignedInt()); Assert.assertEquals("Wrong flowRemovedMask", 15, serializedBuffer.readUnsignedInt()); Assert.assertEquals("Wrong flowRemovedMask", 0, serializedBuffer.readUnsignedInt()); }
@Override public void serialize(GetAsyncOutput message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); serializePacketInMask(message.getPacketInMask(), outBuffer); serializePortStatusMask(message.getPortStatusMask(), outBuffer); serializeFlowRemovedMask(message.getFlowRemovedMask(), outBuffer); ByteBufUtils.updateOFHeaderLength(outBuffer); }
GetAsyncReplyMessageFactory implements OFSerializer<GetAsyncOutput> { @Override public void serialize(GetAsyncOutput message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); serializePacketInMask(message.getPacketInMask(), outBuffer); serializePortStatusMask(message.getPortStatusMask(), outBuffer); serializeFlowRemovedMask(message.getFlowRemovedMask(), outBuffer); ByteBufUtils.updateOFHeaderLength(outBuffer); } }
GetAsyncReplyMessageFactory implements OFSerializer<GetAsyncOutput> { @Override public void serialize(GetAsyncOutput message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); serializePacketInMask(message.getPacketInMask(), outBuffer); serializePortStatusMask(message.getPortStatusMask(), outBuffer); serializeFlowRemovedMask(message.getFlowRemovedMask(), outBuffer); ByteBufUtils.updateOFHeaderLength(outBuffer); }  }
GetAsyncReplyMessageFactory implements OFSerializer<GetAsyncOutput> { @Override public void serialize(GetAsyncOutput message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); serializePacketInMask(message.getPacketInMask(), outBuffer); serializePortStatusMask(message.getPortStatusMask(), outBuffer); serializeFlowRemovedMask(message.getFlowRemovedMask(), outBuffer); ByteBufUtils.updateOFHeaderLength(outBuffer); }  @Override void serialize(GetAsyncOutput message, ByteBuf outBuffer); }
GetAsyncReplyMessageFactory implements OFSerializer<GetAsyncOutput> { @Override public void serialize(GetAsyncOutput message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); serializePacketInMask(message.getPacketInMask(), outBuffer); serializePortStatusMask(message.getPortStatusMask(), outBuffer); serializeFlowRemovedMask(message.getFlowRemovedMask(), outBuffer); ByteBufUtils.updateOFHeaderLength(outBuffer); }  @Override void serialize(GetAsyncOutput message, ByteBuf outBuffer);  }