예제 #1
0
		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;
			}
		}
예제 #2
0
		public static String GetDeploymentName(Testsystem testsystem)
		{
			return testsystem.Url;

		}
예제 #3
0
		public static bool IsDeploymentRunning(Testsystem testsystem)
		{
			return IsDeploymentRunning(GetDeploymentName(testsystem));
		}
예제 #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();
        }
예제 #5
0
		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;
		}