use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType in project openflowplugin by opendaylight.
the class StatisticsGatheringServiceTest method testBuildRequest.
@Test
public void testBuildRequest() throws Exception {
final long xidValue = 21L;
Xid xid = new Xid(xidValue);
for (MultipartType mpType : MultipartType.values()) {
final OfHeader request = statisticsGatheringService.buildRequest(xid, mpType);
Assert.assertEquals(MultipartRequestInput.class, request.getImplementedInterface());
Assert.assertEquals(xidValue, request.getXid().longValue());
Assert.assertNotNull(request);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType in project openflowplugin by opendaylight.
the class RequestInputUtilsTest method createMultipartHeader.
@Test
public void createMultipartHeader() throws Exception {
final Short version = OFConstants.OFP_VERSION_1_3;
final Long xid = 42L;
final MultipartType type = MultipartType.OFPMPDESC;
final MultipartRequestInput input = RequestInputUtils.createMultipartHeader(type, xid, version).build();
assertEquals(version, input.getVersion());
assertEquals(xid, input.getXid());
assertEquals(type, input.getType());
assertFalse(input.getFlags().isOFPMPFREQMORE());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInputMeterFeatures.
@Test
public void testMakeMultipartRequestInputMeterFeatures() throws Exception {
MultipartType mpType = MultipartType.OFPMPMETERFEATURES;
final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
checkHeader(mpRqInput, mpType);
checkEmptyBody(mpRqInput.getMultipartRequestBody().getImplementedInterface(), MultipartRequestMeterFeaturesCase.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInputMeter.
@Test
public void testMakeMultipartRequestInputMeter() throws Exception {
final MultipartType mpType = MultipartType.OFPMPMETER;
final MultipartRequestInput mpRqInput = (MultipartRequestInput) MultipartRequestInputFactory.makeMultipartRequest(xid, ofVersion, mpType, false);
checkHeader(mpRqInput, mpType);
final MultipartRequestBody mpRqBody = mpRqInput.getMultipartRequestBody();
Assert.assertTrue(mpRqBody instanceof MultipartRequestMeterCase);
MultipartRequestMeter mpRq = ((MultipartRequestMeterCase) mpRqBody).getMultipartRequestMeter();
Assert.assertEquals(OFConstants.OFPM_ALL, mpRq.getMeterId().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method testMakeMultipartRequestInput_FLOW_10.
@Test
public void testMakeMultipartRequestInput_FLOW_10() throws Exception {
final MultipartType mpType = MultipartType.OFPMPFLOW;
ofVersion = OFConstants.OFP_VERSION_1_0;
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.assertNull(mpRq.getMatch());
Assert.assertNotNull(mpRq.getMatchV10());
}
Aggregations