@@ -0,0 +1,2742 @@
+/*%0A * Copyright 2015 Open Networking Laboratory%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.onosproject.sfc.util;%0A%0Aimport java.util.Collection;%0Aimport java.util.concurrent.ConcurrentMap;%0Aimport java.util.concurrent.ConcurrentHashMap;%0A%0Aimport org.onlab.packet.IpAddress;%0Aimport org.onosproject.net.DeviceId;%0Aimport org.onosproject.vtnrsc.FixedIp;%0Aimport org.onosproject.vtnrsc.TenantId;%0Aimport org.onosproject.vtnrsc.VirtualPort;%0Aimport org.onosproject.vtnrsc.VirtualPortId;%0Aimport org.onosproject.vtnrsc.TenantNetworkId;%0Aimport org.onosproject.vtnrsc.virtualport.VirtualPortService;%0A%0A/**%0A * Provides implementation of the VirtualPort APIs.%0A */%0Apublic class VirtualPortManagerTestImpl implements VirtualPortService %7B%0A%0A    protected ConcurrentMap%3CVirtualPortId, VirtualPort%3E vPortStore = new ConcurrentHashMap%3C%3E();%0A%0A    @Override%0A    public boolean exists(VirtualPortId vPortId) %7B%0A        return vPortStore.containsKey(vPortId);%0A    %7D%0A%0A    @Override%0A    public VirtualPort getPort(VirtualPortId vPortId) %7B%0A        return vPortStore.get(vPortId);%0A    %7D%0A%0A    @Override%0A    public VirtualPort getPort(FixedIp fixedIP) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public Collection%3CVirtualPort%3E getPorts() %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public Collection%3CVirtualPort%3E getPorts(TenantNetworkId networkId) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public Collection%3CVirtualPort%3E getPorts(TenantId tenantId) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public Collection%3CVirtualPort%3E getPorts(DeviceId deviceId) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public VirtualPort getPort(TenantNetworkId networkId, IpAddress ipAddress) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public boolean createPorts(Iterable%3CVirtualPort%3E vPorts) %7B%0A        for (VirtualPort vPort : vPorts) %7B%0A            vPortStore.put(vPort.portId(), vPort);%0A            if (!vPortStore.containsKey(vPort.portId())) %7B%0A                return false;%0A            %7D%0A        %7D%0A        return true;%0A    %7D%0A%0A    @Override%0A    public boolean updatePorts(Iterable%3CVirtualPort%3E vPorts) %7B%0A        return true;%0A    %7D%0A%0A    @Override%0A    public boolean removePorts(Iterable%3CVirtualPortId%3E vPortIds) %7B%0A        return true;%0A    %7D%0A%7D%0A

Test stub on VirtualPortManager