use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment in project mdsal by opendaylight.
the class AbstractDataBrokerTestTest method writeInitialState.
// copy/pasted from Bug1125RegressionTest.writeInitialState()
private void writeInitialState() throws InterruptedException, ExecutionException {
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));
initialTx.commit().get();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment in project controller by opendaylight.
the class WriteParentListenAugmentTest method writeNodeListenAugment.
@Test
public void writeNodeListenAugment() throws Exception {
final SettableFuture<AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject>> event = SettableFuture.create();
DataBroker dataBroker = testContext.getDataBroker();
ListenerRegistration<org.opendaylight.controller.md.sal.binding.api.DataChangeListener> dclRegistration = dataBroker.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL, AUGMENT_WILDCARDED_PATH, change -> event.set(change), DataChangeScope.SUBTREE);
final WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
TopLevelList tll = new TopLevelListBuilder().setKey(TLL_KEY).addAugmentation(TreeComplexUsesAugment.class, treeComplexUsesAugment("one")).build();
transaction.put(LogicalDatastoreType.OPERATIONAL, TLL_INSTANCE_ID_BA, tll, true);
transaction.submit().get(5, TimeUnit.SECONDS);
AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> receivedEvent = event.get(1000, TimeUnit.MILLISECONDS);
assertTrue(receivedEvent.getCreatedData().containsKey(AUGMENT_TLL_PATH));
dclRegistration.close();
final WriteTransaction transaction2 = dataBroker.newWriteOnlyTransaction();
transaction2.put(LogicalDatastoreType.OPERATIONAL, AUGMENT_TLL_PATH, treeComplexUsesAugment("two"));
transaction2.submit().get(5, TimeUnit.SECONDS);
TreeComplexUsesAugment readedAug = dataBroker.newReadOnlyTransaction().read(LogicalDatastoreType.OPERATIONAL, AUGMENT_TLL_PATH).get(5, TimeUnit.SECONDS).get();
assertEquals("two", readedAug.getContainerWithUses().getLeafFromGrouping());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment in project controller by opendaylight.
the class Bug1125RegressionTest method writeInitialState.
private void 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.submit());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment in project controller by opendaylight.
the class ListsBindingUtils method topLevelList.
public static TopLevelList topLevelList(final TopLevelListKey key, final TreeComplexUsesAugment augment) {
TopLevelListBuilder builder = new TopLevelListBuilder().setKey(key);
builder.addAugmentation(TreeComplexUsesAugment.class, augment);
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment 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