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 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.mdsal.test.augment.rev140709.TreeComplexUsesAugment 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.mdsal.test.augment.rev140709.TreeComplexUsesAugment in project mdsal by opendaylight.
the class TestCopyBuilders method testBuilderListCopy.
@Test
public void testBuilderListCopy() {
final TreeComplexUsesAugment source = new TreeComplexUsesAugmentBuilder().build();
final ComplexViaUses viaUses = new ComplexViaUsesBuilder().build();
final TreeComplexUsesAugment copied = new TreeComplexUsesAugmentBuilder(viaUses).build();
assertEquals(source, copied);
}
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 Bug1418AugmentationTest method complexAugmentationCreatedTest.
@Test
public void complexAugmentationCreatedTest() {
TreeComplexUsesAugment complexUsesAugment = complexUsesAugment(LIST_VIA_USES_KEY);
final TestListener<TreeComplexUsesAugment> listener = createListener(CONFIGURATION, COMPLEX_AUGMENT, added(path(TOP_FOO_KEY, TreeComplexUsesAugment.class), complexUsesAugment));
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(CONFIGURATION, TOP, top());
writeTx.put(CONFIGURATION, TOP_FOO, topLevelList(new TopLevelListKey(TOP_FOO_KEY)));
writeTx.put(CONFIGURATION, COMPLEX_AUGMENT, complexUsesAugment);
assertCommit(writeTx.commit());
listener.verify();
}
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 Bug1418AugmentationTest method complexAugmentationUpdatedTest.
@Test
public void complexAugmentationUpdatedTest() {
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(CONFIGURATION, TOP, top());
writeTx.put(CONFIGURATION, TOP_FOO, topLevelList(new TopLevelListKey(TOP_FOO_KEY)));
TreeComplexUsesAugment complexUsesAugmentBefore = complexUsesAugment(LIST_VIA_USES_KEY);
writeTx.put(CONFIGURATION, COMPLEX_AUGMENT, complexUsesAugmentBefore);
assertCommit(writeTx.commit());
TreeComplexUsesAugment complexUsesAugmentAfter = complexUsesAugment(LIST_VIA_USES_KEY_MOD);
final TestListener<TreeComplexUsesAugment> listener = createListener(CONFIGURATION, COMPLEX_AUGMENT, added(path(TOP_FOO_KEY, TreeComplexUsesAugment.class), complexUsesAugmentBefore), replaced(path(TOP_FOO_KEY, TreeComplexUsesAugment.class), complexUsesAugmentBefore, complexUsesAugmentAfter));
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(CONFIGURATION, COMPLEX_AUGMENT, complexUsesAugmentAfter);
assertCommit(writeTx.commit());
listener.verify();
}
Aggregations