Пример #1
0
 public ExpectedTrace(ExpectedTrace expectedTrace)
 {
     this.Trace = TraceGroup.GetNewTraceGroup(expectedTrace.Trace);
     this.SortBeforeVerification = expectedTrace.SortBeforeVerification;
     this.Filters.AddRange(expectedTrace.Filters);
     CopyVerifyAndIgnoreTypes(expectedTrace);
 }
Пример #2
0
 public void CopyVerifyAndIgnoreTypes(ExpectedTrace expectedTrace)
 {
     _useVerifyTypes = expectedTrace._useVerifyTypes;
     _ignoreTypes    = new HashSet <String>(expectedTrace._ignoreTypes);
     _verifyTypes    = new HashSet <String>(expectedTrace._verifyTypes);
     _ignoredStates  = new HashSet <WorkflowInstanceState>(expectedTrace._ignoredStates);
 }
Пример #3
0
        public ExpectedTrace FilterExpectedTrace(ExpectedTrace et)
        {
            // This can be any combination of ordered/unordered traces, and we have to maintain that architecture

            // use copy constructor to maintain Expected traces' settings
            ExpectedTrace expectedTrace = new ExpectedTrace(et);

            // copy constructor will also copy of the expected traces, need to clear them
            expectedTrace.Trace = FilterTraceGroup(et.Trace);
            return(expectedTrace);
        }
Пример #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        public static void Validate(ActualTrace actualTrace, ExpectedTrace expectedTrace, bool traceTracking)
        {
            TraceValidator.s_actualTrace   = actualTrace;
            TraceValidator.s_expectedTrace = expectedTrace;

            TraceValidator.s_errorList  = new List <string>();
            TraceValidator.s_stepCounts = new Dictionary <string, StepCount>();

            TestTraceManager.OptionalLogTrace("[TraceValidator]Unfiltered expected trace:\n{0}", expectedTrace.ToString());
            TestTraceManager.OptionalLogTrace("[TraceValidator]Unfiltered actual trace:\n{0}", actualTrace.ToString());

            TraceValidator.NormalizeExpectedTrace(expectedTrace.Trace);
            TraceValidator.RemoveIgnorableSteps(expectedTrace.Trace);
            TraceValidator.PrepareExpectedTrace(expectedTrace.Trace, false, null, -1);

            TraceValidator.PrepareActualTrace();

            if (traceTracking)
            {
                //Log.TraceInternal("[TraceValidator]Filtered expected trace:\n{0}", expectedTrace.ToString());
                //Log.TraceInternal("[TraceValidator]Filtered actual trace:\n{0}", actualTrace.ToString());
                //Log.TraceInternal("[TraceValidator]Doing count validation...");
            }

            TraceValidator.CheckStepCounts();
            TraceValidator.CheckErrors();

            if (traceTracking)
            {
                //Log.TraceInternal("[TraceValidator]Validating...");
            }
            TraceValidator.ValidateFirst(expectedTrace.Trace, 0);
            TraceValidator.CheckErrors();

            if (traceTracking)
            {
                //Log.TraceInternal("[TraceValidator]ExpectedTrace: Validation complete.");
            }
        }
Пример #5
0
        public void Validate(ExpectedTrace expectedTrace, bool logTraces)
        {
            lock (_steps)
            {
                if (expectedTrace.SortBeforeVerification)
                {
                    // copy the expected trace, remove activity traces and verify workflow instnace traces
                    ExpectedTrace etrace = new ExpectedTrace(expectedTrace);
                    ActualTrace   atrace = new ActualTrace(this);
                    etrace.AddIgnoreTypes(typeof(ActivityTrace), typeof(UserTrace));
                    TraceValidator.Validate(atrace, etrace, logTraces);

                    // now verify the activity traces, after they have been ordered
                    expectedTrace.AddIgnoreTypes(typeof(WorkflowInstanceTrace));
                    expectedTrace.AddIgnoreTypes(typeof(UserTrace));
                    this.OrderTraces();
                    TraceValidator.Validate(this, expectedTrace);
                }
                else
                {
                    TraceValidator.Validate(this, expectedTrace, logTraces);
                }
            }
        }
Пример #6
0
 public void Validate(ExpectedTrace expectedTrace)
 {
     this.Validate(expectedTrace, true);
 }
Пример #7
0
 public static void Validate(ActualTrace actualTrace, ExpectedTrace expectedTrace)
 {
     Validate(actualTrace, expectedTrace, true);
 }