Example #1
0
        /// <summary>
        ///     Apply the failed expectation
        /// </summary>
        /// <param name="runner"></param>
        public override void Apply(Runner runner)
        {
            base.Apply(runner);

            Expect.State       = Expect.EventState.TimeOut;
            Expect.Explanation = Explanation;
            TimeLine.ActiveExpectations.Remove(Expect);
            ElementLog = Expect.Expectation.AddError(Message, true);
        }
        /// <summary>
        ///     Redirects errors applied to this to the appropriate structure in MergedStructures
        /// </summary>
        /// <param name="message"></param>
        /// <param name="failedExpectation"></param>
        /// <returns></returns>
        public ElementLog AddError(string message, bool failedExpectation)
        {
            ElementLog retVal = new ElementLog(ElementLog.LevelEnum.Error, message);
            retVal.FailedExpectation = failedExpectation;

            // Get the appropriate structure to add the error

            AddElementLog(retVal);
            return retVal;
        }
Example #3
0
        /// <summary>
        ///     Adds a new element log attached to this model element
        /// </summary>
        /// <param name="log"></param>
        public override void AddElementLog(ElementLog log)
        {
            StateMachine unifiStateMachine = UnifiedStateMachine;

            if (unifiStateMachine != null && unifiStateMachine != this)
            {
                unifiStateMachine.AddElementLog(log);
            }
            else
            {
                base.AddElementLog(log);
            }
        }
Example #4
0
            public override void visit(BaseModelElement obj, bool visitSubNodes)
            {
                foreach (ElementLog log in obj.Messages)
                {
                    if (log.Level == ElementLog.LevelEnum.Error)
                    {
                        ErrorMessageFound = log;
                        break;
                    }
                }

                if (ErrorMessageFound == null)
                {
                    base.visit(obj, visitSubNodes);
                }
            }
Example #5
0
        /// <summary>
        ///     Adds a new element log attached to this model element
        /// </summary>
        /// <param name="log"></param>
        public override void AddElementLog(ElementLog log)
        {
            bool add = true;

            foreach (ElementLog other in base.Messages)
            {
                if (other.CompareTo(log) == 0)
                {
                    add = false;
                }
            }

            if (add)
            {
                base.Messages.Add(log);
            }
        }
Example #6
0
        /// <summary>
        ///     Adds a new element log attached to this model element
        /// </summary>
        /// <param name="log"></param>
        public override void AddElementLog(ElementLog log)
        {
            if (!BeSilent)
            {
                Parameter enclosingParameter = EnclosingFinder <Parameter> .find(this);

                if (enclosingParameter != null)
                {
                    log.Log = "In " + FullName + ":" + log.Log;
                    enclosingParameter.AddElementLog(log);
                }
                else
                {
                    base.AddElementLog(log);
                    EFSSystem.Context.HandleInfoMessageChangeEvent(this);
                }
            }
        }
        public void SetMessage(ElementLog log)
        {
            MessageDetailTextBox.Text = log.Log;

            string caption = "";
            switch (log.Level)
            {
                case ElementLog.LevelEnum.Error:
                    caption = "Error found";
                    break;
                case ElementLog.LevelEnum.Warning:
                    caption = "Warning found";
                    break;
                case ElementLog.LevelEnum.Info:
                    caption = "Informative message found";
                    break;
            }
            Text = caption;
        }
Example #8
0
        public void SetMessage(ElementLog log)
        {
            MessageDetailTextBox.Text = log.Log;

            string caption = "";

            switch (log.Level)
            {
            case ElementLog.LevelEnum.Error:
                caption = "Error found";
                break;

            case ElementLog.LevelEnum.Warning:
                caption = "Warning found";
                break;

            case ElementLog.LevelEnum.Info:
                caption = "Informative message found";
                break;
            }
            Text = caption;
        }
Example #9
0
 public override void AddElementLog(ElementLog log)
 {
     if (Enclosing is NameSpace)
     {
         base.AddElementLog(log);
     }
     else
     {
         IEnclosed current = Enclosing as IEnclosed;
         while (current != null)
         {
             ModelElement element = current as ModelElement;
             if (element != null)
             {
                 element.AddElementLog(log);
                 current = null;
             }
             else
             {
                 current = current.Enclosing as IEnclosed;
             }
         }
     }
 }
Example #10
0
        /// <summary>
        ///     Adds a new element log attached to this model element
        /// </summary>
        /// <param name="log"></param>
        public override void AddElementLog(ElementLog log)
        {
            bool add = true;

            foreach (ElementLog other in base.Messages)
            {
                if (other.CompareTo(log) == 0)
                {
                    add = false;
                }
            }

            if (add)
            {
                base.Messages.Add(log);
            }
        }
Example #11
0
 public override void AddElementLog(ElementLog log)
 {
     if (Enclosing is NameSpace)
     {
         base.AddElementLog(log);
     }
     else
     {
         IEnclosed current = Enclosing as IEnclosed;
         while (current != null)
         {
             ModelElement element = current as ModelElement;
             if (element != null)
             {
                 element.AddElementLog(log);
                 current = null;
             }
             else
             {
                 current = current.Enclosing as IEnclosed;
             }
         }
     }
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="elementLog"></param>
 public MessageEntry(ElementLog elementLog)
 {
     Log = elementLog;
 }
 /// <summary>
 ///     Adds a new element log attached to this model element
 /// </summary>
 /// <param name="log"></param>
 public override void AddElementLog(ElementLog log)
 {
     StateMachine unifiStateMachine = UnifiedStateMachine;
     if (unifiStateMachine != null && unifiStateMachine != this)
     {
         unifiStateMachine.AddElementLog(log);
     }
     else
     {
         base.AddElementLog(log);
     }
 }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="id"></param>
 public ModelInterpretationFailure(ElementLog log, INamable instance, acceptor.RulePriority? priority)
     : base(log.Log, instance, priority)
 {
     Log = log;
 }
Example #15
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="elementLog"></param>
 public MessageEntry(ElementLog elementLog)
 {
     Log = elementLog;
 }
        /// <summary>
        ///     Apply the failed expectation
        /// </summary>
        /// <param name="runner"></param>
        public override void Apply(Runner runner)
        {
            base.Apply(runner);

            Expect.State = Expect.EventState.TimeOut;
            Expect.Explanation = Explanation;
            TimeLine.ActiveExpectations.Remove(Expect);
            ElementLog = Expect.Expectation.AddError(Message, true);
        }
            public override void visit(BaseModelElement obj, bool visitSubNodes)
            {
                foreach (ElementLog log in obj.Messages)
                {
                    if (log.Level == ElementLog.LevelEnum.Error)
                    {
                        ErrorMessageFound = log;
                        break;
                    }
                }

                if (ErrorMessageFound == null)
                {
                    base.visit(obj, visitSubNodes);
                }
            }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="id"></param>
 public ModelInterpretationFailure(ElementLog log, INamable instance, acceptor.RulePriority?priority)
     : base(log.Log, instance, priority)
 {
     Log = log;
 }