Beispiel #1
0
        public static ProcessSettings CreateProcessSettings()
        {
            ProcessSettings settings = new ProcessSettings();

            string cscPath = ConfigurationManager.AppSettings["CscPath"];
            string nunitAssemblyPath = ConfigurationManager.AppSettings["NunitAssemblyPath"];
            string nunitConsolePath = ConfigurationManager.AppSettings["NunitConsolePath"];

            nunitAssemblyPath = RemoveTrailingSlashFromPath(nunitAssemblyPath);
            nunitConsolePath = RemoveTrailingSlashFromPath(nunitConsolePath);

            settings.CscPath = cscPath;
            settings.NunitAssemblyPath = nunitAssemblyPath;
            settings.NunitConsolePath = nunitConsolePath;
            settings.NunitTimeOut = int.Parse(ConfigurationManager.AppSettings["ProcessingTimeOut"]);

            settings.BaseResultPath = ConfigurationManager.AppSettings["ResultBasePath"];

            settings.PollingIntervalValue = ConfigurationManager.AppSettings["PollingInterval"];
            settings.ProcessingTimeOut = ConfigurationManager.AppSettings["ProcessingTimeOut"];

            settings.NunitTimeOut = 5000;
            settings.CleanUp = false;

            settings.SourcesPath = "";   //will be filled during the process
            settings.OutputPath = "";    //will be filled during the process
            settings.TestLogFileName = "testresult.xml";

            if (!settings.BaseResultPath.EndsWith(@"\"))
            {
                settings.BaseResultPath += @"\";
            }

            return settings;
        }
 public static ProcessStartInfo CreateTestProcessStartInfoNunit(ProcessSettings settings)
 {
     ProcessStartInfo startInfo = new ProcessStartInfo();
     startInfo.FileName = @"""" + settings.NunitConsolePath + @"""";
     startInfo.Arguments += " " + @"""" + Path.Combine(settings.OutputPath, "result.dll") + @"""";
     startInfo.Arguments += " /timeout=" + settings.NunitTimeOut.ToString();
     startInfo.Arguments += " /nologo";
     startInfo.Arguments += " /xml=" + @"""" +  settings.GetTestLogPath() + @"""";
     return startInfo;
 }
 public static ProcessStartInfo CreateCompileProcessStartInfo(ProcessSettings settings)
 {
     ProcessStartInfo startInfo = new ProcessStartInfo();
     startInfo.FileName = @"""" + settings.CscPath + @"""";
     startInfo.Arguments = "/out:" + @"""" + Path.Combine(settings.OutputPath, "result.dll") + @"""";
     startInfo.Arguments += " /nologo";
     startInfo.Arguments += " /lib:" + @"""" + settings.NunitAssemblyPath + @"""" + " /reference:NUnit.Framework.dll";
     startInfo.Arguments += " /target:library";
     startInfo.Arguments += " " + @"""" + Path.Combine(settings.SourcesPath,"*.cs") + @"""";
     return startInfo;
 }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            var logger = Substitute.For<ILogger>();
            var facade = Substitute.For<IBuildServiceFacade>();
            var filesys = new FileSystemWrapper();

            ProcessSettings processSettings = new ProcessSettings();
            processSettings.BaseResultPath = @"c:\mocs\";
            processSettings.NunitAssemblyPath = @"C:\Program Files\NUnit 2.5.9\bin\net-2.0\framework";
            processSettings.CscPath = @"C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe";
            processSettings.NunitConsolePath = @"C:\Program Files\NUnit 2.5.9\bin\net-2.0\nunit-console.exe";

            processSettings.SourcesPath = "";
            processSettings.OutputPath = "";
            processSettings.TestLogFileName = "testresult.xml";
            processSettings.NunitTimeOut = 5000;
            processSettings.CleanUp = true;

            processSettings.Assignment = CreateTestAssignment(facade);

            processSettings.Submit = CreateTestSubmit();
            processSettings.Submit.TournamentAssignment.Assignment = processSettings.Assignment;

            ServiceLocator services = ServiceLocator.Instance;
            services.AddService(typeof(IFileSystem), filesys);

            BaseProcess process = new MoCSValidationProcess(processSettings, filesys);
            ExecuteProcessResult result = process.Process();

            richTextBox1.Clear();
            if (result.Result == ExitCode.Success)
            {
                this.panel1.BackColor = Color.Green;
            }
            else
            {
                this.panel1.BackColor = Color.Red;
                richTextBox1.AppendText(result.Output);
            }
        }
Beispiel #5
0
        public ProcessSettings Clone()
        {
            ProcessSettings settings = new ProcessSettings();
            settings.CscPath = this.CscPath;
            settings.NunitAssemblyPath = this.NunitAssemblyPath;
            settings.NunitConsolePath = this.NunitConsolePath;
            settings.NunitTimeOut = this.NunitTimeOut;
            settings.BaseResultPath = this.BaseResultPath;
            settings.PollingIntervalValue = this.PollingIntervalValue;
            settings.ProcessingTimeOut = this.ProcessingTimeOut;
            settings.OutputPath = this.OutputPath;
            settings.CleanUp = this.CleanUp;
            settings.SourcesPath = this.SourcesPath;
            settings.TestLogFileName = this.TestLogFileName;

            return settings;
        }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the BaseProcess class
 /// </summary>
 /// <param name="settings"></param>
 public BaseProcess(ProcessSettings settings, IFileSystem fileSystem)
 {
     Settings = settings;
     FileSystem = fileSystem;
 }
Beispiel #7
0
 /// <summary>
 /// Initializes a new instance of the ContinuousIntegrationClientProcess for testing purposes
 /// </summary>
 /// <param name="settings"></param>
 /// <param name="fileSystem"></param>
 public MoCSValidationProcess(ProcessSettings settings, IFileSystem fileSystem, List<BaseProcess> processes)
     : base(settings, fileSystem)
 {
     _processes = processes;
     InitializeProcesses();
 }
Beispiel #8
0
 public MoCSValidationProcess(ProcessSettings settings, IFileSystem fileSystem)
     : base(settings, fileSystem)
 {
     InitializeProcesses();
 }
Beispiel #9
0
 public CleanUpProcess(ProcessSettings settings, IFileSystem fileSystem)
     : base(settings, fileSystem)
 {
 }
Beispiel #10
0
 public BootstrapProcess(ProcessSettings settings, IFileSystem fileSystem)
     : base(settings, fileSystem)
 {
 }
Beispiel #11
0
 public CompileProcess(ProcessSettings settings, IFileSystem fileSystem)
     : base(settings, fileSystem)
 {
 }
Beispiel #12
0
 public TestProcess(ProcessSettings settings, IFileSystem fileSystem)
     : base(settings, fileSystem)
 {
 }
 public BusinessValidationProcess(ProcessSettings settings, IFileSystem fileSystem)
     : base(settings, fileSystem)
 {
 }