Java Code Examples for org.apache.hadoop.hive.metastore.IHMSHandler#get_database()

The following examples show how to use org.apache.hadoop.hive.metastore.IHMSHandler#get_database() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExceptionWrappingHMSHandlerTest.java    From waggle-dance with Apache License 2.0 5 votes vote down vote up
@Test
public void get_databaseWaggleDanceServerException() throws Exception {
  expectedException.expect(MetaException.class);
  IHMSHandler handler = ExceptionWrappingHMSHandler.newProxyInstance(baseHandler);
  when(baseHandler.get_database("bdp")).thenThrow(new WaggleDanceServerException("waggle waggle!"));
  handler.get_database("bdp");
}
 
Example 2
Source File: ExceptionWrappingHMSHandlerTest.java    From waggle-dance with Apache License 2.0 5 votes vote down vote up
@Test
public void get_databasNotAllowedException() throws Exception {
  expectedException.expect(MetaException.class);
  IHMSHandler handler = ExceptionWrappingHMSHandler.newProxyInstance(baseHandler);
  when(baseHandler.get_database("bdp")).thenThrow(new NotAllowedException("waggle waggle!"));
  handler.get_database("bdp");
}
 
Example 3
Source File: ExceptionWrappingHMSHandlerTest.java    From waggle-dance with Apache License 2.0 5 votes vote down vote up
@Test
public void get_databaseRunTimeExceptionIsNotWrapped() throws Exception {
  expectedException.expect(RuntimeException.class);
  expectedException.expectMessage("generic non waggle dance exception");
  IHMSHandler handler = ExceptionWrappingHMSHandler.newProxyInstance(baseHandler);
  when(baseHandler.get_database("bdp")).thenThrow(new RuntimeException("generic non waggle dance exception"));
  handler.get_database("bdp");
}
 
Example 4
Source File: ExceptionWrappingHMSHandlerTest.java    From waggle-dance with Apache License 2.0 5 votes vote down vote up
@Test
public void get_databaseCheckedExceptionIsNotWrapped() throws Exception {
  expectedException.expect(NoSuchObjectException.class);
  expectedException.expectMessage("Does not exist!");
  IHMSHandler handler = ExceptionWrappingHMSHandler.newProxyInstance(baseHandler);
  when(baseHandler.get_database("bdp")).thenThrow(new NoSuchObjectException("Does not exist!"));
  handler.get_database("bdp");
}
 
Example 5
Source File: ExceptionWrappingHMSHandlerTest.java    From waggle-dance with Apache License 2.0 4 votes vote down vote up
@Test
public void get_databaseNoExceptions() throws Exception {
  IHMSHandler handler = ExceptionWrappingHMSHandler.newProxyInstance(baseHandler);
  handler.get_database("bdp");
  verify(baseHandler).get_database("bdp");
}