Correct Frontend{Client,History}Metadata deserialization
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / persisted / CommitTransactionPayloadTest.java
index 0886d94fee0286ab0234cd4269e85794a00e0e8a..6b2156ec77030a8ad0ad568b8696c8f397ba9b15 100644 (file)
@@ -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);