/// <summary> /// Get the server name where get.msn service is hosted. /// </summary> private static void GetServerName() { try { Uri serviceUri = new Uri(GetUrl()); string serverName = string.Empty; string qosURL = serviceUri.Scheme + "://" + serviceUri.Host + "/qos.aspx"; string temp = IdentifyServer.GetMachineName(qosURL, Helper.proxyAddress, Helper.Port); if (string.IsNullOrEmpty(serverName)) { serverName = temp; } Logger.LogStartOfValidation(Constants.ToolName, Helper.environment.ToUpperInvariant(), Constants.ToolDesc, Helper.proxyAddress, Helper.Port.ToString(), serverName); serverName = temp; } catch (WebException ex) { Logger.AddComment(Constants.ErrorMsg + ex.Message, Logger.CommentType.Error); } catch (Exception ex) { Logger.AddComment(Constants.ErrorMsg + ex.Message, Logger.CommentType.Error); } }
/// <summary> /// This functions starts Execution of Smoke Tests /// </summary> /// <param name="args">Command Line Arguments passed to the tool.</param> internal void RunSmokeTests(string[] args) { if (!Helper.CommandLineArgsValid(args)) { return; } this.objhelper = new Helper(Helper.TestType); string serverName = string.Empty; try { Uri au = new Uri(this.objhelper.AUUrl); Uri pn = new Uri(this.objhelper.PNUrl); string qosAu = "http://" + au.Host + "/qos.aspx"; string qosPn = "https://" + pn.Host + "/qos.aspx"; serverName = IdentifyServer.GetMachineName(qosAu, Helper.ProxyAddress, Helper.Port); string temp = IdentifyServer.GetMachineName(qosPn, Helper.ProxyAddress, Helper.Port); if (temp != serverName) { serverName += ", " + temp; } } catch { // Do nothing } Logger.LogStartOfValidation("FUN SmokeTool", Helper.Environment.ToUpper(CultureInfo.InvariantCulture), "Tool used to validate the FUN service", Helper.ProxyAddress, Helper.Port.ToString(), serverName); try { this.test = new Test(this.objhelper); } catch (Exception e) { Logger.AddComment("Tool failed with error: " + e.Message, Logger.CommentType.Error); return; } string[] funServices = { "fu", "pn", "au", "legacy" }; bool keepGoing = true; // Run service validation for each FUN service foreach (string service in funServices) { if (keepGoing) { keepGoing = this.PrepAndRunServiceTests(service); } } }
/// <summary> /// Check prerequisite. /// </summary> /// <param name="args">arguments passed.</param> /// <returns>true or false</returns> public static bool CheckPreRequisite(string[] args) { string servername = "Unknown"; try { if ((!CommandLineArgsValid(args)) || (!IsXmlFilePresent()) || (!IsConfigFilePresent())) { return(false); } else { Initialize(); if (!string.IsNullOrEmpty(serviceUrl)) { try { Uri uri = new Uri(serviceUrl); string qosCC = uri.Scheme + "://" + uri.Host + "/qos.aspx"; servername = IdentifyServer.GetMachineName(qosCC, HelperClass.proxyaddress); Logger.LogStartOfValidation("Connection Center Logging SmokeTool", HelperClass.environment.ToUpperInvariant(), "Tool used to validate the Connection Center service.", HelperClass.proxyaddress, HelperClass.port.ToString(), servername); return(true); } catch (Exception) { Logger.LogStartOfValidation("Connection Center Logging SmokeTool", HelperClass.environment.ToUpperInvariant(), "Tool used to validate the Connection Center service.", HelperClass.proxyaddress, HelperClass.port.ToString(), HelperClass.ServerName.ToUpperInvariant()); return(false); } } else { Logger.AddComment("ServiceUrl Cannot be blank", Logger.CommentType.Error); return(false); } } } catch (Exception exception) { Logger.LogStartOfValidation("Connection Center Logging SmokeTool", HelperClass.Environment.ToUpperInvariant(), "Tool used to validate the Connection Center service.", HelperClass.ProxyAddress, HelperClass.Port.ToString(), servername); Logger.AddComment("ErrorOccured :" + exception.Message.ToString(), Logger.CommentType.Error); return(false); } }