private TestsystemSummary CreateTestsystemSummary(Testsystem testsystem, Testsuite testsuite, TestsystemSummariesCache cache)
		{
			lock (cache.GetLock(testsystem.ID))
			{
				
				TestsystemSummary cachedResult = cache.Get(testsystem.ID);

				if (cachedResult != null)
					return cachedResult;


				IList<Result> results = _resultRepository.GetListOfResults(testsystem.ID, testsuite.Browsers, testsuite.Testcases,
													  testsuite.Languages);

				TestsystemSummary testsystemSummary = new TestsystemSummary
				{
					TestsuiteName = testsuite.Name,
					TestsuiteID = testsuite.ID,
					TestsystemName = testsystem.Name,
					TestsystemID = testsystem.ID,
				};

				if (results.Count != 0)
				{
					testsystemSummary.LastChangeDate = results.Min(t => t.Testtime);
					testsystemSummary.TestsystemStatus = results.Max(t => t.ResultCode);
				}
				else
				{
					testsystemSummary.LastChangeDate = DateTime.MinValue;
					testsystemSummary.TestsystemStatus = (int)TestState.NotSet;
				}

				cache.Set(testsystem.ID, testsystemSummary);
				return testsystemSummary;
			}
		}
		public static String GetDeploymentName(Testsystem testsystem)
		{
			return testsystem.Url;

		}
		public static bool IsDeploymentRunning(Testsystem testsystem)
		{
			return IsDeploymentRunning(GetDeploymentName(testsystem));
		}
Example #4
0
        private void UpdateTestcases(Testsystem testsystem)
        {
            const string testfile = @"LocalTests.dll";
            byte[] data;
            using (WcfClient wcfClient = new WcfClient(_serverAdr))
            {
                data = wcfClient.FetchDll(_nodename, testsystem.Name);
            }

            using (FileStream fileStream = new FileStream(testfile, FileMode.Create, FileAccess.Write))
            {
                fileStream.Write(data, 0, data.Length);
            }
            _testcaseProvider = new TestcaseProvider(testfile);
            _testcaseProvider.CreateAppDomain();
        }
		private static TestJob CreateTestJob(string name, Testsuite testsuite, Testsystem testsystem, Tester tester)
		{
			TestJob testjob = new TestJob
			{
				Name = name,
				ResultCode = TestState.Pending,
				Testsuite = testsuite,
				Testsystem = testsystem,
				Tester = tester,
				StartedAt = DateTime.Now,
				JobType = JobType.Testportal
			};
			return testjob;
		}