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%2FDatastoreContextIntrospectorTest.java;h=14866d447a785cef63bf7f97c6195db59a5bea86;hb=refs%2Fchanges%2F33%2F78433%2F4;hp=2eb078f7900fe40f266d57e43979747da2ec1491;hpb=995da01ef2d635230c37afc7cf4fdd724bf68856;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 2eb078f790..14866d447a 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 @@ -8,6 +8,8 @@ package org.opendaylight.controller.cluster.datastore; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_HEARTBEAT_INTERVAL_IN_MILLIS; @@ -26,10 +28,10 @@ import java.util.Map; import org.junit.Test; import org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy; import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext; +import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections; import org.opendaylight.mdsal.dom.api.DOMSchemaService; import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStoreConfigProperties; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.distributed.datastore.provider.rev140612.DataStorePropertiesContainer; -import org.opendaylight.yangtools.yang.binding.util.BindingReflections; import org.opendaylight.yangtools.yang.model.api.SchemaContext; /** @@ -67,7 +69,7 @@ public class DatastoreContextIntrospectorTest { DatastoreContext context = introspector.getContext(); assertEquals(1000, context.getShardBatchedModificationCount()); - assertEquals(false, context.isTransactionDebugContextEnabled()); + assertFalse(context.isTransactionDebugContextEnabled()); } @Test @@ -94,9 +96,10 @@ public class DatastoreContextIntrospectorTest { properties.put(" max shard data change listener queue size", "2222"); properties.put("mAx-shaRd-data-STORE-executor-quEUe-size", "3333"); properties.put("persistent", "false"); + properties.put("initial-payload-serialized-buffer-capacity", "600"); boolean updated = introspector.update(properties); - assertEquals("updated", true, updated); + assertTrue("updated", updated); DatastoreContext context = introspector.getContext(); assertEquals(31, context.getShardTransactionIdleTimeout().toMinutes()); @@ -117,7 +120,8 @@ public class DatastoreContextIntrospectorTest { assertEquals(1111, context.getDataStoreProperties().getMaxDataChangeExecutorQueueSize()); assertEquals(2222, context.getDataStoreProperties().getMaxDataChangeListenerQueueSize()); assertEquals(3333, context.getDataStoreProperties().getMaxDataStoreExecutorQueueSize()); - assertEquals(false, context.isPersistent()); + assertEquals(600, context.getInitialPayloadSerializedBufferCapacity()); + assertFalse(context.isPersistent()); properties.put("shard-transaction-idle-timeout-in-minutes", "32"); properties.put("operation-timeout-in-seconds", "27"); @@ -128,7 +132,7 @@ public class DatastoreContextIntrospectorTest { properties.put("persistent", "true"); updated = introspector.update(properties); - assertEquals("updated", true, updated); + assertTrue("updated", updated); context = introspector.getContext(); assertEquals(32, context.getShardTransactionIdleTimeout().toMinutes()); @@ -148,13 +152,13 @@ public class DatastoreContextIntrospectorTest { assertEquals(1111, context.getDataStoreProperties().getMaxDataChangeExecutorQueueSize()); assertEquals(2222, context.getDataStoreProperties().getMaxDataChangeListenerQueueSize()); assertEquals(4444, context.getDataStoreProperties().getMaxDataStoreExecutorQueueSize()); - assertEquals(true, context.isPersistent()); + assertTrue(context.isPersistent()); updated = introspector.update(null); - assertEquals("updated", false, updated); + assertFalse("updated", updated); updated = introspector.update(new Hashtable<>()); - assertEquals("updated", false, updated); + assertFalse("updated", updated); } @@ -176,7 +180,7 @@ public class DatastoreContextIntrospectorTest { properties.put("unknownProperty", "1"); // bad - invalid property name final boolean updated = introspector.update(properties); - assertEquals("updated", true, updated); + assertTrue("updated", updated); DatastoreContext context = introspector.getContext(); assertEquals(DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT, context.getShardTransactionIdleTimeout()); @@ -210,20 +214,20 @@ public class DatastoreContextIntrospectorTest { final DatastoreContextIntrospector operIntrospector = INTROSPECTOR_FACTORY.newInstance(OPERATIONAL); boolean updated = operIntrospector.update(properties); - assertEquals("updated", true, updated); + assertTrue("updated", updated); DatastoreContext operContext = operIntrospector.getContext(); assertEquals(33, operContext.getShardTransactionIdleTimeout().toMinutes()); - assertEquals(true, operContext.isPersistent()); + assertTrue(operContext.isPersistent()); assertEquals(333, operContext.getDataStoreProperties().getMaxDataChangeExecutorPoolSize()); final DatastoreContextIntrospector configIntrospector = INTROSPECTOR_FACTORY.newInstance(CONFIGURATION); updated = configIntrospector.update(properties); - assertEquals("updated", true, updated); + assertTrue("updated", updated); DatastoreContext configContext = configIntrospector.getContext(); assertEquals(44, configContext.getShardTransactionIdleTimeout().toMinutes()); - assertEquals(false, configContext.isPersistent()); + assertFalse(configContext.isPersistent()); assertEquals(444, configContext.getDataStoreProperties().getMaxDataChangeExecutorPoolSize()); }