コード例 #1
0
        private void RecursiveProcessTask(FacadeTask task)
        {
            ProcessTask(task);

            foreach (FacadeTask child in task.Children)
                RecursiveProcessTask(child);
        }
コード例 #2
0
        public FacadeTaskWrapper(XmlElement element)
            : base(element)
        {
            string typeName = element.GetAttribute("facadeTaskType");

            facadeTask = (FacadeTask)Activator.CreateInstance(typeof(FacadeTask).Assembly.GetType(typeName), new object[] { element });
        }
コード例 #3
0
        /// <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]);
        }
コード例 #4
0
 /// <inheritdoc />
 public void TaskExplain(FacadeTask task, string explanation)
 {
     try
     {
         server.TaskExplain(GetRemoteTask(task), explanation);
     }
     catch (Exception ex)
     {
         throw ServerExceptionUtils.Wrap(ex);
     }
 }
コード例 #5
0
 /// <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);
     }
 }
コード例 #6
0
 /// <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);
     }
 }
コード例 #7
0
 /// <inheritdoc />
 public void TaskProgress(FacadeTask task, string message)
 {
     try
     {
         server.TaskProgress(GetRemoteTask(task), message);
     }
     catch (Exception ex)
     {
         throw ServerExceptionUtils.Wrap(ex);
     }
 }
コード例 #8
0
 /// <inheritdoc />
 public void TaskStarting(FacadeTask task)
 {
     try
     {
         server.TaskStarting(GetRemoteTask(task));
     }
     catch (Exception ex)
     {
         throw ServerExceptionUtils.Wrap(ex);
     }
 }
コード例 #9
0
        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
        }
コード例 #10
0
 /// <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);
     }
 }
コード例 #11
0
        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
        }
コード例 #12
0
        /// <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);
        }
コード例 #13
0
        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);
            }
        }
コード例 #14
0
        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));
        }
コード例 #15
0
        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;
            }
        }
コード例 #16
0
        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));
        }
コード例 #17
0
        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);
        }
コード例 #18
0
        /// <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];
        }
コード例 #19
0
        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);
            }
        }
コード例 #20
0
 /// <inheritdoc />
 public void TaskExplain(FacadeTask task, string explanation)
 {
     try
     {
         server.TaskExplain(GetRemoteTask(task), explanation);
     }
     catch (Exception ex)
     {
         throw ServerExceptionUtils.Wrap(ex);
     }
 }
コード例 #21
0
 internal FacadeTaskWrapper(FacadeTask facadeTask)
     : base(GallioTestProvider.ProviderId)
 {
     this.facadeTask = facadeTask;
 }
コード例 #22
0
 internal TestContainerFacadeTaskWrapper(FacadeTask facadeTask) : base(facadeTask) { }
コード例 #23
0
 /// <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);
     }
 }
コード例 #24
0
 /// <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);
     }
 }
コード例 #25
0
 /// <inheritdoc />
 public void TaskProgress(FacadeTask task, string message)
 {
     try
     {
         server.TaskProgress(GetRemoteTask(task), message);
     }
     catch (Exception ex)
     {
         throw ServerExceptionUtils.Wrap(ex);
     }
 }
コード例 #26
0
 internal TestContainerFacadeTaskWrapper(FacadeTask facadeTask) : base(facadeTask)
 {
 }
コード例 #27
0
 internal UnitTestFacadeTaskWrapper(FacadeTask facadeTask) : base(facadeTask) { }
コード例 #28
0
 /// <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);
     }
 }
コード例 #29
0
ファイル: FacadeTask.cs プロジェクト: dougrathbone/mbunit-v3
        /// <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);
        }
コード例 #30
0
 internal UnitTestFacadeTaskWrapper(FacadeTask facadeTask) : base(facadeTask)
 {
 }
コード例 #31
0
 public FacadeTaskResult Run(FacadeTask facadeTask)
 {
     RecursiveProcessTask(facadeTask);
     return RunTests();
 }
コード例 #32
0
 /// <inheritdoc />
 public void TaskStarting(FacadeTask task)
 {
     try
     {
         server.TaskStarting(GetRemoteTask(task));
     }
     catch (Exception ex)
     {
         throw ServerExceptionUtils.Wrap(ex);
     }
 }