3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
\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
10 package org.opendaylight.controller.arphandler.internal;
\r
13 import org.junit.Assert;
\r
14 import org.junit.Test;
\r
15 import junit.framework.TestCase;
\r
17 import org.opendaylight.controller.hosttracker.IfIptoHost;
\r
18 import org.opendaylight.controller.hosttracker.HostTracker;
\r
20 import org.opendaylight.controller.switchmanager.ISwitchManager;
\r
21 import org.opendaylight.controller.switchmanager.internal.SwitchManagerImpl;
\r
24 public class ArphandlerTest extends TestCase {
\r
27 public void testArphandlerCreation() {
\r
29 ArpHandler ah = null;
\r
30 ah = new ArpHandler();
\r
31 Assert.assertTrue(ah != null);
\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
42 ah.setHostListener(hostTracker);
\r
43 ah.unsetHostListener(hostTracker);
\r
45 ISwitchManager swManager = new SwitchManagerImpl();
\r
46 ah.setSwitchManager(swManager);
\r
47 ah.unsetSwitchManager(swManager);
\r