Search in sources :

Example 1 with NormalizedNodeMessage

use of org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage in project netconf by opendaylight.

the class WriteTransactionActorTestAdapter method testMerge.

@Test
public void testMerge() {
    final NormalizedNodeMessage normalizedNodeMessage = new NormalizedNodeMessage(PATH, NODE);
    actorRef.tell(new MergeRequest(STORE, normalizedNodeMessage), probe.ref());
    verify(mockWriteTx).merge(STORE, PATH, NODE);
}
Also used : NormalizedNodeMessage(org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage) MergeRequest(org.opendaylight.netconf.topology.singleton.messages.transactions.MergeRequest) Test(org.junit.Test)

Example 2 with NormalizedNodeMessage

use of org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage in project netconf by opendaylight.

the class ProxyNetconfServiceTest method testGet.

@Test
public void testGet() throws Exception {
    ProxyNetconfService netconf = newSuccessfulProxyNetconfService();
    final ListenableFuture<Optional<NormalizedNode>> get = netconf.get(PATH);
    final GetRequest getRequest = masterActor.expectMsgClass(GetRequest.class);
    assertEquals(PATH, getRequest.getPath());
    masterActor.reply(new NormalizedNodeMessage(PATH, node));
    final Optional<NormalizedNode> result = get.get(5, TimeUnit.SECONDS);
    assertTrue(result.isPresent());
    assertEquals(node, result.get());
}
Also used : NormalizedNodeMessage(org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage) Optional(java.util.Optional) GetRequest(org.opendaylight.netconf.topology.singleton.messages.netconf.GetRequest) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode) Test(org.junit.Test)

Example 3 with NormalizedNodeMessage

use of org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage in project netconf by opendaylight.

the class NetconfDataTreeServiceActorTest method testGetConfig.

@Test
public void testGetConfig() {
    doReturn(immediateFluentFuture(Optional.of(NODE))).when(netconfService).getConfig(PATH);
    actorRef.tell(new GetConfigRequest(PATH), probe.ref());
    verify(netconfService).getConfig(PATH);
    final NormalizedNodeMessage response = probe.expectMsgClass(NormalizedNodeMessage.class);
    assertEquals(NODE, response.getNode());
}
Also used : NormalizedNodeMessage(org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage) GetConfigRequest(org.opendaylight.netconf.topology.singleton.messages.netconf.GetConfigRequest) Test(org.junit.Test)

Example 4 with NormalizedNodeMessage

use of org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage in project netconf by opendaylight.

the class NetconfDataTreeServiceActorTest method testMerge.

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

Example 5 with NormalizedNodeMessage

use of org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage in project netconf by opendaylight.

the class ReadTransactionActorTestAdapter method testRead.

@Test
public void testRead() {
    doReturn(immediateFluentFuture(Optional.of(NODE))).when(mockReadTx).read(STORE, PATH);
    actorRef.tell(new ReadRequest(STORE, PATH), probe.ref());
    verify(mockReadTx).read(STORE, PATH);
    final NormalizedNodeMessage response = probe.expectMsgClass(NormalizedNodeMessage.class);
    assertEquals(NODE, response.getNode());
}
Also used : NormalizedNodeMessage(org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage) ReadRequest(org.opendaylight.netconf.topology.singleton.messages.transactions.ReadRequest) Test(org.junit.Test)

Aggregations

NormalizedNodeMessage (org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage)20 Test (org.junit.Test)12 Optional (java.util.Optional)5 DefaultDOMRpcResult (org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult)4 MergeRequest (org.opendaylight.netconf.topology.singleton.messages.transactions.MergeRequest)3 PutRequest (org.opendaylight.netconf.topology.singleton.messages.transactions.PutRequest)3 ReadRequest (org.opendaylight.netconf.topology.singleton.messages.transactions.ReadRequest)3 NormalizedNode (org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)3 CreateEditConfigRequest (org.opendaylight.netconf.topology.singleton.messages.netconf.CreateEditConfigRequest)2 GetConfigRequest (org.opendaylight.netconf.topology.singleton.messages.netconf.GetConfigRequest)2 GetRequest (org.opendaylight.netconf.topology.singleton.messages.netconf.GetRequest)2 MergeEditConfigRequest (org.opendaylight.netconf.topology.singleton.messages.netconf.MergeEditConfigRequest)2 ReplaceEditConfigRequest (org.opendaylight.netconf.topology.singleton.messages.netconf.ReplaceEditConfigRequest)2 Success (akka.actor.Status.Success)1 Collection (java.util.Collection)1 ReadFailedException (org.opendaylight.mdsal.common.api.ReadFailedException)1 DOMRpcResult (org.opendaylight.mdsal.dom.api.DOMRpcResult)1 ClusteringRpcException (org.opendaylight.netconf.topology.singleton.impl.utils.ClusteringRpcException)1 SchemaPathMessage (org.opendaylight.netconf.topology.singleton.messages.SchemaPathMessage)1 InvokeRpcMessage (org.opendaylight.netconf.topology.singleton.messages.rpc.InvokeRpcMessage)1