use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.group.features._case.MultipartRequestGroupFeaturesBuilder in project openflowplugin by opendaylight.
the class MultipartRequestInputMessageFactory method setGroupFeatures.
private MultipartRequestGroupFeaturesCase setGroupFeatures(ByteBuf input) {
MultipartRequestGroupFeaturesCaseBuilder caseBuilder = new MultipartRequestGroupFeaturesCaseBuilder();
MultipartRequestGroupFeaturesBuilder groupBuilder = new MultipartRequestGroupFeaturesBuilder();
groupBuilder.setEmpty(true);
caseBuilder.setMultipartRequestGroupFeatures(groupBuilder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.group.features._case.MultipartRequestGroupFeaturesBuilder in project openflowplugin by opendaylight.
the class MultipartRequestGroupFeaturesTest method test.
/**
* Tests {@link MultipartRequestInputFactory} - GroupFeatures case.
*/
@Test
public void test() throws Exception {
MultipartRequestInputBuilder builder = new MultipartRequestInputBuilder();
BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
builder.setType(MultipartType.OFPMPGROUPFEATURES);
builder.setFlags(new MultipartRequestFlags(false));
MultipartRequestGroupFeaturesCaseBuilder caseBuilder = new MultipartRequestGroupFeaturesCaseBuilder();
MultipartRequestGroupFeaturesBuilder featuresBuilder = new MultipartRequestGroupFeaturesBuilder();
featuresBuilder.setEmpty(true);
caseBuilder.setMultipartRequestGroupFeatures(featuresBuilder.build());
builder.setMultipartRequestBody(caseBuilder.build());
MultipartRequestInput message = builder.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
multipartFactory.serialize(message, out);
BufferHelper.checkHeaderV13(out, (byte) 18, 16);
Assert.assertEquals("Wrong type", 8, out.readUnsignedShort());
Assert.assertEquals("Wrong flags", 0, out.readUnsignedShort());
// skip padding
out.skipBytes(4);
Assert.assertTrue("Unexpected data", out.readableBytes() == 0);
}
Aggregations