High CPU

Dec 10, 2016 at 4:10 PM
When I run the following test, the CPU for the receive host hits 99% and stays there, anyone see where I've gone wrong?
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using BizUnit.Xaml;
using TransMock.Integration.BizUnit;
using BizUnit.TestSteps.ValidationSteps.Xml;
using BizUnit.TestSteps.Common;

namespace TransmockDemo1.IntegrationTests
{
    [TestClass]
    public class TriggeredBySqlWITHTransmock
    {

        [TestMethod]
        public void TestTriggeredBySqlWITHTransmock()
        {
            TestCase testCase = new TestCase();

            #region MockSendStep
            var sendQuestionStep = new MockSendStep()
            {
                Url = TransmockDemo1MockAddresses.RcvQuestion_SQL,
                Encoding = "UTF-8",
                RequestPath = "SQL_Question.xml",
                Timeout = 5

            };
            testCase.ExecutionSteps.Add(sendQuestionStep);
            #endregion

            #region XmlValidationStep
            SchemaDefinition wrapperSchema = new SchemaDefinition(){
                XmlSchemaNameSpace = @"http://transmockdemo1/",
                XmlSchemaPath = "ArithmeticService_transmockdemo1.xsd"
            };

            SchemaDefinition questionSchema = new SchemaDefinition()
            {
                XmlSchemaNameSpace = @"http://schemas.datacontract.org/2004/07/Transmock.Wcf",
                XmlSchemaPath = "ArithmeticService_schemas_datacontract_org_2004_07_Transmock_Wcf.xsd"
            };

            var validationStep = new XmlValidationStep();
            validationStep.XmlSchemas.Add(wrapperSchema);
            validationStep.XmlSchemas.Add(questionSchema);


            var xPathNum1 = new XPathDefinition()
            {
                XPath = "/*[local-name()='AddNumbers' and namespace-uri()='http://transmockdemo1/']/*[local-name()='qm' and namespace-uri()='http://transmockdemo1/']/*[local-name()='Number1' and namespace-uri()='http://schemas.datacontract.org/2004/07/Transmock.Wcf']",
                Value = "70"
            };

            validationStep.XPathValidations.Add(xPathNum1);
            #endregion

            #region MockRequestStep
            var receiveResultStep = new MockRequestResponseStep()
            {
                Url = TransmockDemo1MockAddresses.SendQuestion_WCF,
                Encoding = "UTF-8",
                ResponsePath = "Answer.xml",
                Timeout = 5
                
            };

            receiveResultStep.SubSteps.Add(validationStep);
            #endregion

            testCase.ExecutionSteps.Add(receiveResultStep);

            BizUnit.BizUnit testRunner = new BizUnit.BizUnit(testCase);

            testRunner.RunTest();


        }
    }
}
Coordinator
Dec 19, 2016 at 9:03 PM
Hi Rob, the test case looks fine. However i cannot see that you have defined where the files you are referirng in the RequestPath and ResponsePath properties repspectively will be taken from. Usually I utilize the DeploymentItem attribute to decorate the test method as described in the getting started guide.

Hope this was of help.
Take care,
Svetoslav