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


C# Executor.Execute方法代码示例

本文整理汇总了C#中Executor.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# Executor.Execute方法的具体用法?C# Executor.Execute怎么用?C# Executor.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Executor的用法示例。


在下文中一共展示了Executor.Execute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

 public override ICommand Execute()
 {
     using (Executor executor = new Executor(this))
     {
         executor.Execute();
         return this;
     }
 }
开发者ID:node-net,项目名称:Node.Net,代码行数:8,代码来源:ConsoleCommand.cs

示例2: Eval

            public override void Eval(Executor exec)
            {
                string s = exec.PopString();

                Executor aux = new Executor(exec);
                aux.Execute(s);
                exec.Push(aux.GetStackAsList());
            }
开发者ID:catb0t,项目名称:cat-language,代码行数:8,代码来源:CatPrimitives.cs

示例3: Execute

        public bool Execute(IDbConnectionProvider conn, MigrationResources resources)
        {
            _logger.Debug("Initialize database versioner");
            var versioner = new Versioner(conn, new Logger<Version>());

            _logger.Debug("Initialize executor");
            var executor = new Executor(conn, versioner, new Logger<Executor>());

            _logger.Debug("Execute migrations");
            return executor.Execute(resources);
        }
开发者ID:skimur,项目名称:skimur,代码行数:11,代码来源:MigrationEngine.cs

示例4: RunSession

        public TestOutcome RunSession(ITestContext assemblyTestContext, MSTestAssembly assemblyTest,
            ITestCommand assemblyTestCommand, TestStep parentTestStep, IProgressMonitor progressMonitor)
        {
            DirectoryInfo tempDir = SpecialPathPolicy.For("MSTestAdapter").CreateTempDirectoryWithUniqueName();
            try
            {
                // Set the test results path.  Among other things, the test results path
                // will determine where the deployed test files go.
                string testResultsPath = Path.Combine(tempDir.FullName, "tests.trx");

                // Set the test results root directory.
                // This path determines both where MSTest searches for test files which
                // is used to resolve relative paths to test files in the "*.vsmdi" file.
                string searchPathRoot = Path.GetDirectoryName(assemblyTest.AssemblyFilePath);

                // Set the test metadata and run config paths.  These are just temporary
                // files that can go anywhere on the filesystem.  It happens to be convenient
                // to store them in the same temporary directory as the test results.
                string testMetadataPath = Path.Combine(tempDir.FullName, "tests.vsmdi");
                string runConfigPath = Path.Combine(tempDir.FullName, "tests.runconfig");

                progressMonitor.SetStatus("Generating test metadata file.");
                CreateTestMetadataFile(testMetadataPath,
                    GetTestsFromCommands(assemblyTestCommand.PreOrderTraversal), assemblyTest.AssemblyFilePath);

                progressMonitor.SetStatus("Generating run config file.");
                CreateRunConfigFile(runConfigPath);

                progressMonitor.SetStatus("Executing tests.");
                Executor executor = new Executor(this, assemblyTestContext, assemblyTestCommand);
                TestOutcome outcome = executor.Execute(testMetadataPath, testResultsPath,
                    runConfigPath, searchPathRoot);
                return outcome;
            }
            finally
            {
                try
                {
                    tempDir.Delete(true);
                }
                catch
                {
                    // Ignore I/O exceptions deleting temporary files.
                    // They will probably be deleted by the OS later on during a file cleanup.
                }
            }
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:47,代码来源:MSTestRunner.cs

示例5: Ordered_tasks_are_executed_serially

        public void Ordered_tasks_are_executed_serially()
        {
            var taskQueueSettings = new QueuedExecutorSettings{Name = "test"};
            var taskQueue = new QueuedExecutor(taskQueueSettings, NullPersister.Instance);
            var matcher = new NamespaceMatcher(taskQueue.Name, NamespaceMatcher.AnyWildCard);
            var taskRouter = new TaskRouter(matcher, new IExecutorImplementation[]{taskQueue });
            var dispatcher = new TaskDispatcher(2, new IExecutionQueue[] {taskQueue});
            var executor = new Executor(taskRouter, dispatcher, new DefaultReleaser());

            var tasks = Enumerable.Range(1, 2).Select(x => new LongRunningTask(true) {Name = "Task" + x}).ToArray();

            foreach (var task in tasks)
            {
                executor.Execute(task);
            }

            Assert.That(tasks[0].WaitForStart(1000), Is.True, "First task should start");

            Assert.That(tasks[1].WaitForStart(1000), Is.False, "Second task should not start");
        }
开发者ID:Codestellation,项目名称:DarkFlow,代码行数:20,代码来源:ExecutorTests.cs


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