New test utility AssertDataObjects
[mdsal.git] / binding / mdsal-binding-test-utils / src / test / java / org / opendaylight / mdsal / binding / testutils / ExampleYangObjects.java
1 /*
2  * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.binding.testutils;
9
10 import java.util.AbstractMap;
11 import java.util.AbstractMap.SimpleImmutableEntry;
12 import org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugmentBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.complex.from.grouping.ContainerWithUsesBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.TopBuilder;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList;
19 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
20
21 public class ExampleYangObjects {
22
23     public static AbstractMap.SimpleImmutableEntry<InstanceIdentifier<Top>, Top> topEmpty() {
24         return new SimpleImmutableEntry<>(InstanceIdentifier.create(Top.class), new TopBuilder().build());
25     }
26
27     public static AbstractMap.SimpleImmutableEntry<InstanceIdentifier<TopLevelList>, TopLevelList> topLevelList() {
28         TreeComplexUsesAugment fooAugment = new TreeComplexUsesAugmentBuilder()
29                 .setContainerWithUses(new ContainerWithUsesBuilder().setLeafFromGrouping("foo").build()).build();
30         return new SimpleImmutableEntry<>(
31                 ListsBindingUtils.path(ListsBindingUtils.TOP_FOO_KEY),
32                     ListsBindingUtils.topLevelList(ListsBindingUtils.TOP_FOO_KEY, fooAugment));
33     }
34 }