private void RecursiveProcessTask(FacadeTask task) { ProcessTask(task); foreach (FacadeTask child in task.Children) RecursiveProcessTask(child); }
public FacadeTaskWrapper(XmlElement element) : base(element) { string typeName = element.GetAttribute("facadeTaskType"); facadeTask = (FacadeTask)Activator.CreateInstance(typeof(FacadeTask).Assembly.GetType(typeName), new object[] { element }); }
/// <summary> /// Gets the remote task that corresponds to a particular facade task. /// </summary> /// <param name="task">The facade task.</param> /// <returns>The corresponding remote task.</returns> public RemoteTask GetRemoteTask(FacadeTask task) { if (task == null) { throw new ArgumentNullException("task"); } return(remoteTasks[task.RemoteTaskHandle]); }
/// <inheritdoc /> public void TaskExplain(FacadeTask task, string explanation) { try { server.TaskExplain(GetRemoteTask(task), explanation); } catch (Exception ex) { throw ServerExceptionUtils.Wrap(ex); } }
/// <inheritdoc /> public void TaskFinished(FacadeTask task, string message, FacadeTaskResult result) { try { server.TaskFinished(GetRemoteTask(task), message, FacadeUtils.ToTaskResult(result)); } catch (Exception ex) { throw ServerExceptionUtils.Wrap(ex); } }
/// <inheritdoc /> public void TaskOutput(FacadeTask task, string text, FacadeTaskOutputType outputType) { try { server.TaskOutput(GetRemoteTask(task), text, FacadeUtils.ToTaskOutputType(outputType)); } catch (Exception ex) { throw ServerExceptionUtils.Wrap(ex); } }
/// <inheritdoc /> public void TaskProgress(FacadeTask task, string message) { try { server.TaskProgress(GetRemoteTask(task), message); } catch (Exception ex) { throw ServerExceptionUtils.Wrap(ex); } }
/// <inheritdoc /> public void TaskStarting(FacadeTask task) { try { server.TaskStarting(GetRemoteTask(task)); } catch (Exception ex) { throw ServerExceptionUtils.Wrap(ex); } }
private static RemoteTask CreateTestTask(GallioTestElement element, FacadeTask facadeTask) { #if RESHARPER_51 if (element.IsTestCase) { return(new UnitTestFacadeTaskWrapper(facadeTask)); } return(new TestContainerFacadeTaskWrapper(facadeTask)); #else return(new FacadeTaskWrapper(facadeTask)); #endif }
/// <inheritdoc /> public void TaskException(FacadeTask task, FacadeTaskException[] exceptions) { try { TaskException[] nativeExceptions = Array.ConvertAll <FacadeTaskException, TaskException>(exceptions, FacadeUtils.ToTaskException); server.TaskException(GetRemoteTask(task), nativeExceptions); } catch (Exception ex) { throw ServerExceptionUtils.Wrap(ex); } }
private static RemoteTask CreateTestTask(GallioTestElement element, FacadeTask facadeTask) { #if RESHARPER_51 if (element.IsTestCase) { return new UnitTestFacadeTaskWrapper(facadeTask); } return new TestContainerFacadeTaskWrapper(facadeTask); #else return new FacadeTaskWrapper(facadeTask); #endif }
/// <summary> /// Adds a child task. /// </summary> /// <param name="child">The child task.</param> public void AddChild(FacadeTask child) { if (child == null) { throw new ArgumentNullException("child"); } if (children == null) { children = new List <FacadeTask>(); } children.Add(child); }
public FacadeTaskResult Execute(IFacadeTaskServer facadeTaskServer, IFacadeLogger facadeLogger, FacadeTask facadeTask, FacadeTaskExecutorConfiguration facadeTaskExecutorConfiguration) { ILogger logger = new FacadeLoggerWrapper(facadeLogger); try { RuntimeAccessor.Instance.AddLogListener(logger); return facadeTask.Execute(facadeTaskServer, facadeLogger, facadeTaskExecutorConfiguration); } finally { RuntimeAccessor.Instance.RemoveLogListener(logger); } }
sealed public override void ExecuteRecursive(TaskExecutionNode node) { AdapterFacadeTaskServer facadeTaskServer = new AdapterFacadeTaskServer(Server); AdapterFacadeLogger facadeLogger = new AdapterFacadeLogger(); FacadeTaskExecutorConfiguration facadeTaskExecutorConfiguration = new FacadeTaskExecutorConfiguration() { ShadowCopy = TaskExecutor.Configuration.ShadowCopy, AssemblyFolder = TaskExecutor.Configuration.AssemblyFolder }; FacadeTask facadeTask = facadeTaskServer.MapTasks(node); executeResult = FacadeUtils.ToTaskResult(Execute(facadeTaskServer, facadeLogger, facadeTask, facadeTaskExecutorConfiguration)); }
private void ProcessTask(FacadeTask task) { var itemTask = task as GallioTestItemTask; if (itemTask != null) { testTasks[itemTask.TestId] = itemTask; return; } var assemblyTask = task as GallioTestAssemblyTask; if (assemblyTask != null) { assemblyLocations.Add(assemblyTask.AssemblyLocation); return; } var explicitTask = task as GallioTestExplicitTask; if (explicitTask != null) { explicitTestIds.Add(explicitTask.TestId); return; } }
protected virtual FacadeTaskResult Execute(IFacadeTaskServer facadeTaskServer, IFacadeLogger facadeLogger, FacadeTask facadeTask, FacadeTaskExecutorConfiguration facadeTaskExecutorConfiguration) { IIsolatedEnvironment environment = SharedEnvironmentManager.GetSharedEnvironment(); Type taskRunnerType = typeof(RemoteFacadeTaskRunner); IRemoteFacadeTaskRunner taskRunner = (IRemoteFacadeTaskRunner)environment.AppDomain.CreateInstanceAndUnwrap( taskRunnerType.Assembly.FullName, taskRunnerType.FullName); return(taskRunner.Execute(facadeTaskServer, facadeLogger, facadeTask, facadeTaskExecutorConfiguration)); }
protected virtual FacadeTaskResult Execute(IFacadeTaskServer facadeTaskServer, IFacadeLogger facadeLogger, FacadeTask facadeTask, FacadeTaskExecutorConfiguration facadeTaskExecutorConfiguration) { IIsolatedEnvironment environment = SharedEnvironmentManager.GetSharedEnvironment(); Type taskRunnerType = typeof(RemoteFacadeTaskRunner); IRemoteFacadeTaskRunner taskRunner = (IRemoteFacadeTaskRunner)environment.AppDomain.CreateInstanceAndUnwrap( taskRunnerType.Assembly.FullName, taskRunnerType.FullName); return taskRunner.Execute(facadeTaskServer, facadeLogger, facadeTask, facadeTaskExecutorConfiguration); }
/// <summary> /// Gets the remote task that corresponds to a particular facade task. /// </summary> /// <param name="task">The facade task.</param> /// <returns>The corresponding remote task.</returns> public RemoteTask GetRemoteTask(FacadeTask task) { if (task == null) throw new ArgumentNullException("task"); return remoteTasks[task.RemoteTaskHandle]; }
public FacadeTaskResult Execute(IFacadeTaskServer facadeTaskServer, IFacadeLogger facadeLogger, FacadeTask facadeTask, FacadeTaskExecutorConfiguration facadeTaskExecutorConfiguration) { ILogger logger = new FacadeLoggerWrapper(facadeLogger); try { RuntimeAccessor.Instance.AddLogListener(logger); return(facadeTask.Execute(facadeTaskServer, facadeLogger, facadeTaskExecutorConfiguration)); } finally { RuntimeAccessor.Instance.RemoveLogListener(logger); } }
internal FacadeTaskWrapper(FacadeTask facadeTask) : base(GallioTestProvider.ProviderId) { this.facadeTask = facadeTask; }
internal TestContainerFacadeTaskWrapper(FacadeTask facadeTask) : base(facadeTask) { }
internal UnitTestFacadeTaskWrapper(FacadeTask facadeTask) : base(facadeTask) { }
/// <inheritdoc /> public void TaskException(FacadeTask task, FacadeTaskException[] exceptions) { try { TaskException[] nativeExceptions = Array.ConvertAll<FacadeTaskException, TaskException>(exceptions, FacadeUtils.ToTaskException); server.TaskException(GetRemoteTask(task), nativeExceptions); } catch (Exception ex) { throw ServerExceptionUtils.Wrap(ex); } }
/// <summary> /// Adds a child task. /// </summary> /// <param name="child">The child task.</param> public void AddChild(FacadeTask child) { if (child == null) throw new ArgumentNullException("child"); if (children == null) children = new List<FacadeTask>(); children.Add(child); }
public FacadeTaskResult Run(FacadeTask facadeTask) { RecursiveProcessTask(facadeTask); return RunTests(); }