Beispiel #1
0
        public void Connect(string Server, string Username, string password, bool Verify = true)
        {
            Loaded = false;
            var settings = new UcClientSettings
            {
                Server   = Server,
                User     = Username,
                Password = password
            };

            if (Verify)
            {
                var tempclient  = new RosterClient(settings);
                var testResults = tempclient.Execute(client =>
                {
                    return(client.getClusterInfo(new GetClusterInfoReq {
                    }));
                });

                testResults.Exception.ThrowIfNotNull();

                RosterClient = tempclient;
                Loaded       = true;
            }
            else
            {
                RosterClient = new RosterClient(settings);
                Loaded       = true;
            }
        }
Beispiel #2
0
        public void GetRosterUserTest()
        {
            var rosterClient = new RosterClient(new UcClientSettings {
                Server = "10.10.20.17", User = "******", Password = "******"
            });

            var result = rosterClient.Execute(client =>
            {
                return(client.executeSQLQuery(new RosterNetClient.ExecuteSQLQueryReq
                {
                    sql = @"SELECT TRIM(t.tabname) || '.' || TRIM(c.colname) AS table_dot_column
  FROM informix.systables  AS t
  JOIN informix.syscolumns AS c ON t.tabid = c.tabid
 WHERE t.tabtype = 'T'
   AND t.tabid >= 100
 ORDER BY t.tabname,
                    c.colno; "
                }));
            });

            var res2 = rosterClient.Execute(client =>
            {
                return(client.getClusterInfo(new GetClusterInfoReq
                {
                }));
            });

            if (result.Exception != null)
            {
                throw result.Exception;
            }

            Assert.IsNotNull(result.Value);
        }
Beispiel #3
0
 public void Disconnect()
 {
     RosterClient = null;
     Loaded       = false;
 }