@Test public void testSetAsyncInputWithNullMasks() throws Exception { GetAsyncOutputBuilder builder = new GetAsyncOutputBuilder(); BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID); builder.setPacketInMask(null); builder.setPortStatusMask(null); builder.setFlowRemovedMask(null); GetAsyncOutput message = builder.build(); GetAsyncReplyMessageFactory serializer = new GetAsyncReplyMessageFactory(); SerializerRegistry registry = new NetIdeSerializerRegistryImpl(); registry.init(); ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(message, serializedBuffer); BufferHelper.checkHeaderV13(serializedBuffer, MESSAGE_TYPE, 8); Assert.assertTrue("Unexpected data", serializedBuffer.readableBytes() == 0); }
@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);  }