本文整理汇总了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;
}
}
示例2: Eval
public override void Eval(Executor exec)
{
string s = exec.PopString();
Executor aux = new Executor(exec);
aux.Execute(s);
exec.Push(aux.GetStackAsList());
}
示例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);
}
示例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.
}
}
}
示例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");
}