X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fentityownership%2Fselectionstrategy%2FLeastLoadedCandidateSelectionStrategyTest.java;h=a7f1657906b92a9f32552dd4d21c75eff34de0f9;hb=f83b2d36fdd7e953ba72492ffb684cd112aa04a6;hp=d0cd32f1b01f7ec529b2874fa6db023a56f0a0b0;hpb=bb1891e328feee08ccd29c96034e967f1eeccece;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/LeastLoadedCandidateSelectionStrategyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/LeastLoadedCandidateSelectionStrategyTest.java index d0cd32f1b0..a7f1657906 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/LeastLoadedCandidateSelectionStrategyTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/LeastLoadedCandidateSelectionStrategyTest.java @@ -8,6 +8,7 @@ package org.opendaylight.controller.cluster.datastore.entityownership.selectionstrategy; import static org.junit.Assert.assertEquals; + import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -18,8 +19,9 @@ import org.junit.Test; public class LeastLoadedCandidateSelectionStrategyTest { @Test - public void testLeastLoadedStrategy(){ - LeastLoadedCandidateSelectionStrategy strategy = new LeastLoadedCandidateSelectionStrategy(0L, Collections.emptyMap()); + public void testLeastLoadedStrategy() { + LeastLoadedCandidateSelectionStrategy strategy = new LeastLoadedCandidateSelectionStrategy( + 0L, Collections.emptyMap()); String owner = strategy.newOwner(null, prepareViableCandidates(3)); assertEquals("member-1", owner); @@ -63,25 +65,25 @@ public class LeastLoadedCandidateSelectionStrategyTest { } - private static Map prepareStatistics(long... count){ + private static Map prepareStatistics(long... count) { Map statistics = new HashMap<>(); - for(int i=0;i prepareViableCandidates(int count){ + private static Collection prepareViableCandidates(int count) { Collection viableCandidates = new ArrayList<>(); - for(int i=0;i statistics, long... count){ - for(int i=0;i statistics, long... count) { + for (int i = 0; i < count.length; i++) { + assertEquals(count[i], (long) statistics.get("member-" + (i + 1))); } } -} \ No newline at end of file +}