コード例 #1
0
        /// <summary>
        /// If no configuration is provided, then create a default one.
        /// </summary>
        private void SetDefaultConfiguration()
        {
            if (Configuration != null)
            {
                return;
            }

            Configuration = new StfArchiverConfiguration();
        }
コード例 #2
0
        /// <summary>
        /// The set up archiver if necessary.
        /// </summary>
        /// <param name="testName">
        /// The test name.
        /// </param>
        private void SetUpArchiver(string testName)
        {
            var stfConfiguration      = Get <StfConfiguration>();
            var archiverConfiguration = new StfArchiverConfiguration();

            try
            {
                stfConfiguration.LoadUserConfiguration(archiverConfiguration);
            }
            catch (Exception exception)
            {
                var msg = $"Something went wrong while loading user configuration for archiver: {exception.Message}";
                StfLogger.LogError(msg);
            }

            archiverConfiguration.ArchiveTopDir      = StfTextUtils.ExpandVariables(archiverConfiguration.ArchiveTopDir);
            archiverConfiguration.ArchiveDestination = StfTextUtils.ExpandVariables(archiverConfiguration.ArchiveDestination);
            archiverConfiguration.TempDirectory      = StfTextUtils.ExpandVariables(archiverConfiguration.TempDirectory);
            StfArchiver = new StfArchiver(archiverConfiguration, testName);
        }