use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigOutputBuilder in project openflowplugin by opendaylight.
the class GetConfigReplyMessageFactoryTest method testSerialize.
@Test
public void testSerialize() throws Exception {
GetConfigOutputBuilder builder = new GetConfigOutputBuilder();
BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
builder.setFlags(SwitchConfigFlag.forValue(2));
builder.setMissSendLen(20);
GetConfigOutput message = builder.build();
ByteBuf serializedBuffer = UnpooledByteBufAllocator.DEFAULT.buffer();
factory.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());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigOutputBuilder in project openflowplugin by opendaylight.
the class GetConfigReplyMessageFactory method deserialize.
@Override
public GetConfigOutput deserialize(ByteBuf rawMessage) {
GetConfigOutputBuilder builder = new GetConfigOutputBuilder();
builder.setVersion(getVersion());
builder.setXid(rawMessage.readUnsignedInt());
builder.setFlags(SwitchConfigFlag.forValue(rawMessage.readUnsignedShort()));
builder.setMissSendLen(rawMessage.readUnsignedShort());
return builder.build();
}
Aggregations