4 import org.opendaylight.controller.md.statistics.manager.StatisticsManager;
5 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
6 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
7 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
8 import test.mock.util.StatisticsManagerTest;
10 import java.util.concurrent.ExecutionException;
12 import static org.junit.Assert.assertFalse;
13 import static org.junit.Assert.assertTrue;
15 public class NodeRegistrationTest extends StatisticsManagerTest {
18 public void nodeRegistrationTest() throws ExecutionException, InterruptedException {
19 StatisticsManager statisticsManager = setupStatisticsManager();
21 addFlowCapableNode(s1Key);
23 final InstanceIdentifier<Node> nodeII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key);
25 assertTrue(statisticsManager.isProvidedFlowNodeActive(nodeII));
29 public void nodeUnregistrationTest() throws ExecutionException, InterruptedException {
30 StatisticsManager statisticsManager = setupStatisticsManager();
32 addFlowCapableNode(s1Key);
34 final InstanceIdentifier<Node> nodeII = InstanceIdentifier.create(Nodes.class).child(Node.class, s1Key);
36 assertTrue(statisticsManager.isProvidedFlowNodeActive(nodeII));
40 assertFalse(statisticsManager.isProvidedFlowNodeActive(nodeII));