Search in sources :

Example 1 with GetTopOutputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.GetTopOutputBuilder in project netconf by opendaylight.

the class MountPointEndToEndTest method testDOMRpcService.

private void testDOMRpcService(final DOMRpcService domRpcService) throws InterruptedException, ExecutionException, TimeoutException {
    testPutTopRpc(domRpcService, new DefaultDOMRpcResult((NormalizedNode) null));
    testPutTopRpc(domRpcService, null);
    testPutTopRpc(domRpcService, new DefaultDOMRpcResult(ImmutableList.of(RpcResultBuilder.newError(ErrorType.APPLICATION, "tag1", "error1"), RpcResultBuilder.newError(ErrorType.APPLICATION, "tag2", "error2"))));
    testGetTopRpc(domRpcService, new DefaultDOMRpcResult(bindingToNormalized.toNormalizedNodeRpcData(new GetTopOutputBuilder().setTopLevelList(oneTopLevelList()).build())));
    testFailedRpc(domRpcService, getTopRpcSchemaPath, getTopInput);
}
Also used : DefaultDOMRpcResult(org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult) GetTopOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.GetTopOutputBuilder) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)

Example 2 with GetTopOutputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.GetTopOutputBuilder 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);
}
Also used : TopLevelListBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListBuilder) DataObject(org.opendaylight.yangtools.yang.binding.DataObject) GetTopOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.GetTopOutputBuilder) ContainerNode(org.opendaylight.yangtools.yang.data.api.schema.ContainerNode) GetTopOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.GetTopOutput) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DefaultDOMRpcResult (org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult)1 GetTopOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.GetTopOutputBuilder)1 GetTopOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.GetTopOutput)1 GetTopOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.GetTopOutputBuilder)1 TopLevelListBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListBuilder)1 DataObject (org.opendaylight.yangtools.yang.binding.DataObject)1 ContainerNode (org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)1 NormalizedNode (org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)1