Ejemplo n.º 1
0
 @Test
 public void testListUnknownSchema() {
   assertNull(
       metadata.getTableHandle(
           SESSION, new SchemaTableName("totally_invalid_database_name", "dual")));
   assertEquals(metadata.listTables(SESSION, "totally_invalid_database_name"), ImmutableList.of());
   assertEquals(
       metadata.listTableColumns(
           SESSION, new SchemaTablePrefix("totally_invalid_database_name", "dual")),
       ImmutableMap.of());
 }
Ejemplo n.º 2
0
 @Test
 public void testListUnknownSchema() {
   assertNull(
       metadata.getTableHandle(SESSION, new SchemaTableName(INVALID_DATABASE, INVALID_TABLE)));
   assertEquals(metadata.listTables(SESSION, INVALID_DATABASE), ImmutableList.of());
   assertEquals(
       metadata.listTableColumns(SESSION, new SchemaTablePrefix(INVALID_DATABASE, INVALID_TABLE)),
       ImmutableMap.of());
   assertEquals(metadata.listViews(SESSION, INVALID_DATABASE), ImmutableList.of());
   assertEquals(
       metadata.getViews(SESSION, new SchemaTablePrefix(INVALID_DATABASE, INVALID_TABLE)),
       ImmutableMap.of());
 }
Ejemplo n.º 3
0
 // disabled until metadata manager is updated to handle invalid catalogs and schemas
 @Test(enabled = false, expectedExceptions = SchemaNotFoundException.class)
 public void testGetTableNamesException() throws Exception {
   metadata.listTables(SESSION, INVALID_DATABASE);
 }
Ejemplo n.º 4
0
 @Test
 public void testGetTableNames() throws Exception {
   List<SchemaTableName> tables = metadata.listTables(SESSION, database);
   assertTrue(tables.contains(table));
 }
 @Override
 public List<SchemaTableName> listTables(String schemaNameOrNull) {
   try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) {
     return delegate.listTables(schemaNameOrNull);
   }
 }