Search in sources :

Example 1 with AggregateFlowStatistics

use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.AggregateFlowStatistics in project openflowplugin by opendaylight.

the class MultipartReplyTranslatorTest method testTranslateAggregate.

@Test
public void testTranslateAggregate() {
    DeviceContext mockedDeviceContext = mock(DeviceContext.class);
    MultipartReplyMessage multipartReplyMessage = prepareMocks(mockedDeviceContext, prepareMultipartReplyAggregate(), MultipartType.OFPMPAGGREGATE);
    DataContainer result = MultipartReplyTranslatorUtil.translate(multipartReplyMessage, mockedDeviceContext.getDeviceInfo(), CONVERTOR_MANAGER, mockedDeviceContext.oook()).get();
    DataContainer dataObject = validateOutput(result);
    assertTrue(dataObject instanceof AggregateFlowStatistics);
    AggregateFlowStatistics message = (AggregateFlowStatistics) dataObject;
    assertEquals(DUMMY_BYTE_COUNT, message.getByteCount().getValue());
    assertEquals(DUMMY_PACKET_COUNT, message.getPacketCount().getValue());
    assertEquals(DUMMY_FLOW_COUNT, message.getFlowCount().getValue());
}
Also used : DeviceContext(org.opendaylight.openflowplugin.api.openflow.device.DeviceContext) MultipartReplyMessage(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage) DataContainer(org.opendaylight.yangtools.yang.binding.DataContainer) AggregateFlowStatistics(org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.AggregateFlowStatistics) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DeviceContext (org.opendaylight.openflowplugin.api.openflow.device.DeviceContext)1 AggregateFlowStatistics (org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.AggregateFlowStatistics)1 MultipartReplyMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage)1 DataContainer (org.opendaylight.yangtools.yang.binding.DataContainer)1