use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInputGroup.
@Test
public void testMakeMultipartRequestInputGroup() throws Exception {
final MultipartType mpType = MultipartType.OFPMPGROUP;
final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
checkHeader(mpRqInput, mpType);
final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
Assert.assertTrue(mpRqBody instanceof MultipartRequestGroupCase);
MultipartRequestGroup mpRq = ((MultipartRequestGroupCase) mpRqBody).getMultipartRequestGroup();
Assert.assertEquals(OFConstants.OFPG_ALL, mpRq.getGroupId().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInput_FLOW_13.
@Test
public void testMakeMultipartRequestInput_FLOW_13() throws Exception {
final MultipartType mpType = MultipartType.OFPMPFLOW;
final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
checkHeader(mpRqInput, mpType);
final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
Assert.assertTrue(mpRqBody instanceof MultipartRequestFlowCase);
MultipartRequestFlow mpRq = ((MultipartRequestFlowCase) mpRqBody).getMultipartRequestFlow();
Assert.assertEquals(OFConstants.OFPTT_ALL, mpRq.getTableId());
Assert.assertEquals(OFConstants.OFPP_ANY, mpRq.getOutPort());
Assert.assertEquals(OFConstants.OFPG_ANY, mpRq.getOutGroup());
Assert.assertEquals(0, mpRq.getCookie().intValue());
Assert.assertEquals(0, mpRq.getCookieMask().intValue());
Assert.assertNotNull(mpRq.getMatch());
Assert.assertNull(mpRq.getMatchV10());
Assert.assertEquals(OxmMatchType.class, mpRq.getMatch().getType());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInputPortDesc.
@Test
public void testMakeMultipartRequestInputPortDesc() throws Exception {
MultipartType mpType = MultipartType.OFPMPPORTDESC;
final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
checkHeader(mpRqInput, mpType);
checkEmptyBody(mpRqInput.getMultipartRequestBody().getImplementedInterface(), MultipartRequestPortDescCase.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput in project openflowplugin by opendaylight.
the class MultipartRequestMeterInputMessageFactoryTest method test.
@Test
public void test() {
ByteBuf bb = BufferHelper.buildBuffer("00 09 00 01 00 00 00 00 00 00 04 61 00 00 00 00");
MultipartRequestInput deserializedMessage = BufferHelper.deserialize(factory, bb);
BufferHelper.checkHeaderV13(deserializedMessage);
Assert.assertEquals("Wrong type", MultipartType.forValue(9), deserializedMessage.getType());
Assert.assertEquals("Wrong flags", new MultipartRequestFlags(true), deserializedMessage.getFlags());
Assert.assertEquals("Wrong aggregate", createRequestMeter(), deserializedMessage.getMultipartRequestBody());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput in project openflowplugin by opendaylight.
the class MultipartRequestTableInputMessageFactoryTest method test.
@Test
public void test() {
ByteBuf bb = BufferHelper.buildBuffer("00 03 00 01 00 00 00 00");
MultipartRequestInput deserializedMessage = BufferHelper.deserialize(factory, bb);
BufferHelper.checkHeaderV13(deserializedMessage);
Assert.assertEquals("Wrong type", MultipartType.forValue(3), deserializedMessage.getType());
Assert.assertEquals("Wrong flags", new MultipartRequestFlags(true), deserializedMessage.getFlags());
}
Aggregations