use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top in project mdsal by opendaylight.
the class CachingCodecTest method testDefaultInvocation.
@Test
public void testDefaultInvocation() {
final BindingNormalizedNodeCachingCodec<Top> cachingCodec = createCachingCodec(Top.class, TopLevelList.class);
final Top input = new TopBuilder().build();
assertNull(input.getTopLevelList());
assertEquals(ImmutableMap.of(), input.nonnullTopLevelList());
final NormalizedNode dom = cachingCodec.serialize(input);
final Top output = cachingCodec.deserialize(dom);
assertTrue(input.equals(output));
assertTrue(output.equals(input));
assertNull(output.getTopLevelList());
assertEquals(ImmutableMap.of(), output.nonnullTopLevelList());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top in project mdsal by opendaylight.
the class Bug1333DataChangeListenerTest method writeTopWithListItem.
public Top writeTopWithListItem(final LogicalDatastoreType store) {
ReadWriteTransaction tx = getDataBroker().newReadWriteTransaction();
Top topItem = topWithListItem();
tx.put(store, TOP_PATH, topItem);
assertCommit(tx.commit());
return topItem;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top 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.binding.rev140701.Top 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();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top in project mdsal by opendaylight.
the class Bug1418AugmentationTest method leafOnlyAugmentationCreatedTest.
@Test
public void leafOnlyAugmentationCreatedTest() {
TreeLeafOnlyUsesAugment leafOnlyUsesAugment = leafOnlyUsesAugment("test leaf");
final TestListener<TreeLeafOnlyUsesAugment> listener = createListener(CONFIGURATION, SIMPLE_AUGMENT, added(path(TOP_FOO_KEY, TreeLeafOnlyUsesAugment.class), leafOnlyUsesAugment));
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(CONFIGURATION, TOP, top());
writeTx.put(CONFIGURATION, TOP_FOO, topLevelList(new TopLevelListKey(TOP_FOO_KEY)));
writeTx.put(CONFIGURATION, SIMPLE_AUGMENT, leafOnlyUsesAugment);
assertCommit(writeTx.commit());
listener.verify();
}
Aggregations