org.apache.hadoop.hive.ql.security
Class TestStorageBasedMetastoreAuthorizationProvider

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.hadoop.hive.ql.security.TestMetastoreAuthorizationProvider
              extended by org.apache.hadoop.hive.ql.security.TestStorageBasedMetastoreAuthorizationProvider
All Implemented Interfaces:
junit.framework.Test

public class TestStorageBasedMetastoreAuthorizationProvider
extends TestMetastoreAuthorizationProvider

TestStorageBasedMetastoreAuthorizationProvider. Test case for StorageBasedAuthorizationProvider, by overriding methods defined in TestMetastoreAuthorizationProvider Note that while we do use the hive driver to test, that is mostly for test writing ease, and it has the same effect as using a metastore client directly because we disable hive client-side authorization for this test, and only turn on server-side auth.


Field Summary
 
Fields inherited from class org.apache.hadoop.hive.ql.security.TestMetastoreAuthorizationProvider
clientHiveConf, driver, msc, ugi
 
Constructor Summary
TestStorageBasedMetastoreAuthorizationProvider()
           
 
Method Summary
protected  void allowCreateInDb(String dbName, String userName, String location)
           
protected  void allowCreateInTbl(String tableName, String userName, String location)
           
protected  void allowDropOnDb(String dbName, String userName, String location)
           
protected  void allowDropOnTable(String tblName, String userName, String location)
           
protected  void assertNoPrivileges(MetaException me)
           
protected  void disallowCreateInDb(String dbName, String userName, String location)
           
protected  void disallowCreateInTbl(String tableName, String userName, String location)
           
protected  String getAuthorizationProvider()
           
protected  String getTestDbName()
           
protected  String getTestTableName()
           
 
Methods inherited from class org.apache.hadoop.hive.ql.security.TestMetastoreAuthorizationProvider
setUp, tearDown, testSimplePrivileges
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestStorageBasedMetastoreAuthorizationProvider

public TestStorageBasedMetastoreAuthorizationProvider()
Method Detail

getAuthorizationProvider

protected String getAuthorizationProvider()
Overrides:
getAuthorizationProvider in class TestMetastoreAuthorizationProvider

allowCreateInDb

protected void allowCreateInDb(String dbName,
                               String userName,
                               String location)
                        throws Exception
Overrides:
allowCreateInDb in class TestMetastoreAuthorizationProvider
Throws:
Exception

disallowCreateInDb

protected void disallowCreateInDb(String dbName,
                                  String userName,
                                  String location)
                           throws Exception
Overrides:
disallowCreateInDb in class TestMetastoreAuthorizationProvider
Throws:
Exception

allowCreateInTbl

protected void allowCreateInTbl(String tableName,
                                String userName,
                                String location)
                         throws Exception
Overrides:
allowCreateInTbl in class TestMetastoreAuthorizationProvider
Throws:
Exception

disallowCreateInTbl

protected void disallowCreateInTbl(String tableName,
                                   String userName,
                                   String location)
                            throws Exception
Overrides:
disallowCreateInTbl in class TestMetastoreAuthorizationProvider
Throws:
Exception

allowDropOnTable

protected void allowDropOnTable(String tblName,
                                String userName,
                                String location)
                         throws Exception
Overrides:
allowDropOnTable in class TestMetastoreAuthorizationProvider
Throws:
Exception

allowDropOnDb

protected void allowDropOnDb(String dbName,
                             String userName,
                             String location)
                      throws Exception
Overrides:
allowDropOnDb in class TestMetastoreAuthorizationProvider
Throws:
Exception

assertNoPrivileges

protected void assertNoPrivileges(MetaException me)
Overrides:
assertNoPrivileges in class TestMetastoreAuthorizationProvider

getTestDbName

protected String getTestDbName()
Overrides:
getTestDbName in class TestMetastoreAuthorizationProvider

getTestTableName

protected String getTestTableName()
Overrides:
getTestTableName in class TestMetastoreAuthorizationProvider


Copyright © 2012 The Apache Software Foundation