@Test
  public void testTransportClose() throws Exception {
    hiveConf.setIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_CLIENT_CONNECTION_RETRY_LIMIT, 0);
    try {
      startHiveServer2WithConf(hiveConf);
      RetryingThriftCLIServiceClient.CLIServiceClientWrapper client
        = RetryingThriftCLIServiceClientTest.newRetryingCLIServiceClient(hiveConf);
      client.closeTransport();
      try {
        client.openSession("anonymous", "anonymous");
        fail("Shouldn't be able to open session when transport is closed.");
      } catch(HiveSQLException ignored) {

      }
    } finally {
      hiveConf.setIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_CLIENT_CONNECTION_RETRY_LIMIT, 3);
      stopHiveServer2();
    }
  }
Test CLI service with a retrying client. All tests should pass. This is to validate that calls
are transferred successfully.
service/src/test/org/apache/hive/service/cli/TestRetryingThriftCLIServiceClient.java