Search in sources :

Example 56 with Stats

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.monitor.rev171207.peers.peer.Stats in project lispflowmapping by opendaylight.

the class LispSouthboundRpcTest method getStatsTest.

/**
 * Tests {@link LispSouthboundRPC#getStats} method.
 */
@Test
public void getStatsTest() throws ExecutionException, InterruptedException {
    final ConcurrentLispSouthboundStats stats = new ConcurrentLispSouthboundStats();
    incrementAll(stats);
    Mockito.when(lispSouthboundPlugin.getStats()).thenReturn(stats);
    // result
    final ControlMessageStats resultStats = lispSouthboundRPC.getStats().get().getResult().getControlMessageStats();
    assertEquals(stats.getRx()[0], (long) resultStats.getControlMessage().get(0).getRxCount());
    assertEquals(stats.getRx()[1], (long) resultStats.getControlMessage().get(1).getRxCount());
    assertEquals(stats.getRx()[2], (long) resultStats.getControlMessage().get(2).getRxCount());
    assertEquals(stats.getRx()[3], (long) resultStats.getControlMessage().get(3).getRxCount());
    assertEquals(stats.getRx()[4], (long) resultStats.getControlMessage().get(4).getRxCount());
    assertEquals(stats.getRx()[6], (long) resultStats.getControlMessage().get(5).getRxCount());
    assertEquals(stats.getRx()[7], (long) resultStats.getControlMessage().get(6).getRxCount());
    assertEquals(stats.getRx()[8], (long) resultStats.getControlMessage().get(7).getRxCount());
}
Also used : ControlMessageStats(org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.get.stats.output.ControlMessageStats) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)14 Test (org.junit.Test)14 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)11 ReadOnlyTransaction (org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction)10 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)10 Nodes (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes)10 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)10 MultipartReply (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply)10 VersionConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData)9 BigInteger (java.math.BigInteger)7 List (java.util.List)7 GroupStats (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group._case.multipart.reply.group.GroupStats)6 GetFlowStatisticsOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsOutput)5 GetNodeConnectorStatisticsOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetNodeConnectorStatisticsOutput)5 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)5 GroupId (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupId)5 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)5 GetGroupStatisticsOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetGroupStatisticsOutput)4 GetMeterStatisticsOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetMeterStatisticsOutput)4 FlowAndStatisticsMapList (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapList)4