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;
}
}
- 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,
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);
@Test
public void testCandidateSerialization() throws IOException {
final CommitTransactionPayload payload = CommitTransactionPayload.create(nextTransactionId(), candidate);
- assertEquals("payload size", 181, payload.size());
+ assertEquals("payload size", 156, payload.size());
}
@Test
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);
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);
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);