From: Robert Varga Date: Wed, 25 Sep 2019 06:16:56 +0000 (+0200) Subject: Switch default stream output to Magnesium X-Git-Tag: release/magnesium~28 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=ae6c61499e2c7c76e0406ce397657cd31ddd4d3f Switch default stream output to Magnesium This flips the switch and uses Magnesium format for all unversioned users. Also updates tests to reflect new expected stream sizes. JIRA: CONTROLLER-1919 Change-Id: I0ed5abe495124b525b7a8c877a3cc7b09f3244ca Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputOutput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputOutput.java index 2a9d1f708f..970b432676 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputOutput.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputOutput.java @@ -50,7 +50,7 @@ public final class NormalizedNodeInputOutput { * @return a new {@link NormalizedNodeDataOutput} instance */ public static NormalizedNodeDataOutput newDataOutput(final @NonNull DataOutput output) { - return new SodiumSR1DataOutput(output); + return new MagnesiumDataOutput(output); } /** diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeStreamReaderWriterTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeStreamReaderWriterTest.java index 951170c7a1..7378a1bb34 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeStreamReaderWriterTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeStreamReaderWriterTest.java @@ -78,7 +78,7 @@ public class NormalizedNodeStreamReaderWriterTest { nnout.writeNormalizedNode(toasterContainer); final byte[] bytes = bos.toByteArray(); - assertEquals(1049619, bytes.length); + assertEquals(1049618, bytes.length); NormalizedNodeDataInput nnin = NormalizedNodeInputOutput.newDataInput(ByteStreams.newDataInput(bytes)); @@ -147,7 +147,7 @@ public class NormalizedNodeStreamReaderWriterTest { writer.writeYangInstanceIdentifier(path); final byte[] bytes = bos.toByteArray(); - assertEquals(826, bytes.length); + assertEquals(825, bytes.length); NormalizedNodeDataInput reader = NormalizedNodeInputOutput.newDataInput(ByteStreams.newDataInput(bytes)); diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/util/TestModel.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/util/TestModel.java index ebef7121c4..8aa2420dfb 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/util/TestModel.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/util/TestModel.java @@ -16,12 +16,12 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import java.io.InputStream; import java.math.BigDecimal; -import java.math.BigInteger; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint64; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; @@ -305,7 +305,7 @@ public final class TestModel { .withChild(ImmutableNodes.leafNode(BOOLEAN_LEAF_QNAME, ENABLED)) .withChild(ImmutableNodes.leafNode(SHORT_LEAF_QNAME, SHORT_ID)) .withChild(ImmutableNodes.leafNode(BYTE_LEAF_QNAME, BYTE_ID)) - .withChild(ImmutableNodes.leafNode(TestModel.BIGINTEGER_LEAF_QNAME, BigInteger.valueOf(100))) + .withChild(ImmutableNodes.leafNode(TestModel.BIGINTEGER_LEAF_QNAME, Uint64.valueOf(100))) .withChild(ImmutableNodes.leafNode(TestModel.BIGDECIMAL_LEAF_QNAME, BigDecimal.valueOf(1.2))) .withChild(ImmutableNodes.leafNode(SOME_REF_QNAME, instanceID)) .withChild(ImmutableNodes.leafNode(MYIDENTITY_QNAME, DESC_QNAME))