OpenDaylight Controller functional modules.
[controller.git] / opendaylight / arphandler / src / test / java / org / opendaylight / controller / arphandler / internal / ArphandlerTest.java
1 \r
2 /*\r
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
4  *\r
5  * This program and the accompanying materials are made available under the\r
6  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
7  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
8  */\r
9 \r
10 package org.opendaylight.controller.arphandler.internal;\r
11 \r
12 \r
13 import org.junit.Assert;\r
14 import org.junit.Test;\r
15 import junit.framework.TestCase;\r
16 \r
17 import org.opendaylight.controller.hosttracker.IfIptoHost;\r
18 import org.opendaylight.controller.hosttracker.HostTracker;\r
19 \r
20 import org.opendaylight.controller.switchmanager.ISwitchManager;\r
21 import org.opendaylight.controller.switchmanager.internal.SwitchManagerImpl;\r
22 \r
23 \r
24 public class ArphandlerTest extends TestCase {\r
25          \r
26         @Test\r
27         public void testArphandlerCreation() {\r
28                         \r
29                 ArpHandler ah = null;\r
30                 ah = new ArpHandler();\r
31                 Assert.assertTrue(ah != null);\r
32                         \r
33                 HostTracker hostTracker = null;\r
34                 hostTracker = new HostTracker();\r
35                 ah.setHostTracker(hostTracker);\r
36                 IfIptoHost ht= ah.getHostTracker();\r
37                 Assert.assertTrue(ht.equals(hostTracker));\r
38                 ah.unsetHostTracker(hostTracker);\r
39                 ht= ah.getHostTracker();\r
40                 Assert.assertTrue(ht == null);\r
41                 \r
42                 ah.setHostListener(hostTracker);\r
43                 ah.unsetHostListener(hostTracker);\r
44                 \r
45                 ISwitchManager swManager = new SwitchManagerImpl();\r
46                 ah.setSwitchManager(swManager);\r
47                 ah.unsetSwitchManager(swManager);\r
48                 \r
49         }\r
50 \r
51 \r
52 }\r