Last active
November 30, 2022 15:02
Revisions
-
ivaneftimov revised this gist
Oct 21, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,10 +22,10 @@ public static void WaitForSitefinityToStart(string testingInstanceUrl, double to DateTime startTime = DateTime.UtcNow; TimeSpan elapsedTime = new TimeSpan(); HttpResponseMessage response; HttpClient client = new HttpClient(); do { response = client.Get(testingInstanceUrl + "/appstatus"); Thread.Sleep(1000); elapsedTime = DateTime.UtcNow.Subtract(startTime); -
Sitefinity SDK revised this gist
Oct 16, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ using System.Threading; using System.Web; namespace CiUtilities { public static class SitefinityStatusHelper { -
Sitefinity SDK revised this gist
Oct 16, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ using System.Threading; using System.Web; namespace Utilities { public static class SitefinityStatusHelper { -
Sitefinity SDK created this gist
Oct 16, 2015 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ using Microsoft.Http; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading; using System.Web; namespace SitefinityWebApp { public static class SitefinityStatusHelper { /// <summary> /// Waits for sitefintiy to start. /// </summary> /// <param name="testingInstanceUrl">The testing Sitefinity instance url.</param> /// <param name="totalWaitSeconds">the maximum wait time in seconds.</param> public static void WaitForSitefinityToStart(string testingInstanceUrl, double totalWaitSeconds) { // While /appstatus service is responding, Sitefinity is either in Initialize or Upgrade state. // Since Sitefinity Bootstrap is running on a different than main thread, getting of the tests is postoned until Sitefinity is up and running DateTime startTime = DateTime.UtcNow; TimeSpan elapsedTime = new TimeSpan(); HttpResponseMessage response; do { HttpClient client = new HttpClient(); response = client.Get(testingInstanceUrl + "/appstatus"); Thread.Sleep(1000); elapsedTime = DateTime.UtcNow.Subtract(startTime); } while (response.StatusCode == HttpStatusCode.OK && elapsedTime.TotalSeconds < totalWaitSeconds); if (elapsedTime.TotalSeconds > totalWaitSeconds) { throw new Exception("Sitefinity did not start in less than " + totalWaitSeconds / 60 + " minultes."); } } } }