use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.TopBuilder in project controller by opendaylight.
the class WriteTransactionTest method test.
@Test
public void test() throws InterruptedException, ExecutionException {
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.OPERATIONAL, TOP_PATH, new TopBuilder().build());
writeTx.put(LogicalDatastoreType.OPERATIONAL, NODE_PATH, NODE);
writeTx.submit().get();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.TopBuilder in project mdsal by opendaylight.
the class NormalizedNodeSerializeDeserializeTest method leafListFromNormalized.
@Test
public void leafListFromNormalized() {
final ContainerNode topWithLeafList = ImmutableContainerNodeBuilder.create().withNodeIdentifier(new NodeIdentifier(TOP_QNAME)).withChild(ImmutableLeafSetNodeBuilder.create().withNodeIdentifier(new NodeIdentifier(TOP_LEVEL_LEAF_LIST_QNAME)).withChild(ImmutableLeafSetEntryNodeBuilder.create().withNodeIdentifier(new NodeWithValue<>(TOP_LEVEL_LEAF_LIST_QNAME, "foo")).withValue("foo").build()).build()).build();
final Entry<InstanceIdentifier<?>, DataObject> entry = codecContext.fromNormalizedNode(BI_TOP_PATH, topWithLeafList);
final Top top = new TopBuilder().setTopLevelLeafList(Set.of("foo")).build();
assertEquals(top, entry.getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.TopBuilder in project mdsal by opendaylight.
the class NormalizedNodeSerializeDeserializeTest method leafListToNormalized.
@Test
public void leafListToNormalized() {
final Top top = new TopBuilder().setTopLevelLeafList(Set.of("foo")).build();
final Entry<YangInstanceIdentifier, NormalizedNode> entry = codecContext.toNormalizedNode(InstanceIdentifier.create(Top.class), top);
final ContainerNode containerNode = ImmutableContainerNodeBuilder.create().withNodeIdentifier(new NodeIdentifier(TOP_QNAME)).withChild(ImmutableLeafSetNodeBuilder.create().withNodeIdentifier(new NodeIdentifier(TOP_LEVEL_LEAF_LIST_QNAME)).withChild(ImmutableLeafSetEntryNodeBuilder.create().withNodeIdentifier(new NodeWithValue<>(TOP_LEVEL_LEAF_LIST_QNAME, "foo")).withValue("foo").build()).build()).build();
assertEquals(containerNode, entry.getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.TopBuilder in project mdsal by opendaylight.
the class LazyBindingMapTest method prepareTop.
@BeforeClass
public static void prepareTop() {
final Map<TopLevelListKey, TopLevelList> map = new HashMap<>();
for (int i = 0; i < 2 * LazyBindingMap.LAZY_CUTOFF; i++) {
final TopLevelList item = new TopLevelListBuilder().setName(String.valueOf(i)).build();
map.put(item.key(), item);
}
TOP = new TopBuilder().setTopLevelList(map).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.TopBuilder in project mdsal by opendaylight.
the class Bug1125RegressionTest method writeInitialState.
private TreeComplexUsesAugment writeInitialState() {
WriteTransaction initialTx = getDataBroker().newWriteOnlyTransaction();
initialTx.put(LogicalDatastoreType.OPERATIONAL, TOP_PATH, new TopBuilder().build());
TreeComplexUsesAugment fooAugment = new TreeComplexUsesAugmentBuilder().setContainerWithUses(new ContainerWithUsesBuilder().setLeafFromGrouping("foo").build()).build();
initialTx.put(LogicalDatastoreType.OPERATIONAL, path(TOP_FOO_KEY), topLevelList(TOP_FOO_KEY, fooAugment));
assertCommit(initialTx.commit());
return fooAugment;
}
Aggregations