use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.top.top.level.list.choice.in.list.EmptyLeaf in project mdsal by opendaylight.
the class EmptyLeafTest method testCaseWithEmptyLeafType.
@Test
public void testCaseWithEmptyLeafType() {
final TopLevelList withEmptyCase = new TopLevelListBuilder().withKey(TOP_FOO_KEY).setChoiceInList(new EmptyLeafBuilder().setEmptyType(Empty.value()).build()).build();
final Entry<YangInstanceIdentifier, NormalizedNode> dom = codecContext.toNormalizedNode(BA_TOP_LEVEL_LIST, withEmptyCase);
final Entry<InstanceIdentifier<?>, DataObject> readed = codecContext.fromNormalizedNode(dom.getKey(), dom.getValue());
final ChoiceInList list = ((TopLevelList) readed.getValue()).getChoiceInList();
assertTrue(list instanceof EmptyLeaf);
assertNotNull(((EmptyLeaf) list).getEmptyType());
}
Also used :
TopLevelListBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListBuilder)
EmptyLeaf(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.top.top.level.list.choice.in.list.EmptyLeaf)
DataObject(org.opendaylight.yangtools.yang.binding.DataObject)
TopLevelList(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList)
InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier)
YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)
ChoiceInList(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.top.level.list.ChoiceInList)
EmptyLeafBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.top.top.level.list.choice.in.list.EmptyLeafBuilder)
NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)
YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)
Test(org.junit.Test)