Remove deprecated DefaultPath constructor with a scalar cost
Change-Id: Ifc4104cff773c9c692cc108fda02ce44bc6c2870
diff --git a/core/api/src/test/java/org/onosproject/net/DefaultDisjointPathTest.java b/core/api/src/test/java/org/onosproject/net/DefaultDisjointPathTest.java
index ec62814..5c30c57 100644
--- a/core/api/src/test/java/org/onosproject/net/DefaultDisjointPathTest.java
+++ b/core/api/src/test/java/org/onosproject/net/DefaultDisjointPathTest.java
@@ -21,6 +21,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.testing.EqualsTester;
+import org.onlab.graph.ScalarWeight;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
@@ -53,15 +54,15 @@
private static List<Link> links1 = ImmutableList.of(link1, link2);
private static DefaultPath path1 =
- new DefaultPath(PID, links1, 1.0);
+ new DefaultPath(PID, links1, ScalarWeight.toWeight(1.0));
private static List<Link> links2 = ImmutableList.of(link2, link1);
private static DefaultPath path2 =
- new DefaultPath(PID, links2, 2.0);
+ new DefaultPath(PID, links2, ScalarWeight.toWeight(2.0));
private static List<Link> links3 = ImmutableList.of(link1, link2, link3);
private static DefaultPath path3 =
- new DefaultPath(PID, links3, 3.0);
+ new DefaultPath(PID, links3, ScalarWeight.toWeight(3.0));
private static DefaultDisjointPath disjointPath1 =
new DefaultDisjointPath(PID, path1, path2);
diff --git a/core/api/src/test/java/org/onosproject/net/NetTestTools.java b/core/api/src/test/java/org/onosproject/net/NetTestTools.java
index 8f161fc..dcc3e15 100644
--- a/core/api/src/test/java/org/onosproject/net/NetTestTools.java
+++ b/core/api/src/test/java/org/onosproject/net/NetTestTools.java
@@ -16,6 +16,7 @@
package org.onosproject.net;
import com.google.common.collect.ImmutableList;
+import org.onlab.graph.ScalarWeight;
import org.onlab.junit.TestUtils;
import org.onlab.packet.ChassisId;
import org.onlab.packet.IpPrefix;
@@ -130,7 +131,7 @@
for (int i = 0; i < ids.length - 1; i++) {
links.add(link(ids[i], 2, ids[i + 1], 1));
}
- return new DefaultPath(PID, links, ids.length);
+ return new DefaultPath(PID, links, ScalarWeight.toWeight(ids.length));
}
// Creates a path that leads through the given hosts.
@@ -145,7 +146,7 @@
links.add(link(ids[i], 2, ids[i + 1], 1));
}
}
- return new DefaultPath(PID, links, ids.length);
+ return new DefaultPath(PID, links, ScalarWeight.toWeight(ids.length));
}
// Creates OCh signal
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 59aad9c..48b4a87 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,6 +17,7 @@
import com.google.common.base.MoreObjects;
import com.google.common.collect.Sets;
+import org.onlab.graph.ScalarWeight;
import org.onlab.graph.Weight;
import org.onosproject.core.GroupId;
import org.onosproject.net.DefaultPath;
@@ -290,7 +291,7 @@
} else {
return result;
}
- path = new DefaultPath(providerId, links, 3);
+ path = new DefaultPath(providerId, links, ScalarWeight.toWeight(3));
result.add(path);
return result;
diff --git a/core/api/src/test/java/org/onosproject/net/intent/PathIntentTest.java b/core/api/src/test/java/org/onosproject/net/intent/PathIntentTest.java
index e55f21f..ec1fc1a 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/PathIntentTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/PathIntentTest.java
@@ -19,6 +19,7 @@
import java.util.Collections;
import org.junit.Test;
+import org.onlab.graph.ScalarWeight;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DefaultLink;
import org.onosproject.net.DefaultPath;
@@ -133,7 +134,7 @@
.appId(APPID)
.selector(MATCH)
.treatment(NOP)
- .path(new DefaultPath(provider1, Collections.singletonList(link1), cost))
+ .path(new DefaultPath(provider1, Collections.singletonList(link1), ScalarWeight.toWeight(cost)))
.build();
}
@@ -147,7 +148,7 @@
.appId(APPID)
.selector(MATCH)
.treatment(NOP)
- .path(new DefaultPath(provider1, Arrays.asList(link1, link2), cost))
+ .path(new DefaultPath(provider1, Arrays.asList(link1, link2), ScalarWeight.toWeight(cost)))
.build();
}
diff --git a/core/api/src/test/java/org/onosproject/net/intent/constraint/LatencyConstraintTest.java b/core/api/src/test/java/org/onosproject/net/intent/constraint/LatencyConstraintTest.java
index b035ee4..eada7bf 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/constraint/LatencyConstraintTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/constraint/LatencyConstraintTest.java
@@ -18,6 +18,7 @@
import com.google.common.testing.EqualsTester;
import org.junit.Before;
import org.junit.Test;
+import org.onlab.graph.ScalarWeight;
import org.onosproject.net.Annotations;
import org.onosproject.net.DefaultAnnotations;
import org.onosproject.net.DefaultLink;
@@ -83,7 +84,7 @@
.type(DIRECT)
.annotations(annotations2)
.build();
- path = new DefaultPath(PROVIDER_ID, Arrays.asList(link1, link2), 10);
+ path = new DefaultPath(PROVIDER_ID, Arrays.asList(link1, link2), ScalarWeight.toWeight(10));
}
/**
diff --git a/core/api/src/test/java/org/onosproject/net/intent/constraint/ObstacleConstraintTest.java b/core/api/src/test/java/org/onosproject/net/intent/constraint/ObstacleConstraintTest.java
index 359555b..29e7c98 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/constraint/ObstacleConstraintTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/constraint/ObstacleConstraintTest.java
@@ -22,6 +22,7 @@
import com.google.common.testing.EqualsTester;
import org.junit.Before;
import org.junit.Test;
+import org.onlab.graph.ScalarWeight;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
import org.onosproject.net.DefaultAnnotations;
@@ -100,9 +101,9 @@
edgelink1 = createEdgeLink(host1, true);
edgelink2 = createEdgeLink(host2, false);
- path = new DefaultPath(PROVIDER_ID, Arrays.asList(link1, link2), 10);
+ path = new DefaultPath(PROVIDER_ID, Arrays.asList(link1, link2), ScalarWeight.toWeight(10));
pathWithEdgeLink = new DefaultPath(PROVIDER_ID,
- Arrays.asList(edgelink1, link1, link2, edgelink2), 10);
+ Arrays.asList(edgelink1, link1, link2, edgelink2), ScalarWeight.toWeight(10));
}
@Test
diff --git a/core/api/src/test/java/org/onosproject/net/intent/constraint/WaypointConstraintTest.java b/core/api/src/test/java/org/onosproject/net/intent/constraint/WaypointConstraintTest.java
index ffe96cd..060607b 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/constraint/WaypointConstraintTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/constraint/WaypointConstraintTest.java
@@ -18,6 +18,7 @@
import com.google.common.testing.EqualsTester;
import org.junit.Before;
import org.junit.Test;
+import org.onlab.graph.ScalarWeight;
import org.onosproject.net.DefaultLink;
import org.onosproject.net.DefaultPath;
import org.onosproject.net.DeviceId;
@@ -75,7 +76,7 @@
.type(DIRECT)
.build();
- path = new DefaultPath(PROVIDER_ID, Arrays.asList(link1, link2), 10);
+ path = new DefaultPath(PROVIDER_ID, Arrays.asList(link1, link2), ScalarWeight.toWeight(10));
}
/**