use of org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage in project netconf by opendaylight.
the class WriteTransactionActorTestAdapter method testPut.
@Test
public void testPut() {
final NormalizedNodeMessage normalizedNodeMessage = new NormalizedNodeMessage(PATH, NODE);
actorRef.tell(new PutRequest(STORE, normalizedNodeMessage), probe.ref());
verify(mockWriteTx).put(STORE, PATH, NODE);
}
use of org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage in project netconf by opendaylight.
the class ProxyNetconfServiceTest method testGetConfig.
@Test
public void testGetConfig() throws Exception {
ProxyNetconfService netconf = newSuccessfulProxyNetconfService();
final ListenableFuture<Optional<NormalizedNode>> getConfig = netconf.getConfig(PATH);
final GetConfigRequest getRequest = masterActor.expectMsgClass(GetConfigRequest.class);
assertEquals(PATH, getRequest.getPath());
masterActor.reply(new NormalizedNodeMessage(PATH, node));
final Optional<NormalizedNode> result = getConfig.get(5, TimeUnit.SECONDS);
assertTrue(result.isPresent());
assertEquals(node, result.get());
}
use of org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage 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());
}
use of org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage 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());
}
use of org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage in project netconf by opendaylight.
the class NetconfDataTreeServiceActorTest method testGet.
@Test
public void testGet() {
doReturn(immediateFluentFuture(Optional.of(NODE))).when(netconfService).get(PATH);
actorRef.tell(new GetRequest(PATH), probe.ref());
verify(netconfService).get(PATH);
final NormalizedNodeMessage response = probe.expectMsgClass(NormalizedNodeMessage.class);
assertEquals(NODE, response.getNode());
}
Aggregations