X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2FRemoteRpcImplementationTest.java;fp=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2FRemoteRpcImplementationTest.java;h=05ee9f50963b01d8812a305ad8a9eafea8e771d3;hb=9ddc65e1ddae50f691566cd9382707679436c055;hp=8d6e8e598d201fc859e6cf90cdf3d8f272cf603d;hpb=b664876e74191b7ec06650e2a396605025ffb48a;p=controller.git diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementationTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementationTest.java index 8d6e8e598d..05ee9f5096 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementationTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementationTest.java @@ -36,7 +36,7 @@ import org.opendaylight.controller.sal.connector.api.RpcRouter.RouteIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; -/*** +/** * Unit tests for RemoteRpcImplementation. * * @author Thomas Pantelis @@ -57,7 +57,7 @@ public class RemoteRpcImplementationTest extends AbstractRpcTest { /** - * This test method invokes and executes the remote rpc + * This test method invokes and executes the remote rpc. */ @Test public void testInvokeRpc() throws Exception { @@ -88,7 +88,7 @@ public class RemoteRpcImplementationTest extends AbstractRpcTest { } /** - * This test method invokes and executes the remote rpc + * This test method invokes and executes the remote rpc. */ @Test public void testInvokeRpcWithNullInput() throws Exception { @@ -119,7 +119,7 @@ public class RemoteRpcImplementationTest extends AbstractRpcTest { /** - * This test method invokes and executes the remote rpc + * This test method invokes and executes the remote rpc. */ @Test public void testInvokeRpcWithNoOutput() throws Exception { @@ -151,21 +151,18 @@ public class RemoteRpcImplementationTest extends AbstractRpcTest { /** - * This test method invokes and executes the remote rpc + * This test method invokes and executes the remote rpc. */ @Test(expected = DOMRpcException.class) public void testInvokeRpcWithRemoteFailedFuture() throws Exception { - final ContainerNode rpcOutput = null; - final DOMRpcResult rpcResult = new DefaultDOMRpcResult(rpcOutput); - final NormalizedNode invokeRpcInput = makeRPCInput("foo"); @SuppressWarnings({"unchecked", "rawtypes"}) final ArgumentCaptor> inputCaptor = (ArgumentCaptor) ArgumentCaptor.forClass(NormalizedNode.class); when(domRpcService2.invokeRpc(eq(TEST_RPC_TYPE), inputCaptor.capture())).thenReturn( - Futures.immediateFailedCheckedFuture(new DOMRpcException( - "Test Exception") {})); + Futures.immediateFailedCheckedFuture(new RemoteDOMRpcException( + "Test Exception", null))); final CheckedFuture frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput); @@ -182,18 +179,12 @@ public class RemoteRpcImplementationTest extends AbstractRpcTest { /** * This test method invokes and tests exceptions when akka timeout occured - * - * Currently ignored since this test with current config takes around 15 seconds - * to complete. - * + * Currently ignored since this test with current config takes around 15 seconds to complete. */ @Ignore @Test(expected = RemoteDOMRpcException.class) public void testInvokeRpcWithAkkaTimeoutException() throws Exception { final NormalizedNode invokeRpcInput = makeRPCInput("foo"); - @SuppressWarnings({"unchecked", "rawtypes"}) - final ArgumentCaptor> inputCaptor = - (ArgumentCaptor) ArgumentCaptor.forClass(NormalizedNode.class); final CheckedFuture frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput); assertTrue(frontEndFuture instanceof RemoteDOMRpcFuture); @@ -212,9 +203,6 @@ public class RemoteRpcImplementationTest extends AbstractRpcTest { @Test(expected = DOMRpcException.class) public void testInvokeRpcWithLookupException() throws Exception { final NormalizedNode invokeRpcInput = makeRPCInput("foo"); - @SuppressWarnings({"unchecked", "rawtypes"}) - final ArgumentCaptor> inputCaptor = - (ArgumentCaptor) ArgumentCaptor.forClass(NormalizedNode.class); final CheckedFuture frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput); assertTrue(frontEndFuture instanceof RemoteDOMRpcFuture); @@ -227,18 +215,14 @@ public class RemoteRpcImplementationTest extends AbstractRpcTest { } /** - * This test method invokes and executes the remote rpc + * This test method invokes and executes the remote rpc. */ @Test(expected = DOMRpcImplementationNotAvailableException.class) public void testInvokeRpcWithLoopException() throws Exception { final NormalizedNode invokeRpcInput = RemoteRpcInput.from(makeRPCInput("foo")); - final CheckedFuture frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput); + final CheckedFuture frontEndFuture = + remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput); frontEndFuture.checkedGet(5, TimeUnit.SECONDS); } - - - private RemoteRpcProviderConfig getConfig() { - return new RemoteRpcProviderConfig.Builder("unit-test").build(); - } }