hconf.getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS));
hconf.setVar(ConfVars.HIVE_SERVER2_AUTHENTICATION,
HiveAuthFactory.AuthTypes.KERBEROS.toString());
CLIService cliService = new CLIService();
cliService.init(hconf);
ThriftCLIService tcliService = new ThriftCLIService(cliService);
TOpenSessionReq req = new TOpenSessionReq();
req.setUsername("testuser1");
SessionHandle sHandle = tcliService.getSessionHandle(req );
SessionManager sManager = getSessionManager(cliService.getServices());
HiveSession session = sManager.getSession(sHandle);
//Proxy class for doing doAs on all calls is used when doAs is enabled
// and kerberos security is on
assertTrue("check if session class is a proxy", session instanceof java.lang.reflect.Proxy);