use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeLeafOnlyUsesAugment 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();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeLeafOnlyUsesAugment in project mdsal by opendaylight.
the class Bug1418AugmentationTest method leafOnlyAugmentationDeletedTest.
@Test
public void leafOnlyAugmentationDeletedTest() {
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(CONFIGURATION, TOP, top());
writeTx.put(CONFIGURATION, TOP_FOO, topLevelList(new TopLevelListKey(TOP_FOO_KEY)));
TreeLeafOnlyUsesAugment leafOnlyUsesAugment = leafOnlyUsesAugment("test leaf");
writeTx.put(CONFIGURATION, SIMPLE_AUGMENT, leafOnlyUsesAugment);
assertCommit(writeTx.commit());
final TestListener<TreeLeafOnlyUsesAugment> listener = createListener(CONFIGURATION, SIMPLE_AUGMENT, added(path(TOP_FOO_KEY, TreeLeafOnlyUsesAugment.class), leafOnlyUsesAugment), deleted(path(TOP_FOO_KEY, TreeLeafOnlyUsesAugment.class), leafOnlyUsesAugment));
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.delete(CONFIGURATION, SIMPLE_AUGMENT);
assertCommit(writeTx.commit());
listener.verify();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeLeafOnlyUsesAugment in project mdsal by opendaylight.
the class Bug1418AugmentationTest method leafOnlyAugmentationUpdatedTest.
@Test
public void leafOnlyAugmentationUpdatedTest() {
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(CONFIGURATION, TOP, top());
writeTx.put(CONFIGURATION, TOP_FOO, topLevelList(new TopLevelListKey(TOP_FOO_KEY)));
TreeLeafOnlyUsesAugment leafOnlyUsesAugmentBefore = leafOnlyUsesAugment("test leaf");
writeTx.put(CONFIGURATION, SIMPLE_AUGMENT, leafOnlyUsesAugmentBefore);
assertCommit(writeTx.commit());
TreeLeafOnlyUsesAugment leafOnlyUsesAugmentAfter = leafOnlyUsesAugment("test leaf changed");
final TestListener<TreeLeafOnlyUsesAugment> listener = createListener(CONFIGURATION, SIMPLE_AUGMENT, added(path(TOP_FOO_KEY, TreeLeafOnlyUsesAugment.class), leafOnlyUsesAugmentBefore), replaced(path(TOP_FOO_KEY, TreeLeafOnlyUsesAugment.class), leafOnlyUsesAugmentBefore, leafOnlyUsesAugmentAfter));
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(CONFIGURATION, SIMPLE_AUGMENT, leafOnlyUsesAugmentAfter);
assertCommit(writeTx.commit());
listener.verify();
}
Aggregations