Bump odlparent/yangtools/mdsal
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / src / test / java / org / opendaylight / controller / remote / rpc / RemoteOpsImplementationTest.java
index 47ce52bf9c21625a9100070747b2da19c5ef1d08..679a19c78f04268d47402d25f01e382e001aba35 100644 (file)
@@ -31,9 +31,10 @@ import org.opendaylight.mdsal.dom.api.DOMRpcResult;
 import org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult;
 import org.opendaylight.mdsal.dom.spi.SimpleDOMActionResult;
 import org.opendaylight.yangtools.util.concurrent.FluentFutures;
+import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
 
 /**
  * Unit tests for RemoteRpcImplementation.
@@ -50,13 +51,13 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
         final ContainerNode rpcOutput = makeRPCOutput("bar");
         final DOMRpcResult rpcResult = new DefaultDOMRpcResult(rpcOutput);
 
-        final NormalizedNode<?, ?> invokeRpcInput = makeRPCInput("foo");
+        final NormalizedNode invokeRpcInput = makeRPCInput("foo");
         @SuppressWarnings({"unchecked", "rawtypes"})
-        final ArgumentCaptor<NormalizedNode<?, ?>> inputCaptor =
+        final ArgumentCaptor<NormalizedNode> inputCaptor =
                 ArgumentCaptor.forClass(NormalizedNode.class);
 
         doReturn(FluentFutures.immediateFluentFuture(rpcResult)).when(domRpcService2)
-            .invokeRpc(eq(TEST_RPC_TYPE), inputCaptor.capture());
+            .invokeRpc(eq(TEST_RPC), inputCaptor.capture());
 
         final ListenableFuture<DOMRpcResult> frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput);
         assertTrue(frontEndFuture instanceof RemoteDOMRpcFuture);
@@ -72,7 +73,7 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
     public void testInvokeAction() throws Exception {
         final ContainerNode actionOutput = makeRPCOutput("bar");
         final DOMActionResult actionResult = new SimpleDOMActionResult(actionOutput, Collections.emptyList());
-        final NormalizedNode<?, ?> invokeActionInput = makeRPCInput("foo");
+        final NormalizedNode invokeActionInput = makeRPCInput("foo");
         @SuppressWarnings({"unchecked", "rawtypes"})
         final ArgumentCaptor<ContainerNode> inputCaptor =
                 ArgumentCaptor.forClass(ContainerNode.class);
@@ -95,11 +96,11 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
         final DOMRpcResult rpcResult = new DefaultDOMRpcResult(rpcOutput);
 
         @SuppressWarnings({"unchecked", "rawtypes"})
-        final ArgumentCaptor<NormalizedNode<?, ?>> inputCaptor =
+        final ArgumentCaptor<NormalizedNode> inputCaptor =
                 (ArgumentCaptor) ArgumentCaptor.forClass(NormalizedNode.class);
 
         doReturn(FluentFutures.immediateFluentFuture(rpcResult)).when(domRpcService2)
-            .invokeRpc(eq(TEST_RPC_TYPE), inputCaptor.capture());
+            .invokeRpc(eq(TEST_RPC), inputCaptor.capture());
 
         ListenableFuture<DOMRpcResult> frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, null);
         assertTrue(frontEndFuture instanceof RemoteDOMRpcFuture);
@@ -138,13 +139,13 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
         final ContainerNode rpcOutput = null;
         final DOMRpcResult rpcResult = new DefaultDOMRpcResult(rpcOutput);
 
-        final NormalizedNode<?, ?> invokeRpcInput = makeRPCInput("foo");
+        final NormalizedNode invokeRpcInput = makeRPCInput("foo");
         @SuppressWarnings({"unchecked", "rawtypes"})
-        final ArgumentCaptor<NormalizedNode<?, ?>> inputCaptor =
+        final ArgumentCaptor<NormalizedNode> inputCaptor =
                 (ArgumentCaptor) ArgumentCaptor.forClass(NormalizedNode.class);
 
         doReturn(FluentFutures.immediateFluentFuture(rpcResult)).when(domRpcService2)
-            .invokeRpc(eq(TEST_RPC_TYPE), inputCaptor.capture());
+            .invokeRpc(eq(TEST_RPC), inputCaptor.capture());
 
         final ListenableFuture<DOMRpcResult> frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput);
         assertTrue(frontEndFuture instanceof RemoteDOMRpcFuture);
@@ -159,12 +160,12 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
     @SuppressWarnings({"checkstyle:AvoidHidingCauseException", "checkstyle:IllegalThrows"})
     @Test(expected = DOMRpcException.class)
     public void testInvokeRpcWithRemoteFailedFuture() throws Throwable {
-        final NormalizedNode<?, ?> invokeRpcInput = makeRPCInput("foo");
+        final NormalizedNode invokeRpcInput = makeRPCInput("foo");
         @SuppressWarnings({"unchecked", "rawtypes"})
-        final ArgumentCaptor<NormalizedNode<?, ?>> inputCaptor =
+        final ArgumentCaptor<NormalizedNode> inputCaptor =
                 (ArgumentCaptor) ArgumentCaptor.forClass(NormalizedNode.class);
 
-        when(domRpcService2.invokeRpc(eq(TEST_RPC_TYPE), inputCaptor.capture())).thenReturn(
+        when(domRpcService2.invokeRpc(eq(TEST_RPC), inputCaptor.capture())).thenReturn(
                 FluentFutures.immediateFailedFluentFuture(new RemoteDOMRpcException("Test Exception", null)));
 
         final ListenableFuture<DOMRpcResult> frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput);
@@ -210,7 +211,7 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
     @Ignore
     @Test(expected = RemoteDOMRpcException.class)
     public void testInvokeRpcWithAkkaTimeoutException() throws Exception {
-        final NormalizedNode<?, ?> invokeRpcInput = makeRPCInput("foo");
+        final NormalizedNode invokeRpcInput = makeRPCInput("foo");
         final ListenableFuture<DOMRpcResult> frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput);
         assertTrue(frontEndFuture instanceof RemoteDOMRpcFuture);
 
@@ -224,9 +225,9 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
     @Test(expected = DOMRpcException.class)
     @SuppressWarnings({"checkstyle:AvoidHidingCauseException", "checkstyle:IllegalThrows"})
     public void testInvokeRpcWithLookupException() throws Throwable {
-        final NormalizedNode<?, ?> invokeRpcInput = makeRPCInput("foo");
+        final NormalizedNode invokeRpcInput = makeRPCInput("foo");
 
-        doThrow(new RuntimeException("test")).when(domRpcService2).invokeRpc(any(SchemaPath.class),
+        doThrow(new RuntimeException("test")).when(domRpcService2).invokeRpc(any(QName.class),
             any(NormalizedNode.class));
 
         final ListenableFuture<DOMRpcResult> frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput);
@@ -248,7 +249,7 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
     public void testInvokeActionWithLookupException() throws Throwable {
         final ContainerNode invokeRpcInput = makeRPCInput("foo");
 
-        doThrow(new RuntimeException("test")).when(domActionService2).invokeAction(any(SchemaPath.class),
+        doThrow(new RuntimeException("test")).when(domActionService2).invokeAction(any(Absolute.class),
                 any(DOMDataTreeIdentifier.class), any(ContainerNode.class));
 
         final ListenableFuture<DOMActionResult> frontEndFuture = remoteActionImpl1.invokeAction(TEST_RPC_TYPE,