GetDatasourceInfo() public method

获取指定的某个数据源的信息。
参数 datasourceName 为空时抛出异常。 服务端处理错误时抛出异常。
public GetDatasourceInfo ( string datasourceName ) : DatasourceInfo
datasourceName string 数据源名称,必设参数。
return DatasourceInfo
 public void GetDatasourceInfoTest_Error()
 {
     Data data = new Data("http://" + ip + ":8090/iserver/services/data-world/rest");
     try
     {
         DatasourceInfo dataosurceInfo = data.GetDatasourceInfo("worl");
     }
     catch (ServiceException e)
     {
         Assert.AreEqual(e.Message, "数据源worl不存在,获取相应的数据服务组件失败");
     }
 }
 public void GetDatasourceInfo_SourceNameError()
 {
     Data data = new Data("http://" + ip + ":8090/iserver/services/data-world/rest");
     try
     {
         DatasourceInfo datasourceInfo = data.GetDatasourceInfo("World1");
     }
     catch (ServiceException exception)
     {
         Assert.IsTrue(exception.Code == 404);
     }
 }
        public void UpdateDatasourceInfo_Valid()
        {
            Data data = new Data("http://" + ip + ":8090/iserver/services/data-world/rest");

            bool succeed = data.UpdateDatasourceInfo("World", new DatasourceInfo() { Description = "世界地图1" });
            DatasourceInfo info = data.GetDatasourceInfo("World");
            Assert.IsTrue(succeed);
            Assert.IsNotNull(info);
            Assert.IsTrue(info.Description == "世界地图1");
        }
 public void GetDatasourceInfo()
 {
     Data data = new Data("http://" + ip + ":8090/iserver/services/data-world/rest");
     DatasourceInfo datasourceInfo = data.GetDatasourceInfo("World");
     Assert.IsNotNull(datasourceInfo != null);
     Assert.IsTrue(datasourceInfo.Name == "World");
 }