From a7cf8c8f554264390ce2a156593f99e24d6954fc Mon Sep 17 00:00:00 2001 From: Ray Milkey Date: Thu, 8 Feb 2018 15:07:06 -0800 Subject: [PATCH] Remove deprecated DefaultPath constructor with a scalar cost Change-Id: Ifc4104cff773c9c692cc108fda02ce44bc6c2870 --- .../OpticalOduIntentCompilerTest.java | 3 +- .../OpticalPathIntentCompilerTest.java | 3 +- .../pce/pceservice/PceManager.java | 6 ++-- .../pcerest/PcePathResourceTest.java | 3 +- .../segmentrouting/EcmpShortestPathGraph.java | 3 +- .../java/org/onosproject/net/DefaultPath.java | 20 ----------- .../net/DefaultDisjointPathTest.java | 7 ++-- .../org/onosproject/net/NetTestTools.java | 5 +-- .../net/intent/IntentTestsMocks.java | 3 +- .../net/intent/PathIntentTest.java | 5 +-- .../constraint/LatencyConstraintTest.java | 3 +- .../constraint/ObstacleConstraintTest.java | 5 +-- .../constraint/WaypointConstraintTest.java | 3 +- .../compiler/HostToHostIntentCompiler.java | 2 +- .../compiler/PointToPointIntentCompiler.java | 18 +++++----- .../ProtectedTransportIntentCompiler.java | 2 +- .../impl/compiler/PathIntentCompilerTest.java | 33 ++++++++++--------- .../net/intent/impl/phase/CompilingTest.java | 3 +- .../DefaultVirtualFlowRuleProviderTest.java | 9 +++-- .../label/BasicPceccHandlerTest.java | 3 +- .../label/PceccSrTeBeHandlerTest.java | 3 +- .../tunnel/OvsdbTunnelProviderTest.java | 7 ++-- .../pcep/tunnel/impl/PcepTunnelProvider.java | 5 +-- .../impl/PcepReleaseTunnelProviderTest.java | 9 ++--- .../impl/PcepSetupTunnelProviderTest.java | 12 ++++--- .../tunnel/impl/PcepTunnelProviderTest.java | 3 +- .../impl/PcepUpdateTunnelProviderTest.java | 9 ++--- 27 files changed, 100 insertions(+), 87 deletions(-) diff --git a/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalOduIntentCompilerTest.java b/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalOduIntentCompilerTest.java index 1ae85a7832..46c408f186 100644 --- a/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalOduIntentCompilerTest.java +++ b/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalOduIntentCompilerTest.java @@ -19,6 +19,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Sets; import org.junit.Before; import org.junit.Test; +import org.onlab.graph.ScalarWeight; import org.onlab.packet.ChassisId; import org.onosproject.TestApplicationId; import org.onosproject.core.ApplicationId; @@ -161,7 +162,7 @@ public class OpticalOduIntentCompilerTest extends AbstractIntentTest { DefaultLink.builder().providerId(PID).src(d1p2).dst(d2p1).type(OPTICAL).build(), DefaultLink.builder().providerId(PID).src(d2p2).dst(d3p1).type(OPTICAL).build() ); - private final Path path = new DefaultPath(PID, links, 3); + private final Path path = new DefaultPath(PID, links, ScalarWeight.toWeight(3)); private OpticalOduIntent intent; diff --git a/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalPathIntentCompilerTest.java b/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalPathIntentCompilerTest.java index d8ae141f14..43c279ded4 100644 --- a/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalPathIntentCompilerTest.java +++ b/apps/optical-model/src/test/java/org/onosproject/net/optical/intent/impl/compiler/OpticalPathIntentCompilerTest.java @@ -17,6 +17,7 @@ package org.onosproject.net.optical.intent.impl.compiler; import org.junit.Before; import org.junit.Test; +import org.onlab.graph.ScalarWeight; import org.onosproject.TestApplicationId; import org.onosproject.core.ApplicationId; import org.onosproject.core.CoreService; @@ -78,7 +79,7 @@ public class OpticalPathIntentCompilerTest extends AbstractIntentTest { .appId(appId) .src(d1p1) .dst(d3p1) - .path(new DefaultPath(PID, links, hops)) + .path(new DefaultPath(PID, links, ScalarWeight.toWeight(hops))) .lambda(createLambda()) .signalType(OchSignalType.FIXED_GRID) .build(); diff --git a/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/PceManager.java b/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/PceManager.java index d1e3d669e6..3ecdd5bc05 100644 --- a/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/PceManager.java +++ b/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/PceManager.java @@ -17,6 +17,7 @@ package org.onosproject.pce.pceservice; import static com.google.common.base.Preconditions.checkNotNull; +import org.onlab.graph.ScalarWeight; import org.onosproject.net.DisjointPath; import java.util.ArrayList; import java.util.Collection; @@ -532,7 +533,8 @@ public class PceManager implements PceService { links.addAll(path.links()); totalCost = totalCost + path.cost(); } - computedPathSet.add(new DefaultPath(finalComputedPath.iterator().next().providerId(), links, totalCost)); + computedPathSet.add(new DefaultPath(finalComputedPath.iterator().next().providerId(), links, + ScalarWeight.toWeight(totalCost))); } else { computedPathSet = computePath(src, dst, constraints); } @@ -804,7 +806,7 @@ public class PceManager implements PceService { totalCost = totalCost + path.cost(); } computedPathSet.add(new DefaultPath(finalComputedPath.iterator().next().providerId(), - totalLinks, totalCost)); + totalLinks, ScalarWeight.toWeight(totalCost))); } else { computedPathSet = computePath(tunnel.path().src().deviceId(), tunnel.path().dst().deviceId(), constraints); diff --git a/apps/pce/pcerest/src/test/java/org/onosproject/pcerest/PcePathResourceTest.java b/apps/pce/pcerest/src/test/java/org/onosproject/pcerest/PcePathResourceTest.java index 51f5c2db4e..1e35395c79 100644 --- a/apps/pce/pcerest/src/test/java/org/onosproject/pcerest/PcePathResourceTest.java +++ b/apps/pce/pcerest/src/test/java/org/onosproject/pcerest/PcePathResourceTest.java @@ -44,6 +44,7 @@ import com.google.common.collect.Lists; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.onlab.graph.ScalarWeight; import org.onlab.junit.TestUtils; import org.onlab.osgi.ServiceDirectory; import org.onlab.osgi.TestServiceDirectory; @@ -165,7 +166,7 @@ public class PcePathResourceTest extends PceResourceTest { linkList.add(l4); // Path - path = new DefaultPath(providerId, linkList, 10); + path = new DefaultPath(providerId, linkList, ScalarWeight.toWeight(10)); // Annotations DefaultAnnotations.Builder builderAnn = DefaultAnnotations.builder(); diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java index 49bf80f4d3..c9bd5964da 100644 --- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java +++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/EcmpShortestPathGraph.java @@ -15,6 +15,7 @@ */ package org.onosproject.segmentrouting; +import org.onlab.graph.ScalarWeight; import org.onosproject.net.DefaultLink; import org.onosproject.net.DefaultPath; import org.onosproject.net.Device; @@ -131,7 +132,7 @@ public class EcmpShortestPathGraph { sofarLinks.addAll(path.links()); } sofarLinks.add(upstreamLink); - sofarPath = new DefaultPath(ProviderId.NONE, sofarLinks, 0); + sofarPath = new DefaultPath(ProviderId.NONE, sofarLinks, ScalarWeight.toWeight(0)); if (upstreamLink.src().deviceId().equals(rootDeviceDeviceId)) { paths.add(sofarPath); return; diff --git a/core/api/src/main/java/org/onosproject/net/DefaultPath.java b/core/api/src/main/java/org/onosproject/net/DefaultPath.java index aa0b697f54..3fd3eced17 100644 --- a/core/api/src/main/java/org/onosproject/net/DefaultPath.java +++ b/core/api/src/main/java/org/onosproject/net/DefaultPath.java @@ -35,26 +35,6 @@ public class DefaultPath extends DefaultLink implements Path { private final List links; private final Weight cost; - /** - * Creates a path from the specified source and destination using the - * supplied list of links. - * - * @param providerId provider identity - * @param links contiguous links that comprise the path - * @param cost unit-less path cost - * @param annotations optional key/value annotations - * - * @deprecated in Junco (1.9.0) - */ - @Deprecated - public DefaultPath(ProviderId providerId, List links, double cost, - Annotations... annotations) { - super(providerId, source(links), destination(links), Type.INDIRECT, - State.ACTIVE, annotations); - this.links = ImmutableList.copyOf(links); - this.cost = new ScalarWeight(cost); - } - /** * Creates a path from the specified source and destination using the * supplied list of links. 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 ec6281418c..5c30c5718a 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 org.junit.Test; 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 @@ public class DefaultDisjointPathTest { private static List 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 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 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 8f161fcab2..dcc3e1502b 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 @@ public final class NetTestTools { 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 @@ public final class NetTestTools { 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 59aad9c942..48b4a8706a 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 @@ package org.onosproject.net.intent; 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 @@ public class IntentTestsMocks { } 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 e55f21fcd5..ec1fc1a894 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.Arrays; 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 @@ public class PathIntentTest extends ConnectivityIntentTest { .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 @@ public class PathIntentTest extends ConnectivityIntentTest { .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 b035ee4a58..eada7bfbbf 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 @@ package org.onosproject.net.intent.constraint; 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 @@ public class LatencyConstraintTest { .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 359555b736..29e7c987da 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.collect.ImmutableSet; 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 @@ public class ObstacleConstraintTest { 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 ffe96cd817..060607b00d 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 @@ package org.onosproject.net.intent.constraint; 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 @@ public class WaypointConstraintTest { .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)); } /** diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompiler.java index bf2b2740de..4ba0bfe7fa 100644 --- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompiler.java +++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/HostToHostIntentCompiler.java @@ -102,7 +102,7 @@ public class HostToHostIntentCompiler for (Link link : path.links()) { reverseLinks.add(0, reverseLink(link)); } - return new DefaultPath(path.providerId(), reverseLinks, path.cost()); + return new DefaultPath(path.providerId(), reverseLinks, path.weight()); } // Produces a reverse variant of the specified link. diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java index 0c471960b1..32784a38b8 100644 --- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java +++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PointToPointIntentCompiler.java @@ -21,6 +21,7 @@ import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Deactivate; import org.apache.felix.scr.annotations.Reference; import org.apache.felix.scr.annotations.ReferenceCardinality; +import org.onlab.graph.ScalarWeight; import org.onosproject.net.ConnectPoint; import org.onosproject.net.DefaultPath; import org.onosproject.net.DeviceId; @@ -150,7 +151,7 @@ public class PointToPointIntentCompiler ConnectPoint egressPoint, PointToPointIntent intent) { List links = asList(createEdgeLink(ingressPoint, true), createEdgeLink(egressPoint, false)); - return asList(createPathIntent(new DefaultPath(PID, links, DEFAULT_COST), + return asList(createPathIntent(new DefaultPath(PID, links, ScalarWeight.toWeight(DEFAULT_COST)), intent, PathIntent.ProtectionType.PRIMARY)); } @@ -179,7 +180,7 @@ public class PointToPointIntentCompiler links.addAll(path.links()); links.add(createEdgeLink(egressPoint, false)); - return asList(createPathIntent(new DefaultPath(PID, links, path.cost(), + return asList(createPathIntent(new DefaultPath(PID, links, path.weight(), path.annotations()), intent, PathIntent.ProtectionType.PRIMARY)); } @@ -253,23 +254,24 @@ public class PointToPointIntentCompiler PortNumber primaryPort = getPrimaryPort(intent); if (primaryPort != null && !links.get(0).src().port().equals(primaryPort)) { reusableIntents.add(createPathIntent(new DefaultPath(PID, links, - path.cost(), path.annotations()), + path.weight(), path.annotations()), intent, PathIntent.ProtectionType.BACKUP)); updateFailoverGroup(intent, links); return reusableIntents; } else { - reusableIntents.add(createPathIntent(new DefaultPath(PID, backupLinks, path.backup().cost(), - path.backup().annotations()), intent, PathIntent.ProtectionType.BACKUP)); + reusableIntents.add(createPathIntent(new DefaultPath(PID, backupLinks, + path.backup().weight(), + path.backup().annotations()), intent, PathIntent.ProtectionType.BACKUP)); updateFailoverGroup(intent, backupLinks); return reusableIntents; } } - intentList.add(createPathIntent(new DefaultPath(PID, links, path.cost(), + intentList.add(createPathIntent(new DefaultPath(PID, links, path.weight(), path.annotations()), intent, PathIntent.ProtectionType.PRIMARY)); - intentList.add(createPathIntent(new DefaultPath(PID, backupLinks, path.backup().cost(), + intentList.add(createPathIntent(new DefaultPath(PID, backupLinks, path.backup().weight(), path.backup().annotations()), intent, PathIntent.ProtectionType.BACKUP)); @@ -335,7 +337,7 @@ public class PointToPointIntentCompiler links.add(createEdgeLink(ingressPoint, true)); links.addAll(onlyPath.links()); links.add(createEdgeLink(egressPoint, false)); - return asList(createPathIntent(new DefaultPath(PID, links, onlyPath.cost(), + return asList(createPathIntent(new DefaultPath(PID, links, onlyPath.weight(), onlyPath.annotations()), intent, PathIntent.ProtectionType.PRIMARY)); } diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/ProtectedTransportIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/ProtectedTransportIntentCompiler.java index f7eceef623..9020e5aedb 100644 --- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/ProtectedTransportIntentCompiler.java +++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/ProtectedTransportIntentCompiler.java @@ -299,7 +299,7 @@ public class ProtectedTransportIntentCompiler List revLinks = Lists.reverse(transform(path.links(), this::reverse)); return new DefaultPath(path.providerId(), revLinks, - path.cost(), + path.weight(), path.annotations()); } diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/PathIntentCompilerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/PathIntentCompilerTest.java index 6d015ae28a..e37ae41969 100644 --- a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/PathIntentCompilerTest.java +++ b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/PathIntentCompilerTest.java @@ -18,6 +18,7 @@ package org.onosproject.net.intent.impl.compiler; import com.google.common.collect.ImmutableList; import org.junit.Before; import org.junit.Test; +import org.onlab.graph.ScalarWeight; import org.onlab.packet.Ethernet; import org.onlab.packet.MplsLabel; import org.onlab.packet.VlanId; @@ -172,7 +173,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .selector(selector) .treatment(treatment) .priority(PRIORITY) - .path(new DefaultPath(pid, links, hops)) + .path(new DefaultPath(pid, links, ScalarWeight.toWeight(hops))) .build(); //Intent with VLAN encap without egress VLAN @@ -182,7 +183,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(treatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, links, hops)) + .path(new DefaultPath(pid, links, ScalarWeight.toWeight(hops))) .build(); //Intent with VLAN encap with ingress and egress VLAN @@ -192,7 +193,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(vlanTreatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, links, hops)) + .path(new DefaultPath(pid, links, ScalarWeight.toWeight(hops))) .build(); constraintMplsIntent = PathIntent.builder() @@ -201,7 +202,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(treatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.MPLS))) - .path(new DefaultPath(pid, links, hops)) + .path(new DefaultPath(pid, links, ScalarWeight.toWeight(hops))) .build(); edgeIntentNoVlan = PathIntent.builder() @@ -210,7 +211,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(treatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, edgeNet, edgeHops)) + .path(new DefaultPath(pid, edgeNet, ScalarWeight.toWeight(edgeHops))) .build(); edgeIntentIngressVlan = PathIntent.builder() @@ -219,7 +220,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(treatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, edgeNet, edgeHops)) + .path(new DefaultPath(pid, edgeNet, ScalarWeight.toWeight(edgeHops))) .build(); edgeIntentEgressVlan = PathIntent.builder() @@ -228,7 +229,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(vlanTreatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, edgeNet, edgeHops)) + .path(new DefaultPath(pid, edgeNet, ScalarWeight.toWeight(edgeHops))) .build(); edgeIntentVlan = PathIntent.builder() @@ -237,7 +238,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(vlanTreatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, edgeNet, edgeHops)) + .path(new DefaultPath(pid, edgeNet, ScalarWeight.toWeight(edgeHops))) .build(); singleHopIndirectIntentNoVlan = PathIntent.builder() @@ -246,7 +247,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(treatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, singleHopIndirect, singleHopIndirectHops)) + .path(new DefaultPath(pid, singleHopIndirect, ScalarWeight.toWeight(singleHopIndirectHops))) .build(); singleHopIndirectIntentIngressVlan = PathIntent.builder() @@ -255,7 +256,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(treatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, singleHopIndirect, singleHopIndirectHops)) + .path(new DefaultPath(pid, singleHopIndirect, ScalarWeight.toWeight(singleHopIndirectHops))) .build(); singleHopIndirectIntentEgressVlan = PathIntent.builder() @@ -264,7 +265,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(vlanTreatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, singleHopIndirect, singleHopIndirectHops)) + .path(new DefaultPath(pid, singleHopIndirect, ScalarWeight.toWeight(singleHopIndirectHops))) .build(); singleHopIndirectIntentVlan = PathIntent.builder() @@ -273,7 +274,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(vlanTreatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, singleHopIndirect, singleHopIndirectHops)) + .path(new DefaultPath(pid, singleHopIndirect, ScalarWeight.toWeight(singleHopIndirectHops))) .build(); singleHopDirectIntentNoVlan = PathIntent.builder() @@ -282,7 +283,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(treatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, singleHopDirect, singleHopDirectHops)) + .path(new DefaultPath(pid, singleHopDirect, ScalarWeight.toWeight(singleHopDirectHops))) .build(); singleHopDirectIntentIngressVlan = PathIntent.builder() @@ -291,7 +292,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(treatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, singleHopDirect, singleHopDirectHops)) + .path(new DefaultPath(pid, singleHopDirect, ScalarWeight.toWeight(singleHopDirectHops))) .build(); singleHopDirectIntentEgressVlan = PathIntent.builder() @@ -300,7 +301,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(vlanTreatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, singleHopDirect, singleHopDirectHops)) + .path(new DefaultPath(pid, singleHopDirect, ScalarWeight.toWeight(singleHopDirectHops))) .build(); singleHopDirectIntentVlan = PathIntent.builder() @@ -309,7 +310,7 @@ public class PathIntentCompilerTest extends AbstractIntentTest { .treatment(vlanTreatment) .priority(PRIORITY) .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN))) - .path(new DefaultPath(pid, singleHopDirect, singleHopDirectHops)) + .path(new DefaultPath(pid, singleHopDirect, ScalarWeight.toWeight(singleHopDirectHops))) .build(); intentExtensionService = createMock(IntentExtensionService.class); diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/CompilingTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/CompilingTest.java index 982a4f90e6..c504501029 100644 --- a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/CompilingTest.java +++ b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/CompilingTest.java @@ -17,6 +17,7 @@ package org.onosproject.net.intent.impl.phase; import org.junit.Before; import org.junit.Test; +import org.onlab.graph.ScalarWeight; import org.onosproject.TestApplicationId; import org.onosproject.core.ApplicationId; import org.onosproject.core.IdGenerator; @@ -67,7 +68,7 @@ public class CompilingTest extends AbstractIntentTest { private final List links = Collections.singletonList( DefaultLink.builder().providerId(pid).src(cp2).dst(cp4).type(DIRECT).build()); - private final Path path = new DefaultPath(pid, links, 10); + private final Path path = new DefaultPath(pid, links, ScalarWeight.toWeight(10)); private PointToPointIntent input; private PathIntent compiled; diff --git a/incubator/net/src/test/java/org/onosproject/incubator/net/virtual/impl/provider/DefaultVirtualFlowRuleProviderTest.java b/incubator/net/src/test/java/org/onosproject/incubator/net/virtual/impl/provider/DefaultVirtualFlowRuleProviderTest.java index 94bc091d36..72698ae392 100644 --- a/incubator/net/src/test/java/org/onosproject/incubator/net/virtual/impl/provider/DefaultVirtualFlowRuleProviderTest.java +++ b/incubator/net/src/test/java/org/onosproject/incubator/net/virtual/impl/provider/DefaultVirtualFlowRuleProviderTest.java @@ -21,6 +21,8 @@ import com.google.common.collect.ImmutableSet; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.onlab.graph.ScalarWeight; +import org.onlab.graph.Weight; import org.onosproject.core.ApplicationId; import org.onosproject.core.CoreServiceAdapter; import org.onosproject.core.DefaultApplicationId; @@ -332,10 +334,11 @@ public class DefaultVirtualFlowRuleProviderTest { private static class TestTopologyService extends TopologyServiceAdapter { + Weight oneHundred = ScalarWeight.toWeight(100); @Override public Set getPaths(Topology topology, DeviceId src, DeviceId dst) { DefaultPath path = new DefaultPath(PID, ImmutableList.of(LINK1), - 100, ANNOTATIONS); + oneHundred, ANNOTATIONS); return ImmutableSet.of(path); } @@ -343,7 +346,7 @@ public class DefaultVirtualFlowRuleProviderTest { public Set getPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeight weight) { DefaultPath path = new DefaultPath(PID, ImmutableList.of(LINK1), - 100, ANNOTATIONS); + oneHundred, ANNOTATIONS); return ImmutableSet.of(path); } @@ -351,7 +354,7 @@ public class DefaultVirtualFlowRuleProviderTest { public Set getPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeigher weigher) { DefaultPath path = new DefaultPath(PID, ImmutableList.of(LINK1), - 100, ANNOTATIONS); + oneHundred, ANNOTATIONS); return ImmutableSet.of(path); } diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/BasicPceccHandlerTest.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/BasicPceccHandlerTest.java index 201b701409..7b3a92c28d 100644 --- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/BasicPceccHandlerTest.java +++ b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/BasicPceccHandlerTest.java @@ -27,6 +27,7 @@ import java.util.LinkedList; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.onlab.graph.ScalarWeight; import org.onlab.packet.IpAddress; import org.onosproject.core.GroupId; import org.onosproject.incubator.net.tunnel.Tunnel; @@ -192,7 +193,7 @@ public class BasicPceccHandlerTest { linkList.add(l4); // Path - path = new DefaultPath(providerId, linkList, 10); + path = new DefaultPath(providerId, linkList, ScalarWeight.toWeight(10)); // Tunnel tunnel = new DefaultTunnel(producerName, src, dst, Tunnel.Type.VXLAN, diff --git a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/PceccSrTeBeHandlerTest.java b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/PceccSrTeBeHandlerTest.java index 38ea63a909..a9bc3bc5a8 100644 --- a/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/PceccSrTeBeHandlerTest.java +++ b/protocols/pcep/server/ctl/src/test/java/org/onosproject/pcelabelstore/label/PceccSrTeBeHandlerTest.java @@ -27,6 +27,7 @@ import java.util.LinkedList; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.onlab.graph.ScalarWeight; import org.onlab.packet.IpAddress; import org.onosproject.incubator.net.resource.label.LabelResourceId; import org.onosproject.incubator.net.resource.label.LabelResourceAdminService; @@ -224,7 +225,7 @@ public class PceccSrTeBeHandlerTest { linkList.add(link4); // Path - path1 = new DefaultPath(providerId, linkList, 10); + path1 = new DefaultPath(providerId, linkList, ScalarWeight.toWeight(10)); } @After diff --git a/providers/ovsdb/tunnel/src/test/java/org/onosproject/ovsdb/provider/tunnel/OvsdbTunnelProviderTest.java b/providers/ovsdb/tunnel/src/test/java/org/onosproject/ovsdb/provider/tunnel/OvsdbTunnelProviderTest.java index 84a1855240..7801c4adec 100644 --- a/providers/ovsdb/tunnel/src/test/java/org/onosproject/ovsdb/provider/tunnel/OvsdbTunnelProviderTest.java +++ b/providers/ovsdb/tunnel/src/test/java/org/onosproject/ovsdb/provider/tunnel/OvsdbTunnelProviderTest.java @@ -26,6 +26,7 @@ import java.util.Set; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.onlab.graph.ScalarWeight; import org.onlab.packet.IpAddress; import org.onosproject.core.GroupId; import org.onosproject.incubator.net.tunnel.DefaultTunnelDescription; @@ -94,7 +95,8 @@ public class OvsdbTunnelProviderTest { new GroupId(0), this.provider.id(), TunnelName.tunnelName("tunnel12"), - new DefaultPath(this.provider.id(), links, 0.3), + new DefaultPath(this.provider.id(), links, + ScalarWeight.toWeight(0.3)), annotations); provider.tunnelAdded(tunnel); assertEquals(1, providerService.tunnelSet.size()); @@ -119,7 +121,8 @@ public class OvsdbTunnelProviderTest { new GroupId(0), this.provider.id(), TunnelName.tunnelName("tunnel1"), - new DefaultPath(this.provider.id(), links, 0.3), + new DefaultPath(this.provider.id(), links, + ScalarWeight.toWeight(0.3)), annotations); provider.tunnelRemoved(tunnel); assertEquals(0, providerService.tunnelSet.size()); diff --git a/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java b/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java index a6fa58b26a..4b7b6058cb 100644 --- a/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java +++ b/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java @@ -24,6 +24,7 @@ import org.apache.felix.scr.annotations.Property; import org.apache.felix.scr.annotations.Reference; import org.apache.felix.scr.annotations.ReferenceCardinality; import org.apache.felix.scr.annotations.Service; +import org.onlab.graph.ScalarWeight; import org.onlab.packet.Ip4Address; import org.onlab.packet.IpAddress; import org.onosproject.cfg.ComponentConfigService; @@ -735,7 +736,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid .set("pathNum", String.valueOf(hopNum)) .set("pathState", String.valueOf(pathState)) .set("pathType", String.valueOf(pathtype)).build(); - return new DefaultPath(id(), links, hopNum, extendAnnotations); + return new DefaultPath(id(), links, ScalarWeight.toWeight(hopNum), extendAnnotations); } // convert the path description to a string. @@ -1531,7 +1532,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid } Path path = null; if (!links.isEmpty()) { - path = new DefaultPath(providerId, links, cost, EMPTY); + path = new DefaultPath(providerId, links, ScalarWeight.toWeight(cost), EMPTY); } else if (!lspObj.getRFlag()) { return; } diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepReleaseTunnelProviderTest.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepReleaseTunnelProviderTest.java index cfede3062f..121557a4e4 100644 --- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepReleaseTunnelProviderTest.java +++ b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepReleaseTunnelProviderTest.java @@ -32,6 +32,7 @@ import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.onlab.graph.ScalarWeight; import org.onlab.packet.IpAddress; import org.onosproject.cfg.ComponentConfigAdapter; import org.onosproject.core.GroupId; @@ -115,7 +116,7 @@ public class PcepReleaseTunnelProviderTest { .type(Link.Type.DIRECT).build(); links.add(link); - path = new DefaultPath(pid, links, 20, EMPTY); + path = new DefaultPath(pid, links, ScalarWeight.toWeight(20), EMPTY); Annotations annotations = DefaultAnnotations.builder() .set(LSP_SIG_TYPE, WITH_SIGNALLING.name()) @@ -171,7 +172,7 @@ public class PcepReleaseTunnelProviderTest { .type(Link.Type.DIRECT).build(); links.add(link); - path = new DefaultPath(pid, links, 20, EMPTY); + path = new DefaultPath(pid, links, ScalarWeight.toWeight(20), EMPTY); Annotations annotations = DefaultAnnotations.builder() .set(LSP_SIG_TYPE, WITH_SIGNALLING.name()) @@ -227,7 +228,7 @@ public class PcepReleaseTunnelProviderTest { .type(Link.Type.DIRECT).build(); links.add(link); - path = new DefaultPath(pid, links, 20, EMPTY); + path = new DefaultPath(pid, links, ScalarWeight.toWeight(20), EMPTY); Annotations annotations = DefaultAnnotations.builder() .set(LSP_SIG_TYPE, SR_WITHOUT_SIGNALLING.name()) @@ -283,7 +284,7 @@ public class PcepReleaseTunnelProviderTest { .type(Link.Type.DIRECT).build(); links.add(link); - path = new DefaultPath(pid, links, 20, EMPTY); + path = new DefaultPath(pid, links, ScalarWeight.toWeight(20), EMPTY); Annotations annotations = DefaultAnnotations.builder() .set(LSP_SIG_TYPE, WITHOUT_SIGNALLING_AND_WITHOUT_SR.name()) diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepSetupTunnelProviderTest.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepSetupTunnelProviderTest.java index 375b08f862..b02e3e34a6 100644 --- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepSetupTunnelProviderTest.java +++ b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepSetupTunnelProviderTest.java @@ -32,6 +32,8 @@ import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.onlab.graph.ScalarWeight; +import org.onlab.graph.Weight; import org.onlab.packet.IpAddress; import org.onosproject.cfg.ComponentConfigAdapter; import org.onosproject.core.GroupId; @@ -68,6 +70,8 @@ public class PcepSetupTunnelProviderTest { private final TunnelServiceAdapter tunnelService = new TunnelServiceAdapter(); private final DeviceServiceAdapter deviceService = new DeviceServiceAdapter(); private final MastershipServiceAdapter mastershipService = new MastershipServiceAdapter(); + private static final Weight TEN_WEIGHT = ScalarWeight.toWeight(10); + @Before public void setUp() throws IOException { @@ -110,7 +114,7 @@ public class PcepSetupTunnelProviderTest { .type(Link.Type.DIRECT).build(); links.add(link); - path = new DefaultPath(pid, links, 10, EMPTY); + path = new DefaultPath(pid, links, TEN_WEIGHT, EMPTY); Annotations annotations = DefaultAnnotations.builder() .set(LSP_SIG_TYPE, WITH_SIGNALLING.name()) @@ -155,7 +159,7 @@ public class PcepSetupTunnelProviderTest { .type(Link.Type.DIRECT).build(); links.add(link); - path = new DefaultPath(pid, links, 10, EMPTY); + path = new DefaultPath(pid, links, TEN_WEIGHT, EMPTY); Annotations annotations = DefaultAnnotations.builder() .set(LSP_SIG_TYPE, WITH_SIGNALLING.name()) @@ -200,7 +204,7 @@ public class PcepSetupTunnelProviderTest { .type(Link.Type.DIRECT).build(); links.add(link); - path = new DefaultPath(pid, links, 10, EMPTY); + path = new DefaultPath(pid, links, TEN_WEIGHT, EMPTY); Annotations annotations = DefaultAnnotations.builder() .set(LSP_SIG_TYPE, SR_WITHOUT_SIGNALLING.name()) @@ -245,7 +249,7 @@ public class PcepSetupTunnelProviderTest { .type(Link.Type.DIRECT).build(); links.add(link); - path = new DefaultPath(pid, links, 10, EMPTY); + path = new DefaultPath(pid, links, TEN_WEIGHT, EMPTY); Annotations annotations = DefaultAnnotations.builder() .set(LSP_SIG_TYPE, WITHOUT_SIGNALLING_AND_WITHOUT_SR.name()) diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProviderTest.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProviderTest.java index 15bb705235..cb4123df03 100644 --- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProviderTest.java +++ b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProviderTest.java @@ -28,6 +28,7 @@ import java.util.List; import org.junit.After; import org.junit.Test; +import org.onlab.graph.ScalarWeight; import org.onlab.packet.IpAddress; import org.onosproject.core.GroupId; import org.onosproject.incubator.net.tunnel.DefaultTunnel; @@ -98,7 +99,7 @@ public class PcepTunnelProviderTest { .type(Link.Type.DIRECT).build(); links.add(link); - path = new DefaultPath(pid, links, 10, EMPTY); + path = new DefaultPath(pid, links, ScalarWeight.toWeight(10), EMPTY); Annotations annotations = DefaultAnnotations.builder() .set(LSP_SIG_TYPE, WITH_SIGNALLING.name()) diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepUpdateTunnelProviderTest.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepUpdateTunnelProviderTest.java index abef4039fc..8d9f4e6e26 100644 --- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepUpdateTunnelProviderTest.java +++ b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepUpdateTunnelProviderTest.java @@ -31,6 +31,7 @@ import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.onlab.graph.ScalarWeight; import org.onlab.packet.IpAddress; import org.onosproject.cfg.ComponentConfigAdapter; import org.onosproject.core.GroupId; @@ -111,7 +112,7 @@ public class PcepUpdateTunnelProviderTest { .type(Link.Type.DIRECT).build(); links.add(link); - path = new DefaultPath(pid, links, 20, EMPTY); + path = new DefaultPath(pid, links, ScalarWeight.toWeight(20), EMPTY); Annotations annotations = DefaultAnnotations.builder() .set(PLSP_ID, "1") @@ -171,7 +172,7 @@ public class PcepUpdateTunnelProviderTest { .type(Link.Type.DIRECT).build(); links.add(link); - path = new DefaultPath(pid, links, 20, EMPTY); + path = new DefaultPath(pid, links, ScalarWeight.toWeight(20), EMPTY); Annotations annotations = DefaultAnnotations.builder() .set(LSP_SIG_TYPE, WITH_SIGNALLING.name()) @@ -231,7 +232,7 @@ public class PcepUpdateTunnelProviderTest { .type(Link.Type.DIRECT).build(); links.add(link); - path = new DefaultPath(pid, links, 20, EMPTY); + path = new DefaultPath(pid, links, ScalarWeight.toWeight(20), EMPTY); Annotations annotations = DefaultAnnotations.builder() .set(LSP_SIG_TYPE, SR_WITHOUT_SIGNALLING.name()) @@ -291,7 +292,7 @@ public class PcepUpdateTunnelProviderTest { .type(Link.Type.DIRECT).build(); links.add(link); - path = new DefaultPath(pid, links, 20, EMPTY); + path = new DefaultPath(pid, links, ScalarWeight.toWeight(20), EMPTY); Annotations annotations = DefaultAnnotations.builder() .set(LSP_SIG_TYPE, WITHOUT_SIGNALLING_AND_WITHOUT_SR.name())