Cleaned up the SRLG and disjoint path code and naming.
Change-Id: I02b6fe5ee1e3f5eadc4e88800386a23349ee5e58
diff --git a/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java b/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
index 8d30551..d42e22f 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
@@ -17,12 +17,10 @@
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableSet;
-
import org.onlab.util.Bandwidth;
import org.onosproject.core.DefaultGroupId;
import org.onosproject.core.GroupId;
import org.onosproject.net.DeviceId;
-import org.onosproject.net.DisjointPath;
import org.onosproject.net.ElementId;
import org.onosproject.net.Link;
import org.onosproject.net.NetTestTools;
@@ -38,6 +36,9 @@
import org.onosproject.net.flow.instructions.Instruction;
import org.onosproject.net.flow.instructions.Instructions;
import org.onosproject.net.flow.instructions.Instructions.MetadataInstruction;
+import org.onosproject.net.resource.ResourceAllocation;
+import org.onosproject.net.resource.ResourceRequest;
+import org.onosproject.net.resource.ResourceType;
import org.onosproject.net.resource.link.BandwidthResource;
import org.onosproject.net.resource.link.BandwidthResourceRequest;
import org.onosproject.net.resource.link.LambdaResource;
@@ -49,13 +50,10 @@
import org.onosproject.net.resource.link.LinkResourceService;
import org.onosproject.net.resource.link.MplsLabel;
import org.onosproject.net.resource.link.MplsLabelResourceAllocation;
-import org.onosproject.net.resource.ResourceAllocation;
-import org.onosproject.net.resource.ResourceRequest;
-import org.onosproject.net.resource.ResourceType;
import org.onosproject.net.topology.DefaultTopologyEdge;
import org.onosproject.net.topology.DefaultTopologyVertex;
import org.onosproject.net.topology.LinkWeight;
-import org.onosproject.net.topology.PathService;
+import org.onosproject.net.topology.PathServiceAdapter;
import org.onosproject.net.topology.TopologyVertex;
import org.onosproject.store.Timestamp;
@@ -65,14 +63,11 @@
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
-import static org.onosproject.net.NetTestTools.createPath;
-import static org.onosproject.net.NetTestTools.did;
-import static org.onosproject.net.NetTestTools.link;
+import static org.onosproject.net.NetTestTools.*;
/**
* Common mocks used by the intent framework tests.
@@ -136,7 +131,7 @@
/**
* Mock path service for creating paths within the test.
*/
- public static class MockPathService implements PathService {
+ public static class MockPathService extends PathServiceAdapter {
final String[] pathHops;
final String[] reversePathHops;
@@ -187,28 +182,6 @@
}
return paths;
}
-
- @Override
- public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst) {
- return null;
- }
-
- @Override
- public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst, LinkWeight weight) {
- return null;
- }
-
- @Override
- public Set<DisjointPath> getSRLGDisjointPaths(ElementId src, ElementId dst,
- Map<Link, Object> riskProfile) {
- return null;
- }
-
- @Override
- public Set<DisjointPath> getSRLGDisjointPaths(ElementId src, ElementId dst, LinkWeight weight,
- Map<Link, Object> riskProfile) {
- return null;
- }
}
public static class MockLinkResourceAllocations implements LinkResourceAllocations {
diff --git a/core/api/src/test/java/org/onosproject/net/topology/PathServiceAdapter.java b/core/api/src/test/java/org/onosproject/net/topology/PathServiceAdapter.java
new file mode 100644
index 0000000..6a8e586
--- /dev/null
+++ b/core/api/src/test/java/org/onosproject/net/topology/PathServiceAdapter.java
@@ -0,0 +1,62 @@
+/*
+ * 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.net.topology;
+
+import org.onosproject.net.DisjointPath;
+import org.onosproject.net.ElementId;
+import org.onosproject.net.Link;
+import org.onosproject.net.Path;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Test adapter for path service.
+ */
+public class PathServiceAdapter implements PathService {
+ @Override
+ public Set<Path> getPaths(ElementId src, ElementId dst) {
+ return null;
+ }
+
+ @Override
+ public Set<Path> getPaths(ElementId src, ElementId dst, LinkWeight weight) {
+ return null;
+ }
+
+ @Override
+ public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst) {
+ return null;
+ }
+
+ @Override
+ public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst, LinkWeight weight) {
+ return null;
+ }
+
+ @Override
+ public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst,
+ Map<Link, Object> riskProfile) {
+ return null;
+ }
+
+ @Override
+ public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst,
+ LinkWeight weight,
+ Map<Link, Object> riskProfile) {
+ return null;
+ }
+}
diff --git a/core/api/src/test/java/org/onosproject/net/topology/TopologyServiceAdapter.java b/core/api/src/test/java/org/onosproject/net/topology/TopologyServiceAdapter.java
index b5b3056..72cc67d 100644
--- a/core/api/src/test/java/org/onosproject/net/topology/TopologyServiceAdapter.java
+++ b/core/api/src/test/java/org/onosproject/net/topology/TopologyServiceAdapter.java
@@ -90,25 +90,28 @@
@Override
public void removeListener(TopologyListener listener) {
}
+
@Override
public Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst) {
return null;
}
@Override
- public Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeight weight) {
+ public Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src,
+ DeviceId dst, LinkWeight weight) {
return null;
}
@Override
- public Set<DisjointPath> getSRLGDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
- Map<Link, Object> riskProfile) {
+ public Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
+ Map<Link, Object> riskProfile) {
return null;
}
@Override
- public Set<DisjointPath> getSRLGDisjointPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeight weight,
- Map<Link, Object> riskProfile) {
+ public Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src,
+ DeviceId dst, LinkWeight weight,
+ Map<Link, Object> riskProfile) {
return null;
}