예제 #1
0
        private void runAssertionThreading(ConfigurationEngineDefaults.ThreadingProfile threadingProfile)
        {
            _concatNode = new ExprConcatNode();
            var textA = "This is the first text";
            var textB = "Second text";
            var textC = "Third text, some more";

            foreach (var text in new[] { textA, textB, textC })
            {
                _concatNode.AddChildNode(new ExprConstantNodeImpl(text));
            }
            _concatNode.Validate(ExprValidationContextFactory.MakeEmpty(threadingProfile));

            var numThreads = 4;
            var numLoop    = 10000;

            var threads = new List <SupportConcatThread>(numThreads);

            for (var i = 0; i < numThreads; i++)
            {
                var thread = new SupportConcatThread(_concatNode, numLoop, textA + textB + textC);
                threads.Add(thread);
                thread.Start();
            }

            foreach (var thread in threads)
            {
                thread.Join();
                Assert.IsFalse(thread.IsFail);
            }
        }
예제 #2
0
 public SupportConcatThread(ExprConcatNode node, int numLoop, string expectedResult)
 {
     _node           = node;
     _numLoop        = numLoop;
     _expectedResult = expectedResult;
     _thread         = new Thread(Run);
 }
예제 #3
0
 public void TestToExpressionString()
 {
     _concatNode = new ExprConcatNode();
     _concatNode.AddChildNode(new SupportExprNode("a"));
     _concatNode.AddChildNode(new SupportExprNode("b"));
     Assert.AreEqual("\"a\"||\"b\"", _concatNode.ToExpressionStringMinPrecedenceSafe());
     _concatNode.AddChildNode(new SupportExprNode("c"));
     Assert.AreEqual("\"a\"||\"b\"||\"c\"", _concatNode.ToExpressionStringMinPrecedenceSafe());
 }
예제 #4
0
 public void QExprConcat(ExprConcatNode exprConcatNode)
 {
 }
예제 #5
0
 public void SetUp()
 {
     _concatNode = new ExprConcatNode();
 }