use of alluxio.table.common.udb.UdbContext in project alluxio by Alluxio.
the class GlueDatabaseTest method before.
@Before
public void before() {
Map<String, String> conf = ImmutableMap.of("aws.region", "us-east-1");
mUdbConfiguration = new UdbConfiguration(conf);
mUdbContext = new UdbContext(null, null, "glue", "null", DB_NAME, DB_NAME);
}
use of alluxio.table.common.udb.UdbContext in project alluxio by Alluxio.
the class GlueDatabaseTest method createEmptyName.
@Test
public void createEmptyName() {
mExpection.expect(IllegalArgumentException.class);
UdbContext udbContext = new UdbContext(null, null, "glue", null, "", DB_NAME);
assertEquals(DB_NAME, GlueDatabase.create(udbContext, new UdbConfiguration(ImmutableMap.of())).getName());
}
use of alluxio.table.common.udb.UdbContext in project alluxio by Alluxio.
the class HiveDatabaseTest method createNullConnectionUri.
@Test
public void createNullConnectionUri() {
mExpection.expect(IllegalArgumentException.class);
UdbContext udbContext = new UdbContext(null, null, "hive", null, DB_NAME, DB_NAME);
assertEquals(DB_NAME, HiveDatabase.create(udbContext, new UdbConfiguration(ImmutableMap.of())).getName());
}
use of alluxio.table.common.udb.UdbContext in project alluxio by Alluxio.
the class GlueDatabaseTest method createNullName.
@Test
public void createNullName() {
mExpection.expect(IllegalArgumentException.class);
UdbContext udbContext = new UdbContext(null, null, "glue", null, null, DB_NAME);
assertEquals(DB_NAME, GlueDatabase.create(udbContext, new UdbConfiguration(ImmutableMap.of())).getName());
}
use of alluxio.table.common.udb.UdbContext in project alluxio by Alluxio.
the class AlluxioCatalogTest method createMockDatabase.
private Database createMockDatabase(String type, String name, Collection<Table> tables) {
UdbContext udbCtx = Mockito.mock(UdbContext.class);
when(udbCtx.getUdbRegistry()).thenReturn(Mockito.mock(UnderDatabaseRegistry.class));
Database db = Database.create(Mockito.mock(CatalogContext.class), udbCtx, type, name, Collections.emptyMap());
tables.forEach(table -> addTableToDb(db, table));
return db;
}
Aggregations