@Test(expected = org.apache.hbase.thirdparty.com.google.protobuf.ServiceException.class
  /* Thrown when we call stub.error */)
  public void testProtoBufRpc() throws Exception {
    RpcClient rpcClient = RpcClientFactory.createClient(conf, HConstants.CLUSTER_ID_DEFAULT);
    try {
      BlockingInterface stub = newBlockingStub(rpcClient, this.isa);
      // Test ping method
      TestProtos.EmptyRequestProto emptyRequest = TestProtos.EmptyRequestProto.newBuilder().build();
      stub.ping(null, emptyRequest);

      // Test echo method
      EchoRequestProto echoRequest = EchoRequestProto.newBuilder().setMessage("hello").build();
      EchoResponseProto echoResponse = stub.echo(null, echoRequest);
      assertEquals("hello", echoResponse.getMessage());

      stub.error(null, emptyRequest);
      fail("Expected exception is not thrown");
    } finally {
      rpcClient.close();
    }
  }
Test for testing protocol buffer based RPC mechanism. This test depends on test.proto definition
of types in <code>src/test/protobuf/test.proto</code> and protobuf service definition from
<code>src/test/protobuf/test_rpc_service.proto</code>
hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/TestProtoBufRpc.java