예제 #1
0
            /// <summary>
            /// Clones the random states from parent scope and generates a new one for itself.
            /// Each time new scope is created, it is set as ts_lastCreatedScope on the current thread.
            /// </summary>
            internal Scope(RandomizerPool pool, IScope parent)
            {
                s_ts_lastCreatedScope = this;
                _previousScope        = s_ts_currentScope;
                s_ts_currentScope     = this;
                _pool = pool;

                RandomizerType current;

                _pool.CreateScopeRandomizer(parent, out _scopeStates, out current);

                // mark the scope as constructed
                _current = current;
            }
예제 #2
0
        public static void TestMain()
        {
            _operationCanceledErrorMessage = SystemDataResourceManager.Instance.SQL_OperationCancelled;
            _severeErrorMessage            = SystemDataResourceManager.Instance.SQL_SevereError;

            // pure random
            _randPool = new RandomizerPool();

            SqlConnectionStringBuilder regularConnectionString = new SqlConnectionStringBuilder();

            regularConnectionString.ConnectionString         = DataTestClass.SQL2008_Master;
            regularConnectionString.MultipleActiveResultSets = false;

            List <string> connStrings = new List <string>();

            connStrings.Add(regularConnectionString.ToString());

            connStrings.Add(regularConnectionString.ToString());

            regularConnectionString.MultipleActiveResultSets = true;
            connStrings.Add(regularConnectionString.ToString());

            _connectionStrings = connStrings.ToArray();

            _katmaiTypes = SqlRandomTypeInfoCollection.CreateSql2008Collection();
            _endEvent    = new ManualResetEvent(false);

            if (_randPool.ReproMode)
            {
                _runningThreads = 1;
                TestThread();
            }
            else
            {
                for (int tcount = 0; tcount < ThreadCountDefault; tcount++)
                {
                    Thread t = new Thread(TestThread);
                    t.Start();
                }
            }
        }