Search in sources :

Example 1 with TreeLeafOnlyUsesAugment

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();
}
Also used : WriteTransaction(org.opendaylight.mdsal.binding.api.WriteTransaction) TreeLeafOnlyUsesAugment(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeLeafOnlyUsesAugment) TopLevelListKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListKey) AbstractDataTreeChangeListenerTest(org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataTreeChangeListenerTest) Test(org.junit.Test)

Example 2 with TreeLeafOnlyUsesAugment

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();
}
Also used : WriteTransaction(org.opendaylight.mdsal.binding.api.WriteTransaction) TreeLeafOnlyUsesAugment(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeLeafOnlyUsesAugment) TopLevelListKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListKey) AbstractDataTreeChangeListenerTest(org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataTreeChangeListenerTest) Test(org.junit.Test)

Example 3 with TreeLeafOnlyUsesAugment

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();
}
Also used : WriteTransaction(org.opendaylight.mdsal.binding.api.WriteTransaction) TreeLeafOnlyUsesAugment(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeLeafOnlyUsesAugment) TopLevelListKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListKey) AbstractDataTreeChangeListenerTest(org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataTreeChangeListenerTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 WriteTransaction (org.opendaylight.mdsal.binding.api.WriteTransaction)3 AbstractDataTreeChangeListenerTest (org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataTreeChangeListenerTest)3 TreeLeafOnlyUsesAugment (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeLeafOnlyUsesAugment)3 TopLevelListKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListKey)3