2 * Copyright (c) 2014 Cisco Systems, Inc. and others. 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
9 package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.node;
13 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.node.SwitchListener;
14 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.node.SwitchManager;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.ofoverlay.rev140528.OfOverlayNodeConfig;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
20 * Mock version of switch manager suitable for unit tests
22 public class MockSwitchManager extends SwitchManager {
24 public MockSwitchManager() {
28 public void addSwitch(NodeId node,
29 NodeConnectorId tunnelPort,
30 Set<NodeConnectorId> externalPorts,
31 OfOverlayNodeConfig nodeConfig) {
32 SwitchState state = new SwitchState(node, tunnelPort,
33 externalPorts, nodeConfig);
34 state.status = SwitchStatus.READY;
35 state.setHasEndpoints(true);
36 switches.put(node, state);
37 for (SwitchListener listener : listeners) {
38 listener.switchReady(node);