static ThriftCLIServiceClient getServiceClientInternal() {
    for (Service service : hiveServer2.getServices()) {
      if (service instanceof ThriftBinaryCLIService) {
        return new ThriftCLIServiceClient((ThriftBinaryCLIService) service);
      }
      if (service instanceof ThriftHttpCLIService) {
        return new ThriftCLIServiceClient((ThriftHttpCLIService) service);
      }
    }
    throw new IllegalStateException("HiveServer2 not running Thrift service");
  }
ThriftCLIServiceTest.
This is the abstract class that tests ThriftCLIService.
Subclass this to test more specific behaviour.
service/src/test/org/apache/hive/service/cli/thrift/ThriftCLIServiceTest.java