incubator-hcatalog-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From avand...@apache.org
Subject svn commit: r1344485 - in /incubator/hcatalog/trunk: CHANGES.txt src/test/org/apache/hcatalog/cli/TestSemanticAnalysis.java src/test/org/apache/hcatalog/security/TestHdfsAuthorizationProvider.java
Date Wed, 30 May 2012 22:08:52 GMT
Author: avandana
Date: Wed May 30 22:08:51 2012
New Revision: 1344485

URL: http://svn.apache.org/viewvc?rev=1344485&view=rev
Log:
HCAT-421 Unit test failures in trunk build

Modified:
    incubator/hcatalog/trunk/CHANGES.txt
    incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestSemanticAnalysis.java
    incubator/hcatalog/trunk/src/test/org/apache/hcatalog/security/TestHdfsAuthorizationProvider.java

Modified: incubator/hcatalog/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/CHANGES.txt?rev=1344485&r1=1344484&r2=1344485&view=diff
==============================================================================
--- incubator/hcatalog/trunk/CHANGES.txt (original)
+++ incubator/hcatalog/trunk/CHANGES.txt Wed May 30 22:08:51 2012
@@ -43,6 +43,8 @@ Trunk (unreleased changes)
   OPTIMIZATIONS
 
   BUG FIXES
+  HCAT-421 Unit test failures in trunk build (avandana)
+
   HCAT-411 Incorrect example provided in the HCatalog documentation (Overview page) avandana
 
   HCAT-355 Include 1.1.0 version of hadoop as test dependency to fix random test failures
in build (rohini via avandana)

Modified: incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestSemanticAnalysis.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestSemanticAnalysis.java?rev=1344485&r1=1344484&r2=1344485&view=diff
==============================================================================
--- incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestSemanticAnalysis.java (original)
+++ incubator/hcatalog/trunk/src/test/org/apache/hcatalog/cli/TestSemanticAnalysis.java Wed
May 30 22:08:51 2012
@@ -120,7 +120,8 @@ public class TestSemanticAnalysis extend
 
 
   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 @@ public class TestSemanticAnalysis extend
     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 @@ public class TestSemanticAnalysis extend
     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());
 
   }

Modified: incubator/hcatalog/trunk/src/test/org/apache/hcatalog/security/TestHdfsAuthorizationProvider.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/test/org/apache/hcatalog/security/TestHdfsAuthorizationProvider.java?rev=1344485&r1=1344484&r2=1344485&view=diff
==============================================================================
--- incubator/hcatalog/trunk/src/test/org/apache/hcatalog/security/TestHdfsAuthorizationProvider.java
(original)
+++ incubator/hcatalog/trunk/src/test/org/apache/hcatalog/security/TestHdfsAuthorizationProvider.java
Wed May 30 22:08:51 2012
@@ -132,9 +132,12 @@ public class TestHdfsAuthorizationProvid
     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)



Mime
View raw message