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%2Fpersisted%2FCommitTransactionPayloadTest.java;h=6b2156ec77030a8ad0ad568b8696c8f397ba9b15;hb=546cd1fd100dbaa36908b22c2f422320dbd8c4b2;hp=0886d94fee0286ab0234cd4269e85794a00e0e8a;hpb=2658d126f67512fcaac684d2ccb7197fe12f61f4;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/persisted/CommitTransactionPayloadTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/persisted/CommitTransactionPayloadTest.java index 0886d94fee..6b2156ec77 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/persisted/CommitTransactionPayloadTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/persisted/CommitTransactionPayloadTest.java @@ -18,6 +18,7 @@ import org.apache.commons.lang3.SerializationUtils; import org.junit.Before; import org.junit.Test; import org.opendaylight.controller.cluster.datastore.AbstractTest; +import org.opendaylight.controller.cluster.datastore.persisted.DataTreeCandidateInputOutput.DataTreeCandidateWithVersion; import org.opendaylight.controller.md.cluster.datastore.model.SchemaContextHelper; import org.opendaylight.controller.md.cluster.datastore.model.TestModel; import org.opendaylight.yangtools.yang.common.QName; @@ -67,9 +68,11 @@ public class CommitTransactionPayloadTest extends AbstractTest { } } - private static void assertCandidateEquals(final DataTreeCandidate expected, final DataTreeCandidate actual) { - assertEquals("root path", expected.getRootPath(), actual.getRootPath()); - assertCandidateNodeEquals(expected.getRootNode(), actual.getRootNode()); + private static void assertCandidateEquals(final DataTreeCandidate expected, + final DataTreeCandidateWithVersion actual) { + final DataTreeCandidate candidate = actual.getCandidate(); + assertEquals("root path", expected.getRootPath(), candidate.getRootPath()); + assertCandidateNodeEquals(expected.getRootNode(), candidate.getRootNode()); } private static void assertCandidateNodeEquals(final DataTreeCandidateNode expected, @@ -98,7 +101,7 @@ public class CommitTransactionPayloadTest extends AbstractTest { public void setUp() { setUpStatic(); final YangInstanceIdentifier writePath = TestModel.TEST_PATH; - final NormalizedNode writeData = ImmutableContainerNodeBuilder.create() + final NormalizedNode writeData = ImmutableContainerNodeBuilder.create() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TestModel.TEST_QNAME)) .withChild(ImmutableNodes.leafNode(TestModel.DESC_QNAME, "foo")).build(); candidate = DataTreeCandidates.fromNormalizedNode(writePath, writeData); @@ -107,7 +110,7 @@ public class CommitTransactionPayloadTest extends AbstractTest { @Test public void testCandidateSerialization() throws IOException { final CommitTransactionPayload payload = CommitTransactionPayload.create(nextTransactionId(), candidate); - assertEquals("payload size", 169, payload.size()); + assertEquals("payload size", 156, payload.size()); } @Test @@ -129,7 +132,7 @@ public class CommitTransactionPayloadTest extends AbstractTest { YangInstanceIdentifier leafSetEntryPath = YangInstanceIdentifier.builder(TestModel.TEST_PATH).node(LEAF_SET) .node(entryPathArg).build(); - NormalizedNode leafSetEntryNode = Builders.leafSetEntryBuilder().withNodeIdentifier(entryPathArg) + NormalizedNode leafSetEntryNode = Builders.leafSetEntryBuilder().withNodeIdentifier(entryPathArg) .withValue("one").build(); candidate = DataTreeCandidates.fromNormalizedNode(leafSetEntryPath, leafSetEntryNode); @@ -145,7 +148,7 @@ public class CommitTransactionPayloadTest extends AbstractTest { LeafSetEntryNode leafSetEntryNode = Builders.leafSetEntryBuilder().withNodeIdentifier(entryPathArg) .withValue("one").build(); - NormalizedNode leafSetNode = Builders.leafSetBuilder().withNodeIdentifier( + NormalizedNode leafSetNode = Builders.leafSetBuilder().withNodeIdentifier( new YangInstanceIdentifier.NodeIdentifier(LEAF_SET)).withChild(leafSetEntryNode).build(); candidate = DataTreeCandidates.fromNormalizedNode(leafSetPath, leafSetNode); @@ -161,7 +164,7 @@ public class CommitTransactionPayloadTest extends AbstractTest { LeafSetEntryNode leafSetEntryNode = Builders.leafSetEntryBuilder().withNodeIdentifier(entryPathArg) .withValue("one").build(); - NormalizedNode leafSetNode = Builders.orderedLeafSetBuilder().withNodeIdentifier( + NormalizedNode leafSetNode = Builders.orderedLeafSetBuilder().withNodeIdentifier( new YangInstanceIdentifier.NodeIdentifier(LEAF_SET)).withChild(leafSetEntryNode).build(); candidate = DataTreeCandidates.fromNormalizedNode(leafSetPath, leafSetNode);