use of alluxio.hub.proto.AgentListCatalogRequest in project alluxio by Alluxio.
the class AgentManagerServiceTest method testListCatalogs.
@Test
public void testListCatalogs() throws Exception {
String confDir = mTemp.getRoot().getAbsolutePath();
AgentListCatalogRequest r = AgentListCatalogRequest.newBuilder().setConfDir(confDir).build();
Files.createDirectory(Paths.get(confDir, "catalog"));
Path testCatalog = Paths.get(confDir, "catalog", "test-hive.properties");
Path badCatalog = Paths.get(confDir, "catalog", "bad.poperties");
Files.createFile(testCatalog);
Files.write(testCatalog, "hive.metastore.uri=thrift://aaabbbccc::9083/\nconnector.name=hive-hadoop2\n".getBytes());
Files.write(badCatalog, "hive.metastore.uri=thrift://aaabbbccc::9083/\nconnector.name=hive-hadoop2\n".getBytes());
AgentListCatalogResponse resp = mClient.listCatalogs(r);
assertEquals(1, resp.getCatalogCount());
PrestoCatalogListing l = resp.getCatalog(0);
assertEquals("test-hive", l.getCatalogName());
assertEquals("thrift://aaabbbccc::9083/", l.getHiveMetastoreUri());
}
Aggregations