Index: src/test/org/apache/hcatalog/security/TestHdfsAuthorizationProvider.java =================================================================== --- src/test/org/apache/hcatalog/security/TestHdfsAuthorizationProvider.java (revision 1342815) +++ src/test/org/apache/hcatalog/security/TestHdfsAuthorizationProvider.java (working copy) @@ -132,9 +132,12 @@ String command = String.format(format, args); CommandProcessorResponse resp = hcatDriver.run(command); Assert.assertNotSame(resp.getErrorMessage(), 0, resp.getResponseCode()); - Assert.assertTrue(resp.getResponseCode() == 403 || //hive checks fail with 403 - resp.getErrorMessage().contains("org.apache.hadoop.hive.ql.metadata.AuthorizationException")); + Assert.assertTrue((resp.getResponseCode() == 40000) || (resp.getResponseCode() == 403)); + if(resp.getErrorMessage() != null){ + Assert.assertTrue(resp.getErrorMessage().contains("org.apache.hadoop.security.AccessControlException")); + } } + /** * Tests whether the warehouse directory is writable by the current user (as defined by Hadoop) Index: src/test/org/apache/hcatalog/cli/TestSemanticAnalysis.java =================================================================== --- src/test/org/apache/hcatalog/cli/TestSemanticAnalysis.java (revision 1342815) +++ src/test/org/apache/hcatalog/cli/TestSemanticAnalysis.java (working copy) @@ -120,7 +120,8 @@ public void testUsNonExistentDB() throws CommandNeedRetryException { - assertEquals(9, hcatDriver.run("use no_such_db").getResponseCode()); + CommandProcessorResponse resp = hcatDriver.run("use no_such_db"); + assertEquals(1, resp.getResponseCode()); } public void testDatabaseOperations() throws MetaException, CommandNeedRetryException { @@ -274,8 +275,8 @@ hcatDriver.run("drop table junit_sem_analysis"); query = "create table junit_sem_analysis (a int) as select * from tbl2"; CommandProcessorResponse response = hcatDriver.run(query); - assertEquals(10, response.getResponseCode()); - assertTrue(response.getErrorMessage().contains("FAILED: Error in semantic analysis: Operation not supported. Create table as Select is not a valid operation.")); + assertEquals(40000, response.getResponseCode()); + assertTrue(response.getErrorMessage().contains("FAILED: SemanticException Operation not supported. Create table as Select is not a valid operation.")); hcatDriver.run("drop table junit_sem_analysis"); } @@ -308,8 +309,8 @@ query = "create table junit_sem_analysis (a int) partitioned by (b int) stored as RCFILE"; CommandProcessorResponse response = hcatDriver.run(query); - assertEquals(10,response.getResponseCode()); - assertEquals("FAILED: Error in semantic analysis: Operation not supported. HCatalog only supports partition columns of type string. For column: b Found type: int", + assertEquals(40000,response.getResponseCode()); + assertEquals("FAILED: SemanticException Operation not supported. HCatalog only supports partition columns of type string. For column: b Found type: int", response.getErrorMessage()); }