Remove deprecated DefaultPath constructor with a scalar cost

Change-Id: Ifc4104cff773c9c692cc108fda02ce44bc6c2870
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 6d015ae..e37ae41 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 @@
 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 @@
                 .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 @@
                 .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 @@
                 .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 @@
                 .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 @@
                 .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 @@
                 .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 @@
                 .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 @@
                 .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 @@
                 .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 @@
                 .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 @@
                 .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 @@
                 .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 @@
                 .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 @@
                 .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 @@
                 .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 @@
                 .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 982a4f9..c504501 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 @@
 
 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 @@
 
     private final List<Link> 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;