Remove some calls to the deprecated Path.cost() API

Change-Id: I71d01fdf35d8a06639e6422b4c8d5998b14e319d
diff --git a/apps/pce/app/src/test/java/org/onosproject/pce/pceservice/PathComputationTest.java b/apps/pce/app/src/test/java/org/onosproject/pce/pceservice/PathComputationTest.java
index fd13454..2241d6d 100644
--- a/apps/pce/app/src/test/java/org/onosproject/pce/pceservice/PathComputationTest.java
+++ b/apps/pce/app/src/test/java/org/onosproject/pce/pceservice/PathComputationTest.java
@@ -483,7 +483,7 @@
         links.add(link2);
 
         assertThat(paths.iterator().next().links(), is(links));
-        assertThat(paths.iterator().next().cost(), is((double) 70));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(70.0)));
     }
 
     /**
@@ -524,7 +524,7 @@
         links.add(link2);
 
         assertThat(paths.iterator().next().links(), is(links));
-        assertThat(paths.iterator().next().cost(), is((double) 200));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(200.0)));
     }
 
     /**
@@ -561,7 +561,7 @@
 
         Set<Path> paths = computePath(link1, link2, link3, link4, constraints);
 
-        assertThat(paths.iterator().next().cost(), is((double) 2));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(2.0)));
     }
 
     /**
@@ -597,7 +597,7 @@
         constraints.add(bandwidthConst);
         Set<Path> paths = computePath(link1, link2, link3, link4, constraints);
 
-        assertThat(paths.iterator().next().cost(), is((double) 2));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(2.0)));
     }
 
     /**
@@ -662,7 +662,7 @@
         constraints.add(costConst);
         Set<Path> paths = computePath(link1, link2, link3, link4, constraints);
         assertThat(paths.iterator().next().links(), is(links));
-        assertThat(paths.iterator().next().cost(), is((double) 70));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(70.0)));
     }
 
     /**
@@ -727,7 +727,7 @@
         Set<Path> paths = computePath(link1, link2, link3, link4, constraints);
 
         assertThat(paths.iterator().next().links(), is(links));
-        assertThat(paths.iterator().next().cost(), is((double) 70));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(70.0)));
     }
 
     /**
@@ -742,7 +742,7 @@
         List<Constraint> constraints = new LinkedList<>();
         Set<Path> paths = computePath(link1, link2, link3, link4, constraints);
 
-        assertThat(paths.iterator().next().cost(), is((double) 2));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(2.0)));
     }
 
     /**
@@ -784,7 +784,7 @@
         links.add(link1);
         links.add(link2);
         assertThat(paths.iterator().next().links(), is(links));
-        assertThat(paths.iterator().next().cost(), is((double) 70));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(70.0)));
     }
 
     /**
@@ -877,7 +877,7 @@
         links.add(link1);
         links.add(link2);
         assertThat(paths.iterator().next().links(), is(links));
-        assertThat(paths.iterator().next().cost(), is((double) 70));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(70.0)));
     }
 
     /**
@@ -964,7 +964,7 @@
         links.add(link1);
         links.add(link2);
         assertThat(paths.iterator().next().links(), is(links));
-        assertThat(paths.iterator().next().cost(), is((double) 70));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(70.0)));
     }
 
     /**
@@ -1050,7 +1050,7 @@
         links.add(link1);
         links.add(link2);
         assertThat(paths.iterator().next().links(), is(links));
-        assertThat(paths.iterator().next().cost(), is((double) 70));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(70.0)));
     }
 
     /**
@@ -1138,7 +1138,7 @@
         links.add(link1);
         links.add(link2);
         assertThat(paths.iterator().next().links(), is(links));
-        assertThat(paths.iterator().next().cost(), is((double) 70));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(70.0)));
     }
 
     /**
@@ -1205,7 +1205,7 @@
         List<Link> links = new LinkedList<>();
         links.add(link1);
         links.add(link2);
-        assertThat(paths.iterator().next().cost(), is((double) 2));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(2.0)));
     }
 
     /**
@@ -1221,7 +1221,7 @@
         List<Constraint> constraints = new LinkedList<>();
         Set<Path> paths = computePath(link1, link2, link3, link4, constraints);
 
-        assertThat(paths.iterator().next().cost(), is((double) 2));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(2.0)));
     }
 
     /**
@@ -1237,7 +1237,7 @@
         List<Constraint> constraints = null;
         Set<Path> paths = computePath(link1, link2, link3, link4, constraints);
 
-        assertThat(paths.iterator().next().cost(), is((double) 2));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(2.0)));
     }
 
     /**
@@ -1296,7 +1296,7 @@
         links.add(link4);
         links.add(link5);
         assertThat(builder.build().iterator().next().links(), is(links));
-        assertThat(builder.build().iterator().next().cost(), is((double) 40));
+        assertThat(builder.build().iterator().next().weight(), is(ScalarWeight.toWeight(40.0)));
     }
 
     /**
@@ -1353,7 +1353,7 @@
         links.add(link2);
 
         assertThat(paths.iterator().next().links(), is(links));
-        assertThat(paths.iterator().next().cost(), is((double) 2));
+        assertThat(paths.iterator().next().weight(), is(ScalarWeight.toWeight(2.0)));
     }
 
     /**