Added range type to subject-feature-definition/parameter
[groupbasedpolicy.git] / renderers / ofoverlay / src / test / java / org / opendaylight / groupbasedpolicy / renderer / ofoverlay / MockSwitchManager.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  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
9 package org.opendaylight.groupbasedpolicy.renderer.ofoverlay;
10
11 import java.util.Set;
12
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.ofoverlay.rev140528.OfOverlayNodeConfig;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
16
17 /**
18  * Mock version of switch manager suitable for unit tests
19  */
20 public class MockSwitchManager extends SwitchManager {
21
22     public MockSwitchManager() {
23         super(null, null);
24     }
25
26     public void addSwitch(NodeId node, 
27                           NodeConnectorId tunnelPort,
28                           Set<NodeConnectorId> externalPorts,
29                           OfOverlayNodeConfig nodeConfig) {
30         SwitchState state = new SwitchState(node, tunnelPort, 
31                                             externalPorts, nodeConfig);
32         state.status = SwitchStatus.READY;
33         switches.put(node, state);
34         for (SwitchListener listener : listeners) {
35             listener.switchReady(node);
36         }
37     }
38 }