X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FDatastoreContextIntrospectorTest.java;h=b470018c5f4a224a02203468acfe840584764ce8;hb=5464f50be733df1bbbe31cf05665d542d3b7c5e7;hp=ea7afbf414b8b46b9044664acbc0761444c2e659;hpb=dea3effede98cfb561c44d66b24c2d71a44b10a3;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java index ea7afbf414..b470018c5f 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java @@ -14,6 +14,7 @@ import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEF import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD_PERCENTAGE; import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT; import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_SHARD_TX_COMMIT_TIMEOUT_IN_SECONDS; + import java.util.Dictionary; import java.util.Hashtable; import org.junit.Test; @@ -29,8 +30,8 @@ public class DatastoreContextIntrospectorTest { @Test public void testUpdate() { - DatastoreContext context = DatastoreContext.newBuilder(). - logicalStoreType(LogicalDatastoreType.OPERATIONAL).build(); + DatastoreContext context = DatastoreContext.newBuilder() + .logicalStoreType(LogicalDatastoreType.OPERATIONAL).build(); DatastoreContextIntrospector introspector = new DatastoreContextIntrospector(context ); Dictionary properties = new Hashtable<>(); @@ -119,8 +120,8 @@ public class DatastoreContextIntrospectorTest { @Test public void testUpdateWithInvalidValues() { - DatastoreContext context = DatastoreContext.newBuilder(). - logicalStoreType(LogicalDatastoreType.OPERATIONAL).build(); + DatastoreContext context = DatastoreContext.newBuilder() + .logicalStoreType(LogicalDatastoreType.OPERATIONAL).build(); DatastoreContextIntrospector introspector = new DatastoreContextIntrospector(context ); Dictionary properties = new Hashtable<>(); @@ -145,7 +146,8 @@ public class DatastoreContextIntrospectorTest { assertEquals(DEFAULT_SHARD_TX_COMMIT_TIMEOUT_IN_SECONDS, context.getShardTransactionCommitTimeoutInSeconds()); assertEquals(212, context.getShardRaftConfig().getSnapshotBatchCount()); assertEquals(DEFAULT_OPERATION_TIMEOUT_IN_MS, context.getOperationTimeoutInMillis()); - assertEquals(DEFAULT_HEARTBEAT_INTERVAL_IN_MILLIS, context.getShardRaftConfig().getHeartBeatInterval().length()); + assertEquals(DEFAULT_HEARTBEAT_INTERVAL_IN_MILLIS, + context.getShardRaftConfig().getHeartBeatInterval().length()); assertEquals(567, context.getShardTransactionCommitQueueCapacity()); assertEquals(DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD_PERCENTAGE, context.getShardRaftConfig().getSnapshotDataThresholdPercentage()); @@ -168,8 +170,8 @@ public class DatastoreContextIntrospectorTest { properties.put("persistent", "false"); // global setting properties.put("operational.Persistent", "true"); // operational override - DatastoreContext operContext = DatastoreContext.newBuilder(). - logicalStoreType(LogicalDatastoreType.OPERATIONAL).build(); + DatastoreContext operContext = DatastoreContext.newBuilder() + .logicalStoreType(LogicalDatastoreType.OPERATIONAL).build(); DatastoreContextIntrospector operIntrospector = new DatastoreContextIntrospector(operContext); boolean updated = operIntrospector.update(properties); assertEquals("updated", true, updated); @@ -199,8 +201,8 @@ public class DatastoreContextIntrospectorTest { properties.put("config.shard-transaction-idle-timeout-in-minutes", "44"); // config override properties.put("topology.shard-transaction-idle-timeout-in-minutes", "55"); // global shard override - DatastoreContext operContext = DatastoreContext.newBuilder(). - logicalStoreType(LogicalDatastoreType.OPERATIONAL).build(); + DatastoreContext operContext = DatastoreContext.newBuilder() + .logicalStoreType(LogicalDatastoreType.OPERATIONAL).build(); DatastoreContextIntrospector operIntrospector = new DatastoreContextIntrospector(operContext); DatastoreContext shardContext = operIntrospector.newContextFactory().getShardDatastoreContext("topology"); @@ -213,8 +215,8 @@ public class DatastoreContextIntrospectorTest { shardContext = operIntrospector.newContextFactory().getShardDatastoreContext("topology"); assertEquals(55, shardContext.getShardTransactionIdleTimeout().toMinutes()); - DatastoreContext configContext = DatastoreContext.newBuilder(). - logicalStoreType(LogicalDatastoreType.CONFIGURATION).build(); + DatastoreContext configContext = DatastoreContext.newBuilder() + .logicalStoreType(LogicalDatastoreType.CONFIGURATION).build(); DatastoreContextIntrospector configIntrospector = new DatastoreContextIntrospector(configContext); configIntrospector.update(properties); configContext = configIntrospector.getContext(); @@ -223,8 +225,10 @@ public class DatastoreContextIntrospectorTest { shardContext = configIntrospector.newContextFactory().getShardDatastoreContext("topology"); assertEquals(55, shardContext.getShardTransactionIdleTimeout().toMinutes()); - properties.put("operational.topology.shard-transaction-idle-timeout-in-minutes", "66"); // operational shard override - properties.put("config.topology.shard-transaction-idle-timeout-in-minutes", "77"); // config shard override + // operational shard override + properties.put("operational.topology.shard-transaction-idle-timeout-in-minutes", "66"); + // config shard override + properties.put("config.topology.shard-transaction-idle-timeout-in-minutes", "77"); operIntrospector.update(properties); shardContext = operIntrospector.newContextFactory().getShardDatastoreContext("topology");