void IBuildTaskService.SendTestcaseFile(string testsystemName, byte[] data) { object _lock = _testFileLocker.GetLock(testsystemName); lock (_lock) { Testsystem testsystem = _testsystemRepository.GetByName(testsystemName); testsystem.LastUpdated = DateTime.Now; _testsystemRepository.Store(testsystem); string testFile = RegtestingServerConfiguration.Testsfolder + testsystem.Filename; Directory.CreateDirectory(Path.GetDirectoryName(testFile)); using (FileStream fileStream = new FileStream(testFile, FileMode.Create, FileAccess.Write)) { fileStream.Write(data, 0, data.Length); } Logger.Log("UPDATE branch: " + testsystemName); TestcaseProvider testcaseProvider = new TestcaseProvider(testFile); testcaseProvider.CreateAppDomain(); foreach (string testcaseType in testcaseProvider.Types) { ITestable testable = testcaseProvider.GetTestableFromTypeName(testcaseType); if (testable == null) { continue; } Testcase testcase = _testcaseRepository.GetByType(testcaseType); string testableName = testable.GetName(); if (testcase == null) { Logger.Log("New test: " + testableName); testcase = new Testcase { Name = testableName, Type = testcaseType }; _testcaseRepository.Store(testcase); } else if (!testcase.Name.Equals(testableName)) { Logger.Log("Renamed test: " + testcase.Name + " to " + testableName); testcase.Name = testableName; _testcaseRepository.Store(testcase); } } testcaseProvider.Unload(); } }
IList <TestsystemSummary> ISummaryService.GetPinnedTestsystemSummaries() { Testsuite testsuite = _testsuiteRepository.GetByName(RegtestingServerConfiguration.Defaulttestsuite); IList <Testsystem> mainTestsystems = RegtestingServerConfiguration.PinnedBranches.Select(t => _testsystemRepository.GetByName(t)).ToList(); return(mainTestsystems .Select(objTestsystem => CreateTestsystemSummary(objTestsystem, testsuite, TestsystemSummariesCache.Cache)) .ToList()); }