use of org.apache.hadoop.hive.metastore.api.Function in project hive by apache.
the class TestFunctions method testCreateFunctionNullOwnerType.
@Test
public void testCreateFunctionNullOwnerType() throws Exception {
Function function = testFunctions[0];
function.setFunctionName("test_function_2");
function.setOwnerType(null);
try {
client.createFunction(function);
// TODO: Should have a check on the server side. Embedded metastore throws
// NullPointerException, remote throws TTransportException
Assert.fail("Expected an NullPointerException or TTransportException to be thrown");
} catch (NullPointerException exception) {
// Expected exception - Embedded MetaStore
} catch (TTransportException exception) {
// Expected exception - Remote MetaStore
}
}
use of org.apache.hadoop.hive.metastore.api.Function in project hive by apache.
the class TestFunctions method testAlterFunctionNullDatabaseNameInNew.
@Test
public void testAlterFunctionNullDatabaseNameInNew() throws Exception {
Function newFunction = getNewFunction();
newFunction.setDbName(null);
try {
client.alterFunction(DEFAULT_DATABASE, "test_function_to_find_2", newFunction);
// TODO: Should have a check on the server side. Embedded metastore throws
// NullPointerException, remote throws TTransportException
Assert.fail("Expected an NullPointerException or TTransportException to be thrown");
} catch (NullPointerException exception) {
// Expected exception - Embedded MetaStore
} catch (TTransportException exception) {
// Expected exception - Remote MetaStore
}
}
use of org.apache.hadoop.hive.metastore.api.Function in project hive by apache.
the class TestFunctions method testCreateFunctionNullClass.
@Test(expected = InvalidObjectException.class)
public void testCreateFunctionNullClass() throws Exception {
Function function = testFunctions[0];
function.setClassName(null);
client.createFunction(function);
}
use of org.apache.hadoop.hive.metastore.api.Function in project hive by apache.
the class TestFunctions method testAlterFunctionNullFunctionName.
@Test
public void testAlterFunctionNullFunctionName() throws Exception {
Function newFunction = getNewFunction();
try {
client.alterFunction(DEFAULT_DATABASE, null, newFunction);
// TODO: Should have a check on the server side. Embedded metastore throws
// NullPointerException, remote throws TTransportException
Assert.fail("Expected an NullPointerException or TTransportException to be thrown");
} catch (NullPointerException exception) {
// Expected exception - Embedded MetaStore
} catch (TTransportException exception) {
// Expected exception - Remote MetaStore
}
}
use of org.apache.hadoop.hive.metastore.api.Function in project hive by apache.
the class TestFunctions method testGetFunctionNoSuchDatabase.
@Test(expected = NoSuchObjectException.class)
public void testGetFunctionNoSuchDatabase() throws Exception {
// Choosing the 2nd function, since the 1st one is duplicated in the dummy database
Function function = testFunctions[1];
client.getFunction("no_such_database", function.getFunctionName());
}
Aggregations