use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList in project mdsal by opendaylight.
the class ListInsertionDataChangeListenerTest method replaceTopNodeSubtreeListeners.
@Test
public void replaceTopNodeSubtreeListeners() {
final TopLevelList topBar = topLevelList(TOP_BAR_KEY);
final Top top = top(topBar);
final TopLevelList topFoo = topLevelList(TOP_FOO_KEY);
// Listener for TOP element
final TestListener<Top> topListener = createListener(CONFIGURATION, TOP, added(TOP, top(topLevelList(TOP_FOO_KEY))), replaced(TOP, top(topFoo), top));
// Listener for all list items. This one should see Foo item deleted and Bar item added.
final TestListener<TopLevelList> allListener = createListener(CONFIGURATION, WILDCARDED, added(TOP_FOO, topFoo), added(TOP_BAR, topBar), deleted(TOP_FOO, topFoo));
// Listener for all Foo item. This one should see only Foo item deleted.
final TestListener<TopLevelList> fooListener = createListener(CONFIGURATION, TOP_FOO, added(TOP_FOO, topFoo), deleted(TOP_FOO, topFoo));
// Listener for bar list items.
final TestListener<TopLevelList> barListener = createListener(CONFIGURATION, TOP_BAR, added(TOP_BAR, topBar));
ReadWriteTransaction writeTx = getDataBroker().newReadWriteTransaction();
writeTx.put(CONFIGURATION, TOP, top);
assertCommit(writeTx.commit());
topListener.verify();
allListener.verify();
fooListener.verify();
barListener.verify();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList in project mdsal by opendaylight.
the class ListInsertionDataChangeListenerTest method mergeTopBarNodeSubtreeListeners.
@Test
public void mergeTopBarNodeSubtreeListeners() {
final TopLevelList topBar = topLevelList(TOP_BAR_KEY);
final TopLevelList topFoo = topLevelList(TOP_FOO_KEY);
final TestListener<Top> topListener = createListener(CONFIGURATION, TOP, added(TOP, top(topLevelList(TOP_FOO_KEY))), topSubtreeModified(topFoo, topBar));
final TestListener<TopLevelList> allListener = createListener(CONFIGURATION, WILDCARDED, added(TOP_FOO, topFoo), added(TOP_BAR, topBar));
final TestListener<TopLevelList> fooListener = createListener(CONFIGURATION, TOP_FOO, added(TOP_FOO, topFoo));
final TestListener<TopLevelList> barListener = createListener(CONFIGURATION, TOP_BAR, added(TOP_BAR, topBar));
ReadWriteTransaction writeTx = getDataBroker().newReadWriteTransaction();
writeTx.merge(CONFIGURATION, TOP_BAR, topLevelList(TOP_BAR_KEY));
assertCommit(writeTx.commit());
topListener.verify();
allListener.verify();
fooListener.verify();
barListener.verify();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList in project mdsal by opendaylight.
the class ListInsertionDataChangeListenerTest method putTopBarNodeSubtreeListeners.
@Test
public void putTopBarNodeSubtreeListeners() {
final TopLevelList topBar = topLevelList(TOP_BAR_KEY);
final TopLevelList topFoo = topLevelList(TOP_FOO_KEY);
final TestListener<Top> topListener = createListener(CONFIGURATION, TOP, added(TOP, top(topLevelList(TOP_FOO_KEY))), topSubtreeModified(topFoo, topBar));
final TestListener<TopLevelList> allListener = createListener(CONFIGURATION, WILDCARDED, added(TOP_FOO, topFoo), added(TOP_BAR, topBar));
final TestListener<TopLevelList> fooListener = createListener(CONFIGURATION, TOP_FOO, added(TOP_FOO, topFoo));
final TestListener<TopLevelList> barListener = createListener(CONFIGURATION, TOP_BAR, added(TOP_BAR, topBar));
ReadWriteTransaction writeTx = getDataBroker().newReadWriteTransaction();
writeTx.put(CONFIGURATION, TOP_BAR, topLevelList(TOP_BAR_KEY));
assertCommit(writeTx.commit());
topListener.verify();
allListener.verify();
fooListener.verify();
barListener.verify();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList 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;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList in project mdsal by opendaylight.
the class Bug1333DataChangeListenerTest method deleteAugmentChildListenTopSubtree.
@Test
public void deleteAugmentChildListenTopSubtree() {
Top top = writeTopWithListItem(CONFIGURATION);
TestListener<Top> listener = createListener(CONFIGURATION, TOP_PATH, added(TOP_PATH, top), subtreeModified(TOP_PATH, top, top(topLevelList(TOP_FOO_KEY, complexUsesAugment(USES_TWO_KEY)))));
InstanceIdentifier<ListViaUses> deletePath = path(TOP_FOO_KEY, USES_ONE_KEY);
deleteItem(CONFIGURATION, deletePath);
listener.verify();
}
Aggregations