1
Vote

BizUnit Assembly Path are correct type: Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileCreateStep,FileCreateStep

description

I am trying to create bizunit using as below config file

<TestCase testName="2">
<TestSetup>
  <TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileDeleteMultipleStep">
    <Directory>\..\..\TestProject2\TestFile\testfiles\</Directory>
        <SearchPattern>*.xml</SearchPattern>
     </TestStep>
</TestSetup>
<TestExecution>
  <TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileCreateStep">
  <SourcePath>\..\..\TestProject2\TestFile\testfiles\TestFile1.xml</SourcePath>
        <CreationPath>C:\Users\apatel\Documents\Visual Studio 2010\Projects\TestProject2\TestProject2\TestFile\infile\TransactionId_%Guid%.xml</CreationPath>  
  </TestStep>
  <TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileValidateStep">
     <Timeout>3000</Timeout>
     <Directory>..\..\..\TestFile\infile\</Directory>
     <SearchPattern>TransactionId_*.xml</SearchPattern>
     <DeleteFile>true</DeleteFile>

        <ValidationStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.XmlValidationStep">
            <XmlSchemaPath>\..\..\TestProject2\BizTalkTest1\Schema\Dest.xsd</XmlSchemaPath>
            <XmlSchemaNameSpace>http://SimpleProj/Outbound</XmlSchemaNameSpace>
            <XPathList>
                <XPathValidation query="/*[local-name()='Dest' and namespace-uri()='http://SimpleProj/Outbound']/*[local-name()='Name' and namespace-uri()='']">TestTest1</XPathValidation>
            </XPathList>
        </ValidationStep>   
  </TestStep>
</TestExecution>
<!-- Test cleanup: test cases should always leave the system in the state they found it --> <TestCleanup>
  <TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileDeleteMultipleStep">
     <Directory>..\..\..\TestData\</Directory>
     <SearchPattern>*.xml</SearchPattern> 
  </TestStep>
  <TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileDeleteMultipleStep">
     <Directory>..\..\..\Rec_03\</Directory>
     <SearchPattern>*.xml</SearchPattern> 
  </TestStep>
</TestCleanup>
</TestCase>

I got Error

Info: Adding context property: BizUnitTestCaseStartTime, value: 3/25/2015 3:18:21 PM

Setup Stage: started @ 15:18:21.062 25/03/2015

Error: Exception caught!
System.ArgumentException: The test step could not be created, check the test step type and assembly path are correct, type: Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileDeleteMultipleStep, assembly path:
at BizUnit.BizUnitOM.BizUnitTestStepWrapper..ctor(XmlNode stepConfig) in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnitOM\BizUnitTestStepWrapper.cs:line 47
at BizUnit.BizUnit.ExecuteSteps(XmlNodeList steps, TestStage stage) in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnit.cs:line 1278
at BizUnit.BizUnit.Setup() in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnit.cs:line 1170

Setup Stage: ended @ 15:18:21.065 25/03/2015 with ERROR's

Test method TestProject2.UnitTest1.TestMethod1 threw exception:
System.ArgumentException: The test step could not be created, check the test step type and assembly path are correct, type: Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileDeleteMultipleStep, assembly path:
at BizUnit.BizUnitOM.BizUnitTestStepWrapper..ctor(XmlNode stepConfig) in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnitOM\BizUnitTestStepWrapper.cs: line 47
at BizUnit.BizUnit.ExecuteSteps(XmlNodeList steps, TestStage stage) in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnit.cs: line 1278
at BizUnit.BizUnit.Setup() in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnit.cs: line 1176
at BizUnit.BizUnit.RunLegacyTestInternal() in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnit.cs: line 1014
at BizUnit.BizUnit.RunTest() in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnit.cs: line 1004
at TestProject2.UnitTest1.TestMethod1() in UnitTest1.cs: line 23

so I follow https://bizunit.codeplex.com/discussions/61280

<TestCase testName="2">
<TestSetup>
  <TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileDeleteMultipleStep,Version=2.2.1003.0.0, Culture=neutral, PublicKeyToken=7eb7d82981ae5162">
    <Directory>\..\..\TestProject2\TestFile\testfiles\</Directory>
        <SearchPattern>*.xml</SearchPattern>
     </TestStep>
</TestSetup>
<TestExecution>
  <TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileCreateStep">
  <SourcePath>\..\..\TestProject2\TestFile\testfiles\TestFile1.xml</SourcePath>
        <CreationPath>C:\Users\apatel\Documents\Visual Studio 2010\Projects\TestProject2\TestProject2\TestFile\infile\TransactionId_%Guid%.xml</CreationPath>  
  </TestStep>
  <TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileValidateStep">
     <Timeout>3000</Timeout>
     <Directory>..\..\..\TestFile\infile\</Directory>
     <SearchPattern>TransactionId_*.xml</SearchPattern>
     <DeleteFile>true</DeleteFile>

        <ValidationStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.XmlValidationStep">
            <XmlSchemaPath>\..\..\TestProject2\BizTalkTest1\Schema\Dest.xsd</XmlSchemaPath>
            <XmlSchemaNameSpace>http://SimpleProj/Outbound</XmlSchemaNameSpace>
            <XPathList>
                <XPathValidation query="/*[local-name()='Dest' and namespace-uri()='http://SimpleProj/Outbound']/*[local-name()='Name' and namespace-uri()='']">TestTest1</XPathValidation>
            </XPathList>
        </ValidationStep>   
  </TestStep>
</TestExecution>
<!-- Test cleanup: test cases should always leave the system in the state they found it --> <TestCleanup>
  <TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileDeleteMultipleStep">
     <Directory>..\..\..\TestData\</Directory>
     <SearchPattern>*.xml</SearchPattern> 
  </TestStep>
  <TestStep assemblyPath="" typeName="Microsoft.Services.BizTalkApplicationFramework.BizUnit.FileDeleteMultipleStep">
     <Directory>..\..\..\Rec_03\</Directory>
     <SearchPattern>*.xml</SearchPattern> 
  </TestStep>
</TestCleanup>
</TestCase>

Got Error
Setup Stage: started @ 15:19:42.905 25/03/2015

Error: Exception caught!
System.IO.FileLoadException: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName)
at BizUnit.ObjectCreator.CreateStep(String typeName, String assemblyPath) in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\ObjectCreator.cs:line 34
at BizUnit.BizUnitOM.BizUnitTestStepWrapper..ctor(XmlNode stepConfig) in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnitOM\BizUnitTestStepWrapper.cs:line 42
at BizUnit.BizUnit.ExecuteSteps(XmlNodeList steps, TestStage stage) in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnit.cs:line 1278
at BizUnit.BizUnit.Setup() in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnit.cs:line 1170

Setup Stage: ended @ 15:19:42.906 25/03/2015 with ERROR's

Test method TestProject2.UnitTest1.TestMethod1 threw exception:
System.IO.FileLoadException: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, ref StackCrawlMark stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, ref StackCrawlMark stackMark)
at System.Type.GetType(String typeName)
at BizUnit.ObjectCreator.CreateStep(String typeName, String assemblyPath) in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\ObjectCreator.cs: line 34
at BizUnit.BizUnitOM.BizUnitTestStepWrapper..ctor(XmlNode stepConfig) in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnitOM\BizUnitTestStepWrapper.cs: line 42
at BizUnit.BizUnit.ExecuteSteps(XmlNodeList steps, TestStage stage) in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnit.cs: line 1278
at BizUnit.BizUnit.Setup() in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnit.cs: line 1176
at BizUnit.BizUnit.RunLegacyTestInternal() in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnit.cs: line 1014
at BizUnit.BizUnit.RunTest() in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnit.cs: line 1004
at TestProject2.UnitTest1.TestMethod1()

comments