GetDatasourceInfos() public method

获取所有数据源的信息。
服务端处理错误时抛出异常。
public GetDatasourceInfos ( ) : List
return List
Esempio n. 1
0
 public void GetDatasourceInfosTest_Error()
 {
     Data data = new Data("http://" + ip + ":8090/iserver/services/data-world1/rest");
     try
     {
         List<DatasourceInfo> datasourceInfos = data.GetDatasourceInfos();
     }
     catch (ServiceException e)
     {
         Assert.IsNotNull(e.Message, "远程服务器返回错误: (404) 未找到。");
         Assert.AreEqual(e.Code,404);
     }
 }
Esempio n. 2
0
        public void GetDatasourceInfos()
        {
            Data data = new Data("http://" + ip + ":8090/iserver/services/data-world/rest");
            List<DatasourceInfo> datasourceInfo = data.GetDatasourceInfos();

            Assert.IsNotNull(datasourceInfo);
            Assert.IsTrue(datasourceInfo.Count == 1);
            Assert.IsTrue(datasourceInfo[0] != null);
            Assert.IsTrue(datasourceInfo[0].Name == "World");
        }