LoadConfig() public static méthode

Loads the configuration file
public static LoadConfig ( string testSuiteName, string testSuiteVersion, string testSuiteDir, string installDir ) : AppConfig
testSuiteName string The name of the test suite.
testSuiteVersion string The version of test suite
testSuiteDir string The working directory for the test suite.
installDir string The install directory of PTM.
Résultat AppConfig
Exemple #1
0
        /// <summary>
        /// Loads test suite configuration.
        /// </summary>
        /// <param name="testSuiteInfo">The information of a test suite</param>
        public void LoadTestSuiteConfig(TestSuiteInfo testSuiteInfo)
        {
            testSuiteDir = testSuiteInfo.TestSuiteFolder + "\\";
            try
            {
                appConfig = AppConfig.LoadConfig(
                    testSuiteInfo.TestSuiteName,
                    testSuiteInfo.TestSuiteVersion,
                    testSuiteDir,
                    installDir);
            }
            catch (Exception e)
            {
                throw new Exception(string.Format(StringResource.ConfigLoadError, e.Message));
            }

            try
            {
                filter = TestCaseFilter.LoadFromXml(appConfig.RuleDefinitions);
            }
            catch (Exception e)
            {
                throw new Exception(string.Format(StringResource.LoadFilterError, e.Message));
            }
            appConfig.InitDefaultConfigurations();

            LastRuleSelectionFilename = testSuiteInfo.LastProfile;
        }
Exemple #2
0
        /// <summary>
        /// Loads test suite configuration.
        /// </summary>
        /// <param name="testSuiteInfo">The information of a test suite</param>
        public void LoadTestSuiteConfig(TestSuiteInfo testSuiteInfo)
        {
            // Test suite version must match PTM version
            Version testSuiteVersion = new Version(testSuiteInfo.TestSuiteVersion);

            if (ptmVersion < testSuiteVersion)
            {
                throw new Exception(String.Format(StringResource.PTMNeedUpgrade, ptmVersion, testSuiteVersion));
            }
            else if (ptmVersion > testSuiteVersion)
            {
                throw new Exception(String.Format(StringResource.TestSuiteNeedUpgrade, ptmVersion, testSuiteVersion));
            }

            testSuiteDir = testSuiteInfo.TestSuiteFolder + Path.DirectorySeparatorChar;
            try
            {
                appConfig = AppConfig.LoadConfig(
                    testSuiteInfo.TestSuiteName,
                    testSuiteInfo.TestSuiteVersion,
                    testSuiteDir,
                    installDir);
            }
            catch (Exception e)
            {
                throw new Exception(string.Format(StringResource.ConfigLoadError, e.Message));
            }

            try
            {
                filter = TestCaseFilter.LoadFromXml(appConfig.RuleDefinitions);
            }
            catch (Exception e)
            {
                throw new Exception(string.Format(StringResource.LoadFilterError, e.Message));
            }

            try
            {
                LoadFeatureMappingFromXml(appConfig.FeatureMapping);
            }
            catch (Exception e)
            {
                throw new Exception(string.Format(StringResource.LoadFeatureMappingError, e.Message));
            }

            appConfig.InitDefaultConfigurations();

            LastRuleSelectionFilename = testSuiteInfo.LastProfile;
        }