2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.openflowplugin.impl.statistics.services;
11 import org.junit.Test;
12 import org.mockito.Mock;
13 import org.mockito.Mockito;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInput;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowStatisticsFromFlowTableInputBuilder;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesInput;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetAllFlowsStatisticsFromAllFlowTablesInputBuilder;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableInput;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.GetFlowStatisticsFromFlowTableInputBuilder;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.OpendaylightFlowStatisticsService;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
26 * Test for {@link OpendaylightFlowStatisticsServiceImpl} - only delegated methods
28 public class OpendaylightFlowStatisticsServiceImpl3Test extends AbstractStatsServiceTest {
31 private OpendaylightFlowStatisticsService flowStatisticsDelegate;
33 private OpendaylightFlowStatisticsServiceImpl flowStatisticsService;
36 flowStatisticsService = OpendaylightFlowStatisticsServiceImpl.createWithOook(rqContextStack, deviceContext);
37 flowStatisticsService.setDelegate(flowStatisticsDelegate);
41 public void testGetAggregateFlowStatisticsFromFlowTableForAllFlows() throws Exception {
42 GetAggregateFlowStatisticsFromFlowTableForAllFlowsInput input = new GetAggregateFlowStatisticsFromFlowTableForAllFlowsInputBuilder()
43 .setNode(createNodeRef("unitProt:123"))
44 .setTableId(new TableId((short) 1))
47 flowStatisticsService.getAggregateFlowStatisticsFromFlowTableForAllFlows(input);
48 Mockito.verify(flowStatisticsDelegate).getAggregateFlowStatisticsFromFlowTableForAllFlows(input);
52 public void testGetAllFlowStatisticsFromFlowTable() throws Exception {
53 GetAllFlowStatisticsFromFlowTableInput input = new GetAllFlowStatisticsFromFlowTableInputBuilder()
54 .setNode(createNodeRef("unitProt:123"))
55 .setTableId(new TableId((short) 1))
58 flowStatisticsService.getAllFlowStatisticsFromFlowTable(input);
59 Mockito.verify(flowStatisticsDelegate).getAllFlowStatisticsFromFlowTable(input);
63 public void testGetAllFlowsStatisticsFromAllFlowTables() throws Exception {
64 GetAllFlowsStatisticsFromAllFlowTablesInput input = new GetAllFlowsStatisticsFromAllFlowTablesInputBuilder()
65 .setNode(createNodeRef("unitProt:123"))
68 flowStatisticsService.getAllFlowsStatisticsFromAllFlowTables(input);
69 Mockito.verify(flowStatisticsDelegate).getAllFlowsStatisticsFromAllFlowTables(input);
73 public void testGetFlowStatisticsFromFlowTable() throws Exception {
74 GetFlowStatisticsFromFlowTableInput input = new GetFlowStatisticsFromFlowTableInputBuilder()
75 .setNode(createNodeRef("unitProt:123"))
79 flowStatisticsService.getFlowStatisticsFromFlowTable(input);
80 Mockito.verify(flowStatisticsDelegate).getFlowStatisticsFromFlowTable(input);