Package com.chenshuo.muduo.protorpc.sudoku.SudokuProto

Examples of com.chenshuo.muduo.protorpc.sudoku.SudokuProto.SudokuService


    }

    private static void sendAsyncRequest(final RpcChannel channel, RpcClient client) {
        final CountDownLatch latch = new CountDownLatch(1);
        System.err.println("sendRequest " + channel);
        SudokuService remoteService = SudokuProto.SudokuService.newStub(channel);
        SudokuRequest request = SudokuRequest.newBuilder().setCheckerboard("001010").build();
        remoteService.solve(null, request, new RpcCallback<SudokuProto.SudokuResponse>() {
            @Override
            public void run(SudokuResponse parameter) {
                System.out.println(parameter);
                channel.disconnect();
                latch.countDown();
View Full Code Here


    @Test
    public void testClient() throws Exception {
        MockChannel mockChannel = new MockChannel();
        RpcChannel channel = new RpcChannel(mockChannel);
        SudokuService remoteService = SudokuProto.SudokuService.newStub(channel);
        SudokuRequest request = SudokuRequest.newBuilder().setCheckerboard("001010").build();
        remoteService.solve(null, request, new RpcCallback<SudokuProto.SudokuResponse>() {
            @Override
            public void run(SudokuResponse response) {
                // System.out.println(parameter);
                gotResponse = response;
            }
        });
        RpcMessage message = (RpcMessage) mockChannel.message;
        assertEquals(1, message.getId());
        assertEquals(MessageType.REQUEST, message.getType());
        assertEquals(remoteService.getDescriptorForType().getName(), message.getService());
        assertEquals("Solve", message.getMethod());

        SudokuResponse sudokuResponse = SudokuResponse.newBuilder()
                .setSolved(true)
                .setCheckerboard("123456")
View Full Code Here

TOP

Related Classes of com.chenshuo.muduo.protorpc.sudoku.SudokuProto.SudokuService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.