summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util
diff options
context:
space:
mode:
authorCNlucius <lukai1@huawei.com>2016-09-13 11:40:12 +0800
committerCNlucius <lukai1@huawei.com>2016-09-13 11:41:53 +0800
commitb731e2f1dd0972409b136aebc7b463dd72c9cfad (patch)
tree5107d7d80c19ad8076c2c97c2b5ef8d1cf3ab903 /framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util
parentee93993458266114c29271a481ef9ce7ce621b2a (diff)
ONOSFW-171
O/S-SFC-ONOS scenario documentation Change-Id: I51ae1cf736ea24ab6680f8edca1b2bf5dd598365 Signed-off-by: CNlucius <lukai1@huawei.com>
Diffstat (limited to 'framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util')
-rw-r--r--framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowClassifierManagerTestImpl.java93
-rw-r--r--framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowObjectiveServiceTestImpl.java53
-rw-r--r--framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortChainManagerTestImpl.java85
-rw-r--r--framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairGroupManagerTestImpl.java89
-rw-r--r--framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairManagerTestImpl.java89
-rw-r--r--framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VirtualPortManagerTestImpl.java98
-rw-r--r--framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VtnRscManagerTestImpl.java72
7 files changed, 0 insertions, 579 deletions
diff --git a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowClassifierManagerTestImpl.java b/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowClassifierManagerTestImpl.java
deleted file mode 100644
index fe5babbd..00000000
--- a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowClassifierManagerTestImpl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.sfc.util;
-
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.onosproject.vtnrsc.FlowClassifierId;
-import org.onosproject.vtnrsc.FlowClassifier;
-import org.onosproject.vtnrsc.flowclassifier.FlowClassifierListener;
-import org.onosproject.vtnrsc.flowclassifier.FlowClassifierService;
-
-import com.google.common.collect.ImmutableList;
-
-/**
- * Provides implementation of the Flow Classifier Service.
- */
-public class FlowClassifierManagerTestImpl implements FlowClassifierService {
-
- private final ConcurrentMap<FlowClassifierId, FlowClassifier> flowClassifierStore = new ConcurrentHashMap<>();
-
- @Override
- public boolean exists(FlowClassifierId id) {
- return flowClassifierStore.containsKey(id);
- }
-
- @Override
- public int getFlowClassifierCount() {
- return flowClassifierStore.size();
- }
-
- @Override
- public Iterable<FlowClassifier> getFlowClassifiers() {
- return ImmutableList.copyOf(flowClassifierStore.values());
- }
-
- @Override
- public FlowClassifier getFlowClassifier(FlowClassifierId id) {
- return flowClassifierStore.get(id);
- }
-
- @Override
- public boolean createFlowClassifier(FlowClassifier flowClassifier) {
- FlowClassifierId id = flowClassifier.flowClassifierId();
-
- flowClassifierStore.put(id, flowClassifier);
- if (!flowClassifierStore.containsKey(id)) {
- return false;
- }
- return true;
- }
-
- @Override
- public boolean updateFlowClassifier(FlowClassifier flowClassifier) {
-
- if (!flowClassifierStore.containsKey(flowClassifier.flowClassifierId())) {
- return false;
- }
-
- flowClassifierStore.put(flowClassifier.flowClassifierId(), flowClassifier);
-
- if (!flowClassifier.equals(flowClassifierStore.get(flowClassifier.flowClassifierId()))) {
- return false;
- }
- return true;
- }
-
- @Override
- public boolean removeFlowClassifier(FlowClassifierId id) {
- return true;
- }
-
- @Override
- public void addListener(FlowClassifierListener listener) {
- }
-
- @Override
- public void removeListener(FlowClassifierListener listener) {
- }
-}
diff --git a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowObjectiveServiceTestImpl.java b/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowObjectiveServiceTestImpl.java
deleted file mode 100644
index 9da9ee94..00000000
--- a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowObjectiveServiceTestImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.sfc.util;
-
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.flowobjective.FlowObjectiveService;
-import org.onosproject.net.flowobjective.FilteringObjective;
-import org.onosproject.net.flowobjective.ForwardingObjective;
-import org.onosproject.net.flowobjective.NextObjective;
-
-/**
- * Testing version of implementation on FlowObjectiveService.
- */
-public class FlowObjectiveServiceTestImpl implements FlowObjectiveService {
-
- @Override
- public void filter(DeviceId deviceId, FilteringObjective filteringObjective) {
-
- }
-
- @Override
- public void forward(DeviceId deviceId, ForwardingObjective forwardingObjective) {
-
- }
-
- @Override
- public void next(DeviceId deviceId, NextObjective nextObjective) {
-
- }
-
- @Override
- public int allocateNextId() {
- return 0;
- }
-
- @Override
- public void initPolicy(String policy) {
-
- }
-}
diff --git a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortChainManagerTestImpl.java b/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortChainManagerTestImpl.java
deleted file mode 100644
index 4a3ba03d..00000000
--- a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortChainManagerTestImpl.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.sfc.util;
-
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.Collections;
-
-import org.onosproject.vtnrsc.PortChain;
-import org.onosproject.vtnrsc.PortChainId;
-import org.onosproject.vtnrsc.portchain.PortChainService;
-import org.onosproject.vtnrsc.portchain.PortChainEvent;
-import org.onosproject.vtnrsc.portchain.PortChainListener;
-import org.onosproject.event.AbstractListenerManager;
-
-/**
- * Provides implementation of the portChainService.
- */
-public class PortChainManagerTestImpl
- extends AbstractListenerManager<PortChainEvent, PortChainListener>
- implements PortChainService {
-
- private ConcurrentMap<PortChainId, PortChain> portChainStore = new ConcurrentHashMap<>();
-
- @Override
- public boolean exists(PortChainId portChainId) {
- return portChainStore.containsKey(portChainId);
- }
-
- @Override
- public int getPortChainCount() {
- return portChainStore.size();
- }
-
- @Override
- public Iterable<PortChain> getPortChains() {
- return Collections.unmodifiableCollection(portChainStore.values());
- }
-
- @Override
- public PortChain getPortChain(PortChainId portChainId) {
- return portChainStore.get(portChainId);
- }
-
- @Override
- public boolean createPortChain(PortChain portChain) {
- portChainStore.put(portChain.portChainId(), portChain);
- if (!portChainStore.containsKey(portChain.portChainId())) {
- return false;
- }
- return true;
- }
-
- @Override
- public boolean updatePortChain(PortChain portChain) {
- if (!portChainStore.containsKey(portChain.portChainId())) {
- return false;
- }
-
- portChainStore.put(portChain.portChainId(), portChain);
-
- if (!portChain.equals(portChainStore.get(portChain.portChainId()))) {
- return false;
- }
- return true;
- }
-
- @Override
- public boolean removePortChain(PortChainId portChainId) {
- return true;
- }
-}
diff --git a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairGroupManagerTestImpl.java b/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairGroupManagerTestImpl.java
deleted file mode 100644
index ba31cd60..00000000
--- a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairGroupManagerTestImpl.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.sfc.util;
-
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.Collections;
-
-import org.onosproject.vtnrsc.PortPairGroup;
-import org.onosproject.vtnrsc.PortPairGroupId;
-import org.onosproject.vtnrsc.portpairgroup.PortPairGroupListener;
-import org.onosproject.vtnrsc.portpairgroup.PortPairGroupService;
-
-/**
- * Provides implementation of the portPairGroupService.
- */
-public class PortPairGroupManagerTestImpl implements PortPairGroupService {
-
- private ConcurrentMap<PortPairGroupId, PortPairGroup> portPairGroupStore = new ConcurrentHashMap<>();
-
- @Override
- public boolean exists(PortPairGroupId portPairGroupId) {
- return portPairGroupStore.containsKey(portPairGroupId);
- }
-
- @Override
- public int getPortPairGroupCount() {
- return portPairGroupStore.size();
- }
-
- @Override
- public Iterable<PortPairGroup> getPortPairGroups() {
- return Collections.unmodifiableCollection(portPairGroupStore.values());
- }
-
- @Override
- public PortPairGroup getPortPairGroup(PortPairGroupId portPairGroupId) {
- return portPairGroupStore.get(portPairGroupId);
- }
-
- @Override
- public boolean createPortPairGroup(PortPairGroup portPairGroup) {
- portPairGroupStore.put(portPairGroup.portPairGroupId(), portPairGroup);
- if (!portPairGroupStore.containsKey(portPairGroup.portPairGroupId())) {
- return false;
- }
- return true;
- }
-
- @Override
- public boolean updatePortPairGroup(PortPairGroup portPairGroup) {
- if (!portPairGroupStore.containsKey(portPairGroup.portPairGroupId())) {
- return false;
- }
-
- portPairGroupStore.put(portPairGroup.portPairGroupId(), portPairGroup);
-
- if (!portPairGroup.equals(portPairGroupStore.get(portPairGroup.portPairGroupId()))) {
- return false;
- }
- return true;
- }
-
- @Override
- public boolean removePortPairGroup(PortPairGroupId portPairGroupId) {
- return true;
- }
-
- @Override
- public void addListener(PortPairGroupListener listener) {
- }
-
- @Override
- public void removeListener(PortPairGroupListener listener) {
- }
-}
diff --git a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairManagerTestImpl.java b/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairManagerTestImpl.java
deleted file mode 100644
index aff58823..00000000
--- a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairManagerTestImpl.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.sfc.util;
-
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.Collections;
-
-import org.onosproject.vtnrsc.PortPair;
-import org.onosproject.vtnrsc.PortPairId;
-import org.onosproject.vtnrsc.portpair.PortPairListener;
-import org.onosproject.vtnrsc.portpair.PortPairService;
-
-/**
- * Provides implementation of the portPairService.
- */
-public class PortPairManagerTestImpl implements PortPairService {
-
- private ConcurrentMap<PortPairId, PortPair> portPairStore = new ConcurrentHashMap<>();
-
- @Override
- public boolean exists(PortPairId portPairId) {
- return portPairStore.containsKey(portPairId);
- }
-
- @Override
- public int getPortPairCount() {
- return portPairStore.size();
- }
-
- @Override
- public Iterable<PortPair> getPortPairs() {
- return Collections.unmodifiableCollection(portPairStore.values());
- }
-
- @Override
- public PortPair getPortPair(PortPairId portPairId) {
- return portPairStore.get(portPairId);
- }
-
- @Override
- public boolean createPortPair(PortPair portPair) {
- portPairStore.put(portPair.portPairId(), portPair);
- if (!portPairStore.containsKey(portPair.portPairId())) {
- return false;
- }
- return true;
- }
-
- @Override
- public boolean updatePortPair(PortPair portPair) {
- if (!portPairStore.containsKey(portPair.portPairId())) {
- return false;
- }
-
- portPairStore.put(portPair.portPairId(), portPair);
-
- if (!portPair.equals(portPairStore.get(portPair.portPairId()))) {
- return false;
- }
- return true;
- }
-
- @Override
- public boolean removePortPair(PortPairId portPairId) {
- return true;
- }
-
- @Override
- public void addListener(PortPairListener listener) {
- }
-
- @Override
- public void removeListener(PortPairListener listener) {
- }
-}
diff --git a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VirtualPortManagerTestImpl.java b/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VirtualPortManagerTestImpl.java
deleted file mode 100644
index de056a78..00000000
--- a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VirtualPortManagerTestImpl.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.sfc.util;
-
-import java.util.Collection;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.onlab.packet.IpAddress;
-import org.onosproject.net.DeviceId;
-import org.onosproject.vtnrsc.FixedIp;
-import org.onosproject.vtnrsc.TenantId;
-import org.onosproject.vtnrsc.VirtualPort;
-import org.onosproject.vtnrsc.VirtualPortId;
-import org.onosproject.vtnrsc.TenantNetworkId;
-import org.onosproject.vtnrsc.virtualport.VirtualPortService;
-
-/**
- * Provides implementation of the VirtualPort APIs.
- */
-public class VirtualPortManagerTestImpl implements VirtualPortService {
-
- protected ConcurrentMap<VirtualPortId, VirtualPort> vPortStore = new ConcurrentHashMap<>();
-
- @Override
- public boolean exists(VirtualPortId vPortId) {
- return vPortStore.containsKey(vPortId);
- }
-
- @Override
- public VirtualPort getPort(VirtualPortId vPortId) {
- return vPortStore.get(vPortId);
- }
-
- @Override
- public VirtualPort getPort(FixedIp fixedIP) {
- return null;
- }
-
- @Override
- public Collection<VirtualPort> getPorts() {
- return null;
- }
-
- @Override
- public Collection<VirtualPort> getPorts(TenantNetworkId networkId) {
- return null;
- }
-
- @Override
- public Collection<VirtualPort> getPorts(TenantId tenantId) {
- return null;
- }
-
- @Override
- public Collection<VirtualPort> getPorts(DeviceId deviceId) {
- return null;
- }
-
- @Override
- public VirtualPort getPort(TenantNetworkId networkId, IpAddress ipAddress) {
- return null;
- }
-
- @Override
- public boolean createPorts(Iterable<VirtualPort> vPorts) {
- for (VirtualPort vPort : vPorts) {
- vPortStore.put(vPort.portId(), vPort);
- if (!vPortStore.containsKey(vPort.portId())) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public boolean updatePorts(Iterable<VirtualPort> vPorts) {
- return true;
- }
-
- @Override
- public boolean removePorts(Iterable<VirtualPortId> vPortIds) {
- return true;
- }
-}
diff --git a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VtnRscManagerTestImpl.java b/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VtnRscManagerTestImpl.java
deleted file mode 100644
index 4188cee6..00000000
--- a/framework/src/onos/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VtnRscManagerTestImpl.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.sfc.util;
-
-import java.util.Iterator;
-
-import org.onlab.packet.MacAddress;
-import org.onosproject.net.Device;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.HostId;
-import org.onosproject.vtnrsc.SegmentationId;
-import org.onosproject.vtnrsc.TenantId;
-import org.onosproject.vtnrsc.VirtualPortId;
-import org.onosproject.vtnrsc.event.VtnRscListener;
-import org.onosproject.vtnrsc.service.VtnRscService;
-
-/**
- * Provides implementation of the VtnRsc service.
- */
-public class VtnRscManagerTestImpl implements VtnRscService {
- @Override
- public void addListener(VtnRscListener listener) {
- }
-
- @Override
- public void removeListener(VtnRscListener listener) {
- }
-
- @Override
- public SegmentationId getL3vni(TenantId tenantId) {
- return null;
- }
-
- @Override
- public Iterator<Device> getClassifierOfTenant(TenantId tenantId) {
- return null;
- }
-
- @Override
- public Iterator<Device> getSFFOfTenant(TenantId tenantId) {
- return null;
- }
-
- @Override
- public MacAddress getGatewayMac(HostId hostId) {
- return null;
- }
-
- @Override
- public boolean isServiceFunction(VirtualPortId portId) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public DeviceId getSFToSFFMaping(VirtualPortId portId) {
- return DeviceId.deviceId("www.google.com");
- }
-}