Search in sources :

Example 1 with EmptyLeafBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.top.top.level.list.choice.in.list.EmptyLeafBuilder 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)

Aggregations

Test (org.junit.Test)1 EmptyLeaf (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.top.top.level.list.choice.in.list.EmptyLeaf)1 EmptyLeafBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.top.top.level.list.choice.in.list.EmptyLeafBuilder)1 TopLevelList (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList)1 TopLevelListBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListBuilder)1 ChoiceInList (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.top.level.list.ChoiceInList)1 DataObject (org.opendaylight.yangtools.yang.binding.DataObject)1 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)1 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)1 NormalizedNode (org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)1