use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class SalExperimenterMessageServiceImplTest method testBuildRequest.
@Test
public void testBuildRequest() throws Exception {
SendExperimenterInput sendExperimenterInput = buildSendExperimenterInput();
final OfHeader request = salExperimenterMessageService.buildRequest(new Xid(DUMMY_XID_VALUE), sendExperimenterInput);
assertEquals(DUMMY_XID_VALUE, request.getXid());
assertTrue(request instanceof ExperimenterInput);
final ExperimenterInput input = (ExperimenterInput) request;
assertEquals(43L, input.getExperimenter().getValue().longValue());
assertEquals(44L, input.getExpType().longValue());
Mockito.verify(extensionConverter).convert(sendExperimenterInput.getExperimenterMessageOfChoice());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class SingleLayerAggregateFlowMultipartServiceTest method buildRequest.
@Test
public void buildRequest() throws Exception {
final GetAggregateFlowStatisticsFromFlowTableForGivenMatchInput input = new GetAggregateFlowStatisticsFromFlowTableForGivenMatchInputBuilder().setTableId(TABLE_ID).build();
final OfHeader ofHeader = service.buildRequest(DUMMY_XID, input);
assertEquals(MultipartRequest.class, ofHeader.getImplementedInterface());
final MultipartRequestFlowAggregateStats result = MultipartRequestFlowAggregateStats.class.cast(MultipartRequest.class.cast(ofHeader).getMultipartRequestBody());
assertEquals(TABLE_ID, result.getTableId().shortValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class SingleLayerFlowServiceTest method buildRequest.
@Test
public void buildRequest() throws Exception {
final AddFlowInput input = new AddFlowInputBuilder().setTableId(TABLE_ID).build();
final OfHeader ofHeader = service.buildRequest(DUMMY_XID, input);
assertEquals(FlowMessage.class, ofHeader.getImplementedInterface());
final FlowMessage result = FlowMessage.class.cast(ofHeader);
assertEquals(FlowModCommand.OFPFCADD, result.getCommand());
assertEquals(TABLE_ID, result.getTableId().shortValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class SingleLayerMeterServiceTest method buildRequest.
@Test
public void buildRequest() throws Exception {
final AddMeterInput input = new AddMeterInputBuilder().setMeterId(new MeterId(METER_ID)).build();
final OfHeader ofHeader = service.buildRequest(DUMMY_XID, input);
assertEquals(MeterMessage.class, ofHeader.getImplementedInterface());
final MeterMessage result = MeterMessage.class.cast(ofHeader);
assertEquals(MeterModCommand.OFPMCADD, result.getCommand());
assertEquals(METER_ID, result.getMeterId().getValue().longValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class FlowCapableTransactionServiceImplTest method testBuildRequest.
@Test
public void testBuildRequest() throws Exception {
SendBarrierInput sendBarrierInput = buildSendBarrierInput();
final OfHeader request = flowCapableTransactionService.buildRequest(new Xid(DUMMY_XID_VALUE), sendBarrierInput);
assertEquals(DUMMY_XID_VALUE, request.getXid());
assertTrue(request instanceof BarrierInput);
}
Aggregations