use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListKey in project controller by opendaylight.
the class Bug1418AugmentationTest method complexAugmentationUpdatedTest.
@Test
public void complexAugmentationUpdatedTest() {
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, TOP, top());
writeTx.put(LogicalDatastoreType.CONFIGURATION, TOP_FOO, topLevelList(new TopLevelListKey(TOP_FOO_KEY)));
writeTx.put(LogicalDatastoreType.CONFIGURATION, COMPLEX_AUGMENT, complexUsesAugment(LIST_VIA_USES_KEY));
assertCommit(writeTx.submit());
final TestListener listener = createListener(LogicalDatastoreType.CONFIGURATION, COMPLEX_AUGMENT, AsyncDataBroker.DataChangeScope.SUBTREE);
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, COMPLEX_AUGMENT, complexUsesAugment(LIST_VIA_USES_KEY_MOD));
assertCommit(writeTx.submit());
AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> event = listener.event();
assertContains(event.getUpdatedData(), COMPLEX_AUGMENT);
assertContains(event.getCreatedData(), COMPLEX_AUGMENT.child(ListViaUses.class, LIST_VIA_USES_KEY_MOD));
assertContains(event.getRemovedPaths(), COMPLEX_AUGMENT.child(ListViaUses.class, LIST_VIA_USES_KEY));
assertContains(event.getOriginalData(), COMPLEX_AUGMENT);
assertContains(event.getOriginalData(), COMPLEX_AUGMENT.child(ListViaUses.class, LIST_VIA_USES_KEY));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListKey in project controller by opendaylight.
the class Bug1418AugmentationTest method leafOnlyAugmentationCreatedTest.
@Test
public void leafOnlyAugmentationCreatedTest() {
final TestListener listener = createListener(LogicalDatastoreType.CONFIGURATION, SIMPLE_AUGMENT, AsyncDataBroker.DataChangeScope.SUBTREE, false);
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, TOP, top());
writeTx.put(LogicalDatastoreType.CONFIGURATION, TOP_FOO, topLevelList(new TopLevelListKey(TOP_FOO_KEY)));
writeTx.put(LogicalDatastoreType.CONFIGURATION, SIMPLE_AUGMENT, leafOnlyUsesAugment("test leaf"));
assertCommit(writeTx.submit());
AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> event = listener.event();
assertContains(event.getCreatedData(), SIMPLE_AUGMENT);
assertEmpty(event.getUpdatedData());
assertEmpty(event.getOriginalData());
assertEmpty(event.getRemovedPaths());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListKey in project controller by opendaylight.
the class ForwardedNotificationAdapterTest method createTestData.
private TwoLevelListChanged createTestData() {
final TwoLevelListChangedBuilder tb = new TwoLevelListChangedBuilder();
tb.setTopLevelList(ImmutableList.of(new TopLevelListBuilder().setKey(new TopLevelListKey("test")).build()));
return tb.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListKey in project mdsal by opendaylight.
the class CachingCodecTest method createList.
private static Map<TopLevelListKey, TopLevelList> createList(final int num) {
final ImmutableMap.Builder<TopLevelListKey, TopLevelList> builder = ImmutableMap.builder();
for (int i = 0; i < num; i++) {
final TopLevelListKey key = new TopLevelListKey("test-" + i);
builder.put(key, new TopLevelListBuilder().withKey(key).build());
}
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListKey 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();
}
Aggregations