当前位置: 首页>>代码示例>>C#>>正文


C# Util.ProcessInfo类代码示例

本文整理汇总了C#中ThoughtWorks.CruiseControl.Core.Util.ProcessInfo的典型用法代码示例。如果您正苦于以下问题:C# ProcessInfo类的具体用法?C# ProcessInfo怎么用?C# ProcessInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ProcessInfo类属于ThoughtWorks.CruiseControl.Core.Util命名空间,在下文中一共展示了ProcessInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateProcessInfo

        /// <summary>
        /// Creates the process info.	
        /// </summary>
        /// <param name="p4">The p4.</param>
        /// <param name="extraArguments">The extra arguments.</param>
        /// <returns></returns>
        /// <remarks></remarks>
		public ProcessInfo CreateProcessInfo(P4 p4, string extraArguments)
		{
			ProcessInfo processInfo = new ProcessInfo(p4.Executable, BuildCommonArguments(p4) + extraArguments);
			processInfo.TimeOut = 0; // Don't time out - this should be configurable
            processInfo.WorkingDirectory = p4.WorkingDirectory;
			return processInfo;
		}
开发者ID:BiYiTuan,项目名称:CruiseControl.NET,代码行数:14,代码来源:P4ConfigProcessInfoCreator.cs

示例2: CreateHistoryProcessInfo

 public ProcessInfo CreateHistoryProcessInfo(DateTime from, DateTime to)
 {
     string fromDate = from.ToString(DATETIME_FORMAT);
     string args = CreateHistoryArguments(fromDate);
     Log.Debug(string.Format("cleartool commandline: {0} {1}", Executable, args));
     ProcessInfo processInfo = new ProcessInfo(Executable, args);
     return processInfo;
 }
开发者ID:vardars,项目名称:ci-factory,代码行数:8,代码来源:ClearCase.cs

示例3: NewProcessInfo

        private ProcessInfo NewProcessInfo(string outputFile, IIntegrationResult result)
        {
            string args = new NUnitArgument(Assemblies, outputFile).ToString();
            Log.Debug(string.Format("Running unit tests: {0} {1}", NUnitPath, args));

            ProcessInfo info = new ProcessInfo(NUnitPath, args, result.WorkingDirectory);
            info.TimeOut = Timeout * 1000;
            return info;
        }
开发者ID:vardars,项目名称:ci-factory,代码行数:9,代码来源:NUnitTask.cs

示例4: Execute

        /// <summary>
        ///     Replaces all ASCII bell characters (0x07) (^G) with a space
        ///     character.  Certain ccm.exe commands emit a bell, which cannot
        ///     be disabled.  The CCNET XML parser disallows this reserved character.
        /// </summary>
        /// <param name="processInfo">The process to run.</param>
        /// <returns>
        ///     Sanitized standard output and input.
        /// </returns>
        public override ProcessResult Execute(ProcessInfo processInfo)
        {
            char bell = (char) 0x07;
            char empty = ' ';

            ProcessResult retVal = base.Execute(processInfo);
            string standardOutput = retVal.StandardOutput.Replace(bell, empty);
            string standardError = retVal.StandardError.Replace(bell, empty);
            return new ProcessResult(standardOutput, standardError, retVal.ExitCode, retVal.TimedOut);
        }
开发者ID:vardars,项目名称:ci-factory,代码行数:19,代码来源:SynergyProcessExecutor.cs

示例5: AttemptToExecute

 protected ProcessResult AttemptToExecute(ProcessInfo info)
 {
     try
     {
         return executor.Execute(info);
     }
     catch (Exception e)
     {
         throw new BuilderException(this, string.Format("Unable to execute: {0}\n{1}", info, e), e);
     }
 }
开发者ID:vardars,项目名称:ci-factory,代码行数:11,代码来源:ExecutableTask.cs

示例6: RunSvnProcess

        public static ProcessResult RunSvnProcess(SvnOptions svnLoginOptions, ProcessArgumentBuilder argBuilder)
        {
            argBuilder.AddArgument("--non-interactive");
            argBuilder.AddArgument("--no-auth-cache");

            ProcessInfo info = new ProcessInfo("svn.exe", argBuilder.ToString());

            ProcessExecutor executor = new ProcessExecutor();
            ProcessResult result = executor.Execute(info);
            return result;
        }
开发者ID:nfrey,项目名称:qreal,代码行数:11,代码来源:SvnProcessHelper.cs

示例7: ExecuteNUnitConsoleAndRetrieveResultsFromFile

		public void ExecuteNUnitConsoleAndRetrieveResultsFromFile()
		{
		    string args = string.Format(@"/xml={0} /nologo foo.dll", GeneratePath("{0}", task.OutputFile));
		    ProcessInfo info = new ProcessInfo(NUnitConsolePath, args, WORKING_DIRECTORY);
			info.TimeOut = NUnitTask.DefaultTimeout * 1000;
			executorMock.ExpectAndReturn("Execute", new ProcessResult("", String.Empty, 0, false), new object[] { info });

			task.Run(result);

			Assert.AreEqual("foo", result.TaskOutput);
			executorMock.Verify();
		}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:12,代码来源:NUnitTaskExecutionTest.cs

示例8: DeleteDirectoryWithLongPath

        /// <summary>
        /// Deletes a directory on Windows with a commandline call.
        /// 
        /// Reason:
        /// .NET only supports filenames up to 260 characters long for backwards compability
        /// read more at: http://blogs.msdn.com/bclteam/archive/2007/02/13/long-paths-in-net-part-1-of-3-kim-hamilton.aspx
        /// this is a Windows only limitation
        /// </summary>
        /// <param name="path">Path to delete.</param>
        static void DeleteDirectoryWithLongPath(string path)
        {
            Log.Info("[IoService] Try running 'cmd.exe /C RD /S /Q' to delete '{0}'", path);

            // call a commandline delete as fallback
            var executor = new ProcessExecutor();
            var processInfo = new ProcessInfo("cmd.exe",
                string.Concat("/C RD /S /Q ", StringUtil.AutoDoubleQuoteString(path)));

            var pr = executor.Execute(processInfo);
            if (pr.Failed)
                throw new CruiseControlException(string.Format("Unable to delete path '{0}'.", path));
        }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:22,代码来源:IoService.cs

示例9: ShouldGetSourceIfAutoGetSourceTrue

		public void ShouldGetSourceIfAutoGetSourceTrue()
		{
			DynamicMock executor = new DynamicMock(typeof(ProcessExecutor));
			AccuRev accurev = new AccuRev((ProcessExecutor) executor.MockInstance);
			accurev.AutoGetSource = true;

			ProcessInfo expectedProcessRequest = new ProcessInfo("accurev.exe", "update");
			expectedProcessRequest.TimeOut = Timeout.DefaultTimeout.Millis;

			executor.ExpectAndReturn("Execute", new ProcessResult("foo", null, 0, false), expectedProcessRequest);
			accurev.GetSource(new IntegrationResult());
			executor.Verify();
		}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:13,代码来源:AccuRevTest.cs

示例10: Execute

 public IHgResult Execute(HgArguments hgArguments)
 {
     if (hgArguments == null)
     {
         throw new ArgumentNullException("hgArguments");
     }
     _processExecutor.ProcessOutput += HandleProcessOutput;
     try
     {
         var processInfo = new ProcessInfo("hg", hgArguments.ToString());
         var result = _processExecutor.Execute(processInfo);
         return new CruiseControlHgResult(result);
     }
     finally
     {
         _processExecutor.ProcessOutput -= HandleProcessOutput;
     }
 }
开发者ID:davidsidlinger,项目名称:ccnet-hg-nosuck,代码行数:18,代码来源:CruiseControlHgProcess.cs

示例11: ShouldDeleteClientSpecAndWorkingDirectoryOnPurge

		public void ShouldDeleteClientSpecAndWorkingDirectoryOnPurge()
		{
			// Setup
			DynamicMock p4Mock = new DynamicMock(typeof(P4));
			P4 p4 = (P4) p4Mock.MockInstance;
			p4.Client = "myClient";

			ProcessInfo processInfo = new ProcessInfo("deleteclient");
			processInfoCreatorMock.ExpectAndReturn("CreateProcessInfo", processInfo, p4, "client -d myClient");
			processExecutorMock.ExpectAndReturn("Execute", new ProcessResult("", "", 0, false), processInfo);

			Assert.IsTrue(Directory.Exists(tempDirPath));

			// Execute
			p4Purger.Purge(p4, tempDirPath);

			// Verify
			Assert.IsFalse(Directory.Exists(tempDirPath));
			VerifyAll();
		}
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:20,代码来源:ProessP4PurgerTest.cs

示例12: Execute

        protected ProcessResult Execute(ProcessInfo processInfo)
        {
            processInfo.TimeOut = Timeout.Millis;
            ProcessResult result = executor.Execute(processInfo);

            if (result.TimedOut)
            {
                throw new CruiseControlException("Source control operation has timed out.");
            }
            else if (result.Failed)
            {
                throw new CruiseControlException(string.Format("Source control operation failed: {0}. Process command: {1} {2}",
                                                               result.StandardError, processInfo.FileName, processInfo.Arguments));
            }
            else if (result.HasErrorOutput)
            {
                Log.Warning(string.Format("Source control wrote output to stderr: {0}", result.StandardError));
            }
            return result;
        }
开发者ID:vardars,项目名称:ci-factory,代码行数:20,代码来源:ProcessSourceControl.cs

示例13: ExecuteCommand

        private ProcessResult ExecuteCommand(IIntegrationResult result, 
            string command, params string[] args)
        {
            var buffer = new PrivateArguments(command);
            buffer.Add(this.Source);
            foreach (var arg in args)
            {
                buffer.Add(string.Empty,
                    arg,
                    true);
            }

            var executable = string.IsNullOrEmpty(this.Executable) ?
                "GetMyCode" : this.Executable;
            var processInfo = new ProcessInfo(
                result.BaseFromWorkingDirectory(executable),
                buffer,
                result.WorkingDirectory);
            var processResult = this.Execute(processInfo);
            return processResult;
        }
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:21,代码来源:GetMyCodeSourceControl.cs

示例14: Execute

        public override ProcessResult Execute(ProcessInfo processInfo)
        {
            if (processInfo == null)
            {
                throw new ArgumentNullException("processInfo");
            }

            var complete = false;

            var process = processInfo.CreateProcess();
            var outputBuilder = new StringBuilder();
            var errorBuilder = new StringBuilder();
            process.EnableRaisingEvents = true;
            process.Exited += (sender, args) => { complete = true; };
            process.Start();
            while (!complete)
            {
                outputBuilder.Append(process.StandardOutput.ReadToEnd());
                errorBuilder.Append(process.StandardError.ReadToEnd());
            }
            return new ProcessResult(outputBuilder.ToString(), errorBuilder.ToString(), process.ExitCode, false);
        }
开发者ID:davidsidlinger,项目名称:ccnet-hg-nosuck,代码行数:22,代码来源:TestProcessExecutor.cs

示例15: CreatesAClientWithConstructedClientNameIfOneNotSpecifiedAndSavesClientNameInConfig

        public void CreatesAClientWithConstructedClientNameIfOneNotSpecifiedAndSavesClientNameInConfig()
        {
            // Setup
            P4 p4 = new P4();
            p4.View = "//mydepot/...";
            string projectName = "myProject";

            string expectedClientName = string.Format("CCNet-{0}-{1}", Dns.GetHostName(), projectName);

            ProcessInfo processInfo = new ProcessInfo("createclient");
            ProcessInfo processInfoWithStdInContent = new ProcessInfo("createclient");
            processInfoWithStdInContent.StandardInputContent = string.Format("Client: {0}\n\nRoot:   c:\\my\\working\\dir\n\nView:\n //mydepot/... //{0}/mydepot/...\n", expectedClientName);

            processInfoCreatorMock.ExpectAndReturn("CreateProcessInfo", processInfo, p4, "client -i");
            processExecutorMock.ExpectAndReturn("Execute", new ProcessResult("", "", 0, false), processInfoWithStdInContent);

            // Execute
            p4Initializer.Initialize(p4, projectName, @"c:\my\working\dir");

            // Verify
            Assert.AreEqual(expectedClientName, p4.Client);
            VerifyAll();
        }
开发者ID:derrills1,项目名称:ccnet_gitmode,代码行数:23,代码来源:ProcessP4InitializerTest.cs


注:本文中的ThoughtWorks.CruiseControl.Core.Util.ProcessInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。