You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/08/19 22:10:20 UTC

[jira] [Commented] (FLINK-4434) Add a testing RPC service

    [ https://issues.apache.org/jira/browse/FLINK-4434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15428924#comment-15428924 ] 

ASF GitHub Bot commented on FLINK-4434:
---------------------------------------

GitHub user StephanEwen opened a pull request:

    https://github.com/apache/flink/pull/2394

    [FLINK-4434] [rpc] Add a testing RPC service.

    Adds an RPC Service implementation for testing. This RPC service acts as a replacement for the regular RPC service for cases where tests need to return prepared mock gateways instead of proper RPC gateways.
    
    The TestingRpcService can be used for example in the following fashion, using *Mockito* for mocks and verification:
     
    ```java
    TestingRpcService rpc = new TestingRpcService();
    
    ResourceManagerGateway testGateway = mock(ResourceManagerGateway.class);
    rpc.registerGateway("myAddress", testGateway);
     
    MyComponentToTest component = new MyComponentToTest();
    component.triggerSomethingThatCallsTheGateway();
     
    verify(testGateway, timeout(1000)).theTestMethod(any(UUID.class), anyString());
    ```
    
    This also adds a utility to create futures with a predetermined timeout.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/StephanEwen/incubator-flink test_rpc_service

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/2394.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2394
    
----
commit a685ffa00d748de4ab22f91b1dc3b6420f687c24
Author: Stephan Ewen <se...@apache.org>
Date:   2016-08-19T21:29:45Z

    [FLINK-4434] [rpc] Add a testing RPC service.

----


> Add a testing RPC service
> -------------------------
>
>                 Key: FLINK-4434
>                 URL: https://issues.apache.org/jira/browse/FLINK-4434
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Distributed Coordination
>            Reporter: Stephan Ewen
>            Assignee: Stephan Ewen
>             Fix For: 1.2.0
>
>
> I suggest to add a simple testing RPC service that allows to register mock gateways under certain names.
> That way, if a component connects to another component via the RPC service, it will call the mock gateway, rather than the proper proxy gateway that will try to send actor messages.
> Tests on mocks are very easy and powerful with tools like Mockito.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)