use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeComplexUsesAugmentBuilder in project controller by opendaylight.
the class AbstractDataBrokerTestTest method writeInitialState.
// copy/pasted from Bug1125RegressionTest.writeInitialState()
private void writeInitialState() throws TransactionCommitFailedException {
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.submit().checkedGet();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeComplexUsesAugmentBuilder in project controller by opendaylight.
the class WildcardedDataChangeListenerTest method testWriteByReplace.
@Test
public void testWriteByReplace() throws InterruptedException, TimeoutException, ExecutionException {
DataBroker dataBroker = testContext.getDataBroker();
final SettableFuture<AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject>> eventFuture = SettableFuture.create();
dataBroker.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL, DEEP_WILDCARDED_PATH, dataChangeEvent -> eventFuture.set(dataChangeEvent), DataChangeScope.SUBTREE);
final WriteTransaction cwuTx = dataBroker.newWriteOnlyTransaction();
cwuTx.put(LogicalDatastoreType.OPERATIONAL, NODE_0_CWU_PATH, CWU, true);
cwuTx.submit().get(5, TimeUnit.SECONDS);
assertFalse(eventFuture.isDone());
final WriteTransaction lvuTx = dataBroker.newWriteOnlyTransaction();
TreeComplexUsesAugment tcua = new TreeComplexUsesAugmentBuilder().setListViaUses(Collections.singletonList(LVU)).build();
lvuTx.put(LogicalDatastoreType.OPERATIONAL, NODE_0_TCU_PATH, tcua, true);
lvuTx.put(LogicalDatastoreType.OPERATIONAL, NODE_1_LVU_PATH, LVU, true);
lvuTx.submit().get(5, TimeUnit.SECONDS);
validateEvent(eventFuture.get(1000, TimeUnit.MILLISECONDS));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeComplexUsesAugmentBuilder 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());
}
Aggregations