use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListBuilder in project mdsal by opendaylight.
the class RpcDataSerializationTest method testRpcOutputToNormalized.
@Test
public void testRpcOutputToNormalized() {
final GetTopOutput bindingOriginal = new GetTopOutputBuilder().setTopLevelList(ImmutableMap.of(LIST_KEY, new TopLevelListBuilder().withKey(LIST_KEY).build())).build();
final ContainerNode dom = codecContext.toNormalizedNodeRpcData(bindingOriginal);
assertNotNull(dom);
assertEquals(GetTopOutput.QNAME, dom.getIdentifier().getNodeType());
final DataObject bindingDeserialized = codecContext.fromNormalizedNodeRpcData(GET_TOP_OUTPUT, dom);
assertEquals(bindingOriginal, bindingDeserialized);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListBuilder in project mdsal by opendaylight.
the class Bug4494Test method testDelete.
@Test
public void testDelete() throws Exception {
DataBroker dataBroker = getDataBroker();
WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
TopLevelList list = new TopLevelListBuilder().setName("name").build();
TopBuilder builder = new TopBuilder().setTopLevelList(Map.of(list.key(), list));
writeTransaction.put(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(Top.class), builder.build());
assertCommit(writeTransaction.commit());
InstanceIdentifier<TopLevelList> id = InstanceIdentifier.builder(Top.class).child(TopLevelList.class, new TopLevelListKey("name")).build();
ReadWriteTransaction writeTransaction1 = dataBroker.newReadWriteTransaction();
writeTransaction1.delete(LogicalDatastoreType.OPERATIONAL, id);
assertCommit(writeTransaction1.commit());
ReadWriteTransaction writeTransaction2 = dataBroker.newReadWriteTransaction();
writeTransaction2.delete(LogicalDatastoreType.OPERATIONAL, id);
assertCommit(writeTransaction2.commit());
}
Aggregations