Exemple #1
0
        public void TraceBindingError(BindingException ex)
        {
            if (CurrentScenario != null)
            {
                Status = Status.Failed;

                var request = new FinishTestItemRequest
                {
                    Status  = Status.Failed,
                    EndTime = DateTime.UtcNow.AddMilliseconds(1),
                    Issue   = new Issue
                    {
                        Type    = IssueType.AutomationBug,
                        Comment = ex.Message
                    }
                };

                var errorRequest = new AddLogItemRequest
                {
                    Level = LogLevel.Error,
                    Time  = DateTime.UtcNow.AddMilliseconds(1),
                    Text  = ex.ToString()
                };
                CurrentScenario.Log(errorRequest);

                if (BeforeStepFinished != null)
                {
                    BeforeStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request, null));
                }
                if (AfterStepFinished != null)
                {
                    AfterStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request, null));
                }
            }
        }
Exemple #2
0
 public void TraceBindingError(BindingException ex)
 {
     log.Trace(MethodBase.GetCurrentMethod().Name);
     if (ReportFileInstance.CurrentStep != null)
     {
         ReportFileInstance.CurrentStep.Status             = TestResultStatus.Skipped;
         ReportFileInstance.CurrentStep.ErrorMessageString = ex.ToString();
         //
         ReportFileInstance.WriteToXml(TestResultsDirectory);
     }
     ReportFileInstance.CurrentStep = null;
 }
Exemple #3
0
    static bool ShowInternal(Exception e)
    {
        BindingException mte   = (e as BindingException);
        bool             error = true;

        if (mte != null)
        {
            error = mte.Error;

            if (!error && GetWarningLevel(mte.Code) == WarningLevel.Disable)
            {
                return(false);
            }

            Console.Out.WriteLine(mte.ToString());

            if (Verbosity > 1)
            {
                Exception ie = e.InnerException;
                if (ie != null)
                {
                    if (Verbosity > 3)
                    {
                        Console.Error.WriteLine("--- inner exception");
                        Console.Error.WriteLine(ie);
                        Console.Error.WriteLine("---");
                    }
                    else
                    {
                        Console.Error.WriteLine("\t{0}", ie.Message);
                    }
                }
            }

            if (Verbosity > 2)
            {
                Console.Error.WriteLine(e.StackTrace);
            }
        }
        else
        {
            Console.Out.WriteLine("error BI0000: Unexpected error - Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new");
            Console.Out.WriteLine(e.ToString());
            Console.Out.WriteLine(Environment.StackTrace);
        }
        return(error);
    }
Exemple #4
0
    static bool ShowInternal(Exception e)
    {
        BindingException mte   = (e as BindingException);
        bool             error = true;

        if (mte != null)
        {
            error = mte.Error;
            Console.Out.WriteLine(mte.ToString());

            if (Verbosity > 1)
            {
                Exception ie = e.InnerException;
                if (ie != null)
                {
                    if (Verbosity > 3)
                    {
                        Console.Error.WriteLine("--- inner exception");
                        Console.Error.WriteLine(ie);
                        Console.Error.WriteLine("---");
                    }
                    else
                    {
                        Console.Error.WriteLine("\t{0}", ie.Message);
                    }
                }
            }

            if (Verbosity > 2)
            {
                Console.Error.WriteLine(e.StackTrace);
            }
        }
        else
        {
            Console.Out.WriteLine("error BI0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com");
            Console.Out.WriteLine(e.ToString());
            Console.Out.WriteLine(Environment.StackTrace);
        }
        return(error);
    }
Exemple #5
0
        public void TraceBindingError(BindingException ex)
        {
            if (CurrentStepId != null)
            {
                var request = new FinishTestItemRequest
                {
                    Status  = Status.Failed,
                    EndTime = DateTime.UtcNow,
                    Issue   = new Issue
                    {
                        Type    = IssueType.AutomationBug,
                        Comment = ex.Message
                    }
                };

                var errorRequest = new AddLogItemRequest
                {
                    TestItemId = CurrentStepId,
                    Level      = LogLevel.Error,
                    Time       = DateTime.UtcNow,
                    Text       = ex.ToString()
                };
                Bridge.Service.AddLogItem(errorRequest);

                if (BeforeStepFinished != null)
                {
                    BeforeStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request));
                }
                var message = Bridge.Service.FinishTestItem(CurrentStepId, request).Info;
                if (AfterStepFinished != null)
                {
                    AfterStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request, message));
                }

                CurrentStepId         = null;
                Bridge.Context.TestId = null;
            }
        }