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%2FEntityOwnerSelectionStrategyConfigReaderTest.java;fp=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fentityownership%2Fselectionstrategy%2FEntityOwnerSelectionStrategyConfigReaderTest.java;h=ca8340ae688ba3d691f92d5f48a1dfb47b0786e2;hb=5464f50be733df1bbbe31cf05665d542d3b7c5e7;hp=f16a90532d35bc4a9a0daa0c1ac6d2cfeb738755;hpb=aa77e20225cc04235315892cf148393149cbf8fc;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReaderTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReaderTest.java index f16a90532d..ca8340ae68 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReaderTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReaderTest.java @@ -13,6 +13,7 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; + import java.io.IOException; import java.util.Collections; import java.util.Hashtable; @@ -53,9 +54,10 @@ public class EntityOwnerSelectionStrategyConfigReaderTest { } @Test - public void testReadStrategies(){ + public void testReadStrategies() { Hashtable props = new Hashtable<>(); - props.put("entity.type.test", "org.opendaylight.controller.cluster.datastore.entityownership.selectionstrategy.LastCandidateSelectionStrategy,100"); + props.put("entity.type.test", "org.opendaylight.controller.cluster.datastore.entityownership." + + "selectionstrategy.LastCandidateSelectionStrategy,100"); doReturn(props).when(mockConfig).getProperties(); @@ -67,18 +69,19 @@ public class EntityOwnerSelectionStrategyConfigReaderTest { assertTrue(strategy.toString(), strategy instanceof LastCandidateSelectionStrategy); assertEquals(100L, strategy.getSelectionDelayInMillis()); - final EntityOwnerSelectionStrategy strategy1 = config.createStrategy("test", Collections.emptyMap()); + final EntityOwnerSelectionStrategy strategy1 = config.createStrategy("test", Collections.emptyMap()); assertEquals(strategy, strategy1); config.clearStrategies(); - final EntityOwnerSelectionStrategy strategy2 = config.createStrategy("test", Collections.emptyMap()); + final EntityOwnerSelectionStrategy strategy2 = config.createStrategy("test", Collections.emptyMap()); assertNotEquals(strategy1, strategy2); } @Test public void testReadStrategiesWithIOException() throws IOException { - doThrow(IOException.class).when(mockConfigAdmin).getConfiguration(EntityOwnerSelectionStrategyConfigReader.CONFIG_ID); + doThrow(IOException.class).when(mockConfigAdmin).getConfiguration( + EntityOwnerSelectionStrategyConfigReader.CONFIG_ID); EntityOwnerSelectionStrategyConfig config = loadStrategyConfig(); @@ -104,9 +107,10 @@ public class EntityOwnerSelectionStrategyConfigReaderTest { } @Test(expected = IllegalArgumentException.class) - public void testReadStrategiesInvalidDelay(){ + public void testReadStrategiesInvalidDelay() { Hashtable props = new Hashtable<>(); - props.put("entity.type.test", "org.opendaylight.controller.cluster.datastore.entityownership.selectionstrategy.LastCandidateSelectionStrategy,foo"); + props.put("entity.type.test", "org.opendaylight.controller.cluster.datastore.entityownership." + + "selectionstrategy.LastCandidateSelectionStrategy,foo"); doReturn(props).when(mockConfig).getProperties(); @@ -114,7 +118,7 @@ public class EntityOwnerSelectionStrategyConfigReaderTest { } @Test(expected = IllegalArgumentException.class) - public void testReadStrategiesInvalidClassType(){ + public void testReadStrategiesInvalidClassType() { Hashtable props = new Hashtable<>(); props.put("entity.type.test", "String,100"); @@ -124,17 +128,18 @@ public class EntityOwnerSelectionStrategyConfigReaderTest { } @Test - public void testReadStrategiesMissingDelay(){ + public void testReadStrategiesMissingDelay() { Hashtable props = new Hashtable<>(); - props.put("entity.type.test", "org.opendaylight.controller.cluster.datastore.entityownership.selectionstrategy.LastCandidateSelectionStrategy,100"); - props.put("entity.type.test1", "org.opendaylight.controller.cluster.datastore.entityownership.selectionstrategy.LastCandidateSelectionStrategy"); + props.put("entity.type.test", "org.opendaylight.controller.cluster.datastore.entityownership." + + "selectionstrategy.LastCandidateSelectionStrategy,100"); + props.put("entity.type.test1", "org.opendaylight.controller.cluster.datastore.entityownership." + + "selectionstrategy.LastCandidateSelectionStrategy"); doReturn(props).when(mockConfig).getProperties(); EntityOwnerSelectionStrategyConfig config = loadStrategyConfig(); - assertEquals(100, config.createStrategy("test", Collections.emptyMap()).getSelectionDelayInMillis()); - assertEquals(0, config.createStrategy("test2", Collections.emptyMap()).getSelectionDelayInMillis()); + assertEquals(100, config.createStrategy("test", Collections.emptyMap()).getSelectionDelayInMillis()); + assertEquals(0, config.createStrategy("test2", Collections.emptyMap()).getSelectionDelayInMillis()); } - -} \ No newline at end of file +}