public static TestPackageExecutor ExecuteProjectPackage(string projectPath, string packageName)
        {
            ApplicationInitializer appInitializer = new ApplicationInitializer();
            Project project = ProjectLoader.LoadFromPath(projectPath, appInitializer);

            TestPackageExecutor testExecutor = new TestPackageExecutor(appInitializer);

            testExecutor.ExecutePackage(project.Packages.Where(t => t.DisplayName == packageName).First(), project.Connections);

            return(testExecutor);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            CommandLineOptions commandLineOptions = ParseCommandLineOptions(args);

            ApplicationInitializer appInitializer = new ApplicationInitializer();

            Project project = ProjectLoader.LoadFromPath(commandLineOptions.ProjectPath, appInitializer);

            Type[] extraTypes = appInitializer.ModuleLoader.GetModuleTypeList();

            Console.WriteLine("Starting execution of project " + project.ProjectName + "\n");

            string[] packagesToRun = String.IsNullOrEmpty(commandLineOptions.Packages) ?
                                     project.Packages.Select(t => t.DisplayName).ToArray <string>() :
                                     packagesToRun = commandLineOptions.Packages.Split(',');

            List <Package> packagesToExecute = new List <Package>();

            foreach (string packageName in packagesToRun)
            {
                Package package = project.Packages.Where(t => t.DisplayName == packageName).FirstOrDefault();
                if (package == null)
                {
                    Console.WriteLine("Package " + packageName + " does not exist in project " + project.ProjectName);
                    Environment.Exit(1);
                }

                packagesToExecute.Add(package);
            }

            foreach (Package package in packagesToExecute)
            {
                Task.Run(() => RunPackage(package, project.Connections, appInitializer.ModuleLoader.Modules, extraTypes)).Wait();
            }

            Console.WriteLine("\nExecution finished");
        }