use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table._case.MultipartRequestTableBuilder in project openflowplugin by opendaylight.
the class MultipartRequestInputMessageFactory method setTable.
private MultipartRequestTableCase setTable(ByteBuf input) {
MultipartRequestTableCaseBuilder caseBuilder = new MultipartRequestTableCaseBuilder();
MultipartRequestTableBuilder tableBuilder = new MultipartRequestTableBuilder();
tableBuilder.setEmpty(true);
caseBuilder.setMultipartRequestTable(tableBuilder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table._case.MultipartRequestTableBuilder in project openflowplugin by opendaylight.
the class OF10StatsRequestInputFactory method setTable.
private MultipartRequestTableCase setTable(ByteBuf input) {
MultipartRequestTableCaseBuilder caseBuilder = new MultipartRequestTableCaseBuilder();
MultipartRequestTableBuilder tableBuilder = new MultipartRequestTableBuilder();
tableBuilder.setEmpty(true);
caseBuilder.setMultipartRequestTable(tableBuilder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table._case.MultipartRequestTableBuilder in project openflowplugin by opendaylight.
the class OF10StatsRequestInputFactoryTest method testTable.
/**
* Testing OF10StatsRequestInputFactory (Table) for correct serialization.
*/
@Test
public void testTable() throws Exception {
MultipartRequestInputBuilder builder = new MultipartRequestInputBuilder();
BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
builder.setType(MultipartType.OFPMPTABLE);
builder.setFlags(new MultipartRequestFlags(false));
MultipartRequestTableCaseBuilder caseBuilder = new MultipartRequestTableCaseBuilder();
MultipartRequestTableBuilder tableBuilder = new MultipartRequestTableBuilder();
caseBuilder.setMultipartRequestTable(tableBuilder.build());
builder.setMultipartRequestBody(caseBuilder.build());
MultipartRequestInput message = builder.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
multipartFactory.serialize(message, out);
BufferHelper.checkHeaderV10(out, (byte) 16, 12);
Assert.assertEquals("Wrong type", 3, out.readUnsignedShort());
Assert.assertEquals("Wrong flags", 0, out.readUnsignedShort());
Assert.assertTrue("Unread data", out.readableBytes() == 0);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table._case.MultipartRequestTableBuilder in project openflowplugin by opendaylight.
the class MultipartRequestTableTest method test.
/**
* Tests {@link MultipartRequestInputFactory} - Table case.
*/
@Test
public void test() throws Exception {
MultipartRequestInputBuilder builder = new MultipartRequestInputBuilder();
BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
builder.setType(MultipartType.OFPMPTABLE);
builder.setFlags(new MultipartRequestFlags(false));
MultipartRequestTableCaseBuilder caseBuilder = new MultipartRequestTableCaseBuilder();
MultipartRequestTableBuilder tablesBuilder = new MultipartRequestTableBuilder();
tablesBuilder.setEmpty(true);
caseBuilder.setMultipartRequestTable(tablesBuilder.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", 3, out.readUnsignedShort());
Assert.assertEquals("Wrong flags", 0, out.readUnsignedShort());
// skip padding
out.skipBytes(4);
Assert.assertTrue("Unexpected data", out.readableBytes() == 0);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table._case.MultipartRequestTableBuilder in project openflowplugin by opendaylight.
the class OF10StatsRequestInputTableFactoryTest method createMultipartRequestBody.
private static MultipartRequestBody createMultipartRequestBody() {
MultipartRequestTableCaseBuilder caseBuilder = new MultipartRequestTableCaseBuilder();
MultipartRequestTableBuilder tableBuilder = new MultipartRequestTableBuilder();
tableBuilder.setEmpty(true);
caseBuilder.setMultipartRequestTable(tableBuilder.build());
return caseBuilder.build();
}
Aggregations