Merge "BUG-2329 Add test for anyxmls inside rpc resonse for netcfon-connector"
[controller.git] / opendaylight / sal / api / src / test / java / org / opendaylight / controller / sal / reader / NodeTableStatisticsTest.java
1 /*
2  * Copyright (c) 2013 Big Switch Networks, Inc.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.sal.reader;
9
10 import org.junit.Assert;
11 import org.junit.Test;
12 import org.opendaylight.controller.sal.core.NodeTable;
13 import org.opendaylight.controller.sal.utils.NodeCreator;
14 import org.opendaylight.controller.sal.utils.NodeTableCreator;
15
16 public class NodeTableStatisticsTest {
17
18     @Test
19     public void testNodeTableStatisticsMethods() {
20         NodeTable nt = NodeTableCreator.createNodeTable(Byte.valueOf("2") , NodeCreator.createOFNode((long)20));
21         NodeTableStatistics ntStats = new NodeTableStatistics();
22
23         ntStats.setNodeTable(nt);
24         ntStats.setActiveCount(100);
25         ntStats.setLookupCount(200);
26         ntStats.setMatchedCount(500);
27         ntStats.setMaximumEntries(1000);
28         ntStats.setName("Test");
29
30         Assert.assertTrue(ntStats.getNodeTable().equals(nt));
31         Assert.assertTrue(ntStats.getActiveCount() == 100);
32         Assert.assertTrue(ntStats.getLookupCount() == 200);
33         Assert.assertTrue(ntStats.getMatchedCount() == 500);
34         Assert.assertTrue(ntStats.getMaximumEntries() == 1000);
35         Assert.assertTrue(ntStats.getName().equals("Test"));
36     }
37 }