Beispiel #1
0
        internal static LtmTestItem Wrap(TestItem item)
        {
            VariationTestItem vti = item as VariationTestItem;

            if (vti != null)
            {
                return(new LtmVariationTestItem(vti));
            }

            TestCase tc = item as TestCase;

            if (tc != null)
            {
                return(new LtmTestCaseItem(tc));
            }

            TestModule tm = item as TestModule;

            if (tm != null)
            {
                return(new LtmTestModuleItem(tm));
            }

            throw new TaupoNotSupportedException("Test item is not supported by LTM: " + item);
        }
        private void EnterState(CurrentState currentState)
        {
            lock (this.lockObject)
            {
                switch (currentState)
                {
                case CurrentState.Executing:
                    this.currentContext.CurrentState = currentState;

                    VariationTestItem vti = this.currentContext.TestItem as VariationTestItem;
                    if (vti != null)
                    {
                        var callback = this.CreateCallback();
                        if (vti.Timeout > 0)
                        {
                            callback.SetTimeout(vti.Timeout);
                        }

                        this.RunOnExecutionThread(() => vti.ExecuteAsync(callback));
                    }
                    else
                    {
                        this.ExecuteOnUIThread(this.OnSuccess);
                    }

                    break;

                case CurrentState.Terminating:
                {
                    this.currentContext.CurrentState = currentState;
                    var callback = this.CreateCallback();
                    this.currentContext.TestItem.TerminateAsync(callback);
                }

                break;
                }
            }
        }
 public LtmVariationTestItem(VariationTestItem item)
     : base(item)
 {
 }
Beispiel #4
0
 public LtmVariationTestItem(VariationTestItem item)
     : base(item)
 {
 }