Author: thejas
Date: Wed Mar 12 11:30:35 2014
New Revision: 1576698
URL: http://svn.apache.org/r1576698
Log:
HIVE-6512 : HiveServer2 ThriftCLIServiceTest#testDoAs is an invalid test
(Vaibhav Gumashta via Thejas Nair)
Modified:
hive/trunk/service/src/test/org/apache/hive/service/cli/thrift/ThriftCLIServiceTest.java
Modified:
hive/trunk/service/src/test/org/apache/hive/service/cli/thrift/ThriftCLIServiceTest.java
URL:
http://svn.apache.org/viewvc/hive/trunk/service/src/test/org/apache/hive/service/cli/thrift/ThriftCLIServiceTest.java?rev=1576698&r1=1576697&r2=1576698&view=diff
==============================================================================
---
hive/trunk/service/src/test/org/apache/hive/service/cli/thrift/ThriftCLIServiceTest.java
(original)
+++
hive/trunk/service/src/test/org/apache/hive/service/cli/thrift/ThriftCLIServiceTest.java
Wed Mar 12 11:30:35 2014
@@ -23,23 +23,9 @@ import static org.junit.Assert.assertNot
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import java.io.IOException;
-import java.util.Collection;
-
-import javax.security.auth.login.LoginException;
-
import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
import org.apache.hadoop.hive.metastore.MetaStoreUtils;
-import org.apache.hadoop.hive.ql.ErrorMsg;
-import org.apache.hive.service.Service;
-import org.apache.hive.service.auth.HiveAuthFactory;
import org.apache.hive.service.auth.PlainSaslHelper;
-import org.apache.hive.service.cli.CLIService;
-import org.apache.hive.service.cli.HiveSQLException;
-import org.apache.hive.service.cli.SessionHandle;
-import org.apache.hive.service.cli.session.HiveSession;
-import org.apache.hive.service.cli.session.SessionManager;
import org.apache.hive.service.server.HiveServer2;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
@@ -271,7 +257,7 @@ public abstract class ThriftCLIServiceTe
// Execute a malformed query
// This query will give a runtime error
- queryString = "CREATE TABLE NON_EXISTING_TAB (ID STRING) location
'hdfs://fooNN:10000/a/b/c'";
+ queryString = "CREATE TABLE NON_EXISTING_TAB (ID STRING) location
'hdfs://localhost:10000/a/b/c'";
System.out.println("Will attempt to execute: " + queryString);
execResp = executeQuery(queryString, sessHandle, true);
operationHandle = execResp.getOperationHandle();
@@ -338,46 +324,6 @@ public abstract class ThriftCLIServiceTe
}
/**
- * Test setting {@link HiveConf.ConfVars}} config parameter
- * HIVE_SERVER2_ENABLE_DOAS for kerberos secure mode
- * @throws IOException
- * @throws LoginException
- * @throws HiveSQLException
- */
- @Test
- public void testDoAs() throws HiveSQLException, LoginException, IOException {
- HiveConf hconf = new HiveConf();
- assertTrue("default value of hive server2 doAs should be true",
- 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 ThriftBinaryCLIService(cliService);
- TOpenSessionReq req = new TOpenSessionReq();
- TOpenSessionResp res = new TOpenSessionResp();
- req.setUsername("testuser1");
- SessionHandle sHandle = tcliService.getSessionHandle(req, res);
- 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);
- }
-
- private SessionManager getSessionManager(Collection<Service> services) {
- for(Service s : services){
- if(s instanceof SessionManager){
- return (SessionManager)s;
- }
- }
- return null;
- }
-
- /**
* @throws java.lang.Exception
*/
@Before