public bool Validate() { Log(LogMessage.SeverityType.Info, "Validating HP-ALM connection"); Log(LogMessage.SeverityType.Info, string.Format(" Using HP-ALM URL '{0}'", url)); Log(LogMessage.SeverityType.Info, string.Format(" Username: '******'", username)); //ITDConnection2 connection = null; HPALMConnector.HPALMConnector connector = null; try { connector = new HPALMConnector.HPALMConnector(url); connector.Authenticate(username, password); //string majorVersion; //string buildNumber; //connection.GetTDVersion(out majorVersion, out buildNumber); //Log(LogMessage.SeverityType.Info, string.Format(" QualityCenter version is {0}.{1}", majorVersion, buildNumber)); Log(LogMessage.SeverityType.Info, string.Format(" HP-ALM connection is valid")); } catch (Exception ex) { Log(LogMessage.SeverityType.Warning, "Failed to execute HP-ALM connection validation", ex); return false; } finally { if (connector != null) { connector.Logout(); connector.Dispose(); } } Log(LogMessage.SeverityType.Info, "HP-ALM connection settings are valid."); return true; }
public QualityCenterClient(QCProject project, XmlNode config, ILogger log) { this.project = project; this.log = log; SetConfiguration(config); _connector = new HPALMConnector.HPALMConnector(url); }
public bool Validate() { HPALMConnector.HPALMConnector connector = null; try { connector = new HPALMConnector.HPALMConnector(entity.Connection.ApplicationUrl); var couldAuthenticate = connector.Authenticate(entity.Connection.Username, entity.Connection.Password); return couldAuthenticate; } catch (Exception) { return false; } finally { if (connector != null) { connector.Logout(); connector.Dispose(); } } }
public void Dispose() { _connector.Dispose(); _connector = null; }