2 * Copyright (c) 2013 Big Switch Networks, Inc. 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
8 package org.opendaylight.controller.sal.reader;
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;
16 public class NodeTableStatisticsTest {
19 public void testNodeTableStatisticsMethods() {
20 NodeTable nt = NodeTableCreator.createNodeTable(Byte.valueOf("2") , NodeCreator.createOFNode((long)20));
21 NodeTableStatistics ntStats = new NodeTableStatistics();
23 ntStats.setNodeTable(nt);
24 ntStats.setActiveCount(100);
25 ntStats.setLookupCount(200);
26 ntStats.setMatchedCount(500);
27 ntStats.setMaximumEntries(1000);
28 ntStats.setName("Test");
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"));