Search in sources :

Example 46 with DefaultDOMRpcResult

use of org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult 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 47 with DefaultDOMRpcResult

use of org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult in project netconf by opendaylight.

the class NetconfDataTreeServiceActorTest method testReplace.

@Test
public void testReplace() {
    doReturn(FluentFutures.immediateFluentFuture(new DefaultDOMRpcResult())).when(netconfService).replace(STORE, PATH, NODE, Optional.empty());
    final NormalizedNodeMessage node = new NormalizedNodeMessage(PATH, NODE);
    actorRef.tell(new ReplaceEditConfigRequest(STORE, node, null), probe.ref());
    verify(netconfService).replace(STORE, PATH, NODE, Optional.empty());
}
Also used : DefaultDOMRpcResult(org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult) NormalizedNodeMessage(org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage) ReplaceEditConfigRequest(org.opendaylight.netconf.topology.singleton.messages.netconf.ReplaceEditConfigRequest) Test(org.junit.Test)

Example 48 with DefaultDOMRpcResult

use of org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult in project netconf by opendaylight.

the class NetconfDataTreeServiceActorTest method testRemove.

@Test
public void testRemove() {
    doReturn(FluentFutures.immediateFluentFuture(new DefaultDOMRpcResult())).when(netconfService).remove(STORE, PATH);
    actorRef.tell(new RemoveEditConfigRequest(STORE, PATH), probe.ref());
    verify(netconfService).remove(STORE, PATH);
}
Also used : DefaultDOMRpcResult(org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult) RemoveEditConfigRequest(org.opendaylight.netconf.topology.singleton.messages.netconf.RemoveEditConfigRequest) Test(org.junit.Test)

Example 49 with DefaultDOMRpcResult

use of org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult in project netconf by opendaylight.

the class NetconfDataTreeServiceActorTest method testCommit.

@Test
public void testCommit() {
    doReturn(FluentFutures.immediateFluentFuture(new DefaultDOMRpcResult())).when(netconfService).commit();
    actorRef.tell(new CommitRequest(), probe.ref());
    verify(netconfService).commit();
    probe.expectMsgClass(InvokeRpcMessageReply.class);
}
Also used : CommitRequest(org.opendaylight.netconf.topology.singleton.messages.netconf.CommitRequest) DefaultDOMRpcResult(org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult) Test(org.junit.Test)

Example 50 with DefaultDOMRpcResult

use of org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult in project netconf by opendaylight.

the class NetconfDataTreeServiceActorTest method testCreate.

@Test
public void testCreate() {
    doReturn(FluentFutures.immediateFluentFuture(new DefaultDOMRpcResult())).when(netconfService).create(STORE, PATH, NODE, Optional.empty());
    final NormalizedNodeMessage node = new NormalizedNodeMessage(PATH, NODE);
    actorRef.tell(new CreateEditConfigRequest(STORE, node, null), probe.ref());
    verify(netconfService).create(STORE, PATH, NODE, Optional.empty());
}
Also used : DefaultDOMRpcResult(org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult) NormalizedNodeMessage(org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage) CreateEditConfigRequest(org.opendaylight.netconf.topology.singleton.messages.netconf.CreateEditConfigRequest) Test(org.junit.Test)

Aggregations

DefaultDOMRpcResult (org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult)72 Test (org.junit.Test)51 QName (org.opendaylight.yangtools.yang.common.QName)27 DOMRpcResult (org.opendaylight.mdsal.dom.api.DOMRpcResult)25 ContainerNode (org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)25 NormalizedNode (org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)16 InstanceIdentifierContext (org.opendaylight.restconf.common.context.InstanceIdentifierContext)15 NetconfRestconfStrategy (org.opendaylight.restconf.nb.rfc8040.rests.transactions.NetconfRestconfStrategy)15 NormalizedNodePayload (org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload)12 Before (org.junit.Before)10 NodeIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier)10 DataSchemaNode (org.opendaylight.yangtools.yang.model.api.DataSchemaNode)10 NetconfBaseOps (org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps)9 MdsalRestconfStrategy (org.opendaylight.restconf.nb.rfc8040.rests.transactions.MdsalRestconfStrategy)9 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)9 AbstractBaseSchemasTest (org.opendaylight.netconf.sal.connect.netconf.AbstractBaseSchemasTest)5 RemoteDeviceId (org.opendaylight.netconf.sal.connect.util.RemoteDeviceId)5 RpcError (org.opendaylight.yangtools.yang.common.RpcError)5 ArrayList (java.util.ArrayList)4 NormalizedNodeMessage (org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage)4