public static TaskException[] ConvertExceptions(ExceptionResult exception, out string message) { ExceptionResult current; if ((exception.FullTypeName == typeof(TargetInvocationException).FullName) && (exception.InnerExceptionResult != null)) { current = exception.InnerExceptionResult; } else { current = exception; } message = null; var exceptions = new List<TaskException>(); while (current != null) { if (message == null) { message = string.Format("{0}: {1}", current.FullTypeName, current.Message); } exceptions.Add(new TaskException(current.FullTypeName, current.Message, current.StackTrace)); current = current.InnerExceptionResult; } return exceptions.ToArray(); }
public ExceptionResult(Exception exception) : this(exception.GetType().FullName, exception.GetType().Name, exception.Message, exception.StackTrace, null) { if (exception.InnerException != null) { InnerExceptionResult = new ExceptionResult(exception.InnerException); } }
public ExceptionResult(string fullTypeName, string typeName, string message, string stackTrace, ExceptionResult innerExceptionResult) { this.FullTypeName = fullTypeName; this.TypeName = typeName; this.Message = message; this.StackTrace = stackTrace; this.InnerExceptionResult = innerExceptionResult; }
public ExceptionResult(string fullTypeName, string typeName, string message, string stackTrace, ExceptionResult innerExceptionResult) { FullTypeName = fullTypeName; TypeName = typeName; Message = message; StackTrace = stackTrace; InnerExceptionResult = innerExceptionResult; }
public IMessage SyncProcessMessage(IMessage msg) { var methodCall = msg as IMethodCallMessage; if (methodCall != null) { return(RemotingServices.ExecuteMessage(this, methodCall)); } // This is all a bit ugly but gives us version independance for the moment string value = msg.Properties["data"] as string; var doc = XDocument.Load(new StringReader(value)); var element = doc.XPathSelectElement("/listener/*"); var listener = (ISpecificationRunListener)this; switch (element.Name.ToString()) { case "onassemblystart": listener.OnAssemblyStart(AssemblyInfo.Parse(element.XPathSelectElement("//onassemblystart/*").ToString())); break; case "onassemblyend": listener.OnAssemblyEnd(AssemblyInfo.Parse(element.XPathSelectElement("//onassemblyend/*").ToString())); break; case "onrunstart": listener.OnRunStart(); break; case "onrunend": listener.OnRunEnd(); break; case "oncontextstart": listener.OnContextStart(ContextInfo.Parse(element.XPathSelectElement("//oncontextstart/*").ToString())); break; case "oncontextend": listener.OnContextEnd(ContextInfo.Parse(element.XPathSelectElement("//oncontextend/*").ToString())); break; case "onspecificationstart": listener.OnSpecificationStart(SpecificationInfo.Parse(element.XPathSelectElement("//onspecificationstart/*").ToString())); break; case "onspecificationend": listener.OnSpecificationEnd( SpecificationInfo.Parse(element.XPathSelectElement("//onspecificationend/specificationinfo").ToString()), Result.Parse(element.XPathSelectElement("//onspecificationend/result").ToString())); break; case "onfatalerror": listener.OnFatalError(ExceptionResult.Parse(element.XPathSelectElement("//onfatalerror/*").ToString())); break; } return(null); }
public static void Run(this ISpecificationRunListener adapter, AssemblyInfo assemblyInfo, SpecificationInfo specificationInfo, Result failure, ExceptionResult exceptionResult, ContextInfo contexInfo) { adapter.OnAssemblyStart(assemblyInfo); adapter.OnAssemblyEnd(assemblyInfo); adapter.OnSpecificationStart(specificationInfo); adapter.OnSpecificationEnd(specificationInfo, failure); adapter.OnFatalError(exceptionResult); adapter.OnContextStart(contexInfo); adapter.OnContextEnd(contexInfo); adapter.OnRunStart(); adapter.OnRunEnd(); }
public static Result Parse(string resultXml) { var document = XDocument.Parse(resultXml); var status = document.SafeGet <Status>("/result/status"); var result = new Result(status); var exceptionresult = document.XPathSelectElement("/result/exception/exceptionresult"); if (exceptionresult != null) { result.Exception = ExceptionResult.Parse(exceptionresult.ToString()); } foreach (XElement supplement in document.XPathSelectElements("/result/supplements/supplement")) { string key = supplement.Attribute("key").Value; Dictionary <string, string> supplements = supplement.Elements("entry").ToDictionary(x => x.Attribute("key").Value, x => x.Value); result.Supplements.Add(key, supplements); } return(result); }
public static Result Failure(ExceptionResult exception) { return(new Result(exception)); }
public virtual void OnFatalError(ExceptionResult exceptionResult) { _runListener.OnFatalError(exceptionResult); }
public void OnFatalError(ExceptionResult exception) { }
public void OnFatalError(ExceptionResult exceptionResult) { fatalError = exceptionResult; }
public void OnFatalError(ExceptionResult exception) { _reporter.OnFatalError(exception); _onFinished.Invoke(this); }
public void OnFatalError(ExceptionResult exception) { LastFatalError = exception; }
public void OnFatalError(ExceptionResult exceptionResult) { listeners.Each(listener => listener.OnFatalError(exceptionResult)); }
private Result(Exception exception) { Status = Status.Failing; Exception = new ExceptionResult(exception); }
private Result(ExceptionResult exception) { _status = Status.Failing; this.Exception = exception; }
private Result(ExceptionResult exception) { Status = Status.Failing; Exception = exception; }
public void OnFatalError(ExceptionResult exceptionResult) { this.listeners.Each(listener => listener.OnFatalError(exceptionResult)); }