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 ManagedNewTransactionRunnerImplTest method testCallWithNewTypedWriteOnlyTransactionAndSubmitPutSuccessfully.
@Test
public void testCallWithNewTypedWriteOnlyTransactionAndSubmitPutSuccessfully() throws Exception {
TopLevelList data = newTestDataObject();
managedNewTransactionRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, writeTx -> writeTx.put(TEST_PATH, data)).get();
assertEquals(data, syncRead(LogicalDatastoreType.OPERATIONAL, TEST_PATH));
}
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 ManagedNewTransactionRunnerImplTest method testCallWithNewReadTransactionAndCloseReadSuccessfully.
@Test
public void testCallWithNewReadTransactionAndCloseReadSuccessfully() throws Exception {
TopLevelList data = newTestDataObject();
managedNewTransactionRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> tx.put(TEST_PATH, data)).get();
assertEquals(data, managedNewTransactionRunner.applyWithNewReadOnlyTransactionAndClose(OPERATIONAL, tx -> tx.read(TEST_PATH)).get().get());
}
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 ManagedNewTransactionRunnerImplTest method testCallWithNewTypedReadWriteTransactionAndSubmitPutSuccessfully.
@Test
public void testCallWithNewTypedReadWriteTransactionAndSubmitPutSuccessfully() throws Exception {
TopLevelList data = newTestDataObject();
managedNewTransactionRunner.callWithNewReadWriteTransactionAndSubmit(OPERATIONAL, tx -> tx.put(TEST_PATH, data)).get();
assertEquals(data, syncRead(LogicalDatastoreType.OPERATIONAL, TEST_PATH));
}
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 ManagedNewTransactionRunnerImplTest method testApplyWithNewReadWriteTransactionAndSubmitPutSuccessfully.
@Test
public void testApplyWithNewReadWriteTransactionAndSubmitPutSuccessfully() throws Exception {
TopLevelList data = newTestDataObject();
assertEquals(1, (long) managedNewTransactionRunner.applyWithNewReadWriteTransactionAndSubmit(OPERATIONAL, tx -> {
tx.put(TEST_PATH, data);
return 1;
}).get());
assertEquals(data, syncRead(LogicalDatastoreType.OPERATIONAL, TEST_PATH));
}
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 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