/// <summary>Retrieve the derived test Script Reader based on metadata.</summary>
 /// <param name="info">The metadata for building the script reader.</param>
 /// <returns></returns>
 public static IScriptReader Get(TestSetInfo info)
 {
     // Removed deprecated ScriptReader type based on initialiser data.  XML reader only for now.
     IScriptReader r = new XmlFileScriptReader(info);
     r.Open();
     return r;
 }
Ejemplo n.º 2
0
        /// <summary>Load test sets from an initialisation file.
        /// 
        /// </summary>
        /// <param name="info">The test sets metadata.</param>
        public void loadLoggers(TestSetInfo info)
        {
            ILogInitialiser init = InitialiserFactory.Create(info);
            init.Load();

            LogInfo logInfo = init.GetNextLog();
            while (logInfo.IsValid()) {
                this.AddLog(LogFactory.Create(logInfo));
                logInfo = init.GetNextLog();
            }
        }
        /// <summary>
        /// Dynamically loads the IRegisterable class that initializes all the tests in a test set. 
        /// </summary>
        /// <param name="info">Object with the test set information for one test set.</param>
        /// <exception cref="InputException" />
        public void LoadTestSetAssembly(TestSetInfo info)
        {
            TryHelper.WrapToInputException(delegate() {
            // Load from fixed file and path.

            //FileIOPermission permission =
            //    new FileIOPermission(FileIOPermissionAccess.Read,info.AssemblyName);
            //permission.Demand();

            Assembly assembly = Assembly.LoadFrom(info.AssemblyName);
            Type type = assembly.GetType(info.ClassName, true);

            type.InvokeMember(
                registerMethodName,
                System.Reflection.BindingFlags.InvokeMethod,
                null,
                Activator.CreateInstance(type, true),
                new object[] { }
            );

            });
        }
 public XmlLogInitialiser(TestSetInfo info)
 {
     this.fileName = info.ConfigFile;
 }
 /// <summary>
 /// Creates the appropriate ILogInitialiser derived object.
 /// </summary>
 /// <param name="info">The log metadata object.</param>
 /// <returns>An constructed ILogInitialiser derived object.</returns>
 public static ILogInitialiser Create(TestSetInfo info)
 {
     // Removed deprectated intialisers. Only XML remains.
     return new XmlLogInitialiser(info);
 }
 /// <summary>Constructor.</summary>
 /// <param name="init">Initializer to access script information.</param>
 /// <param name="setName">The name of the test set.</param>
 public XmlFileScriptReader(TestSetInfo info)
 {
     this.fileName = info.ScriptFile;
 }