In the latest Isolator version (6.0.0) we improved an old feature – The Auto deploy.
In the past you had to install the Isolator at least once on the target machine in order to auto deploy the Isolator, this is no longer needed.
All you have to do is create a folder that will include the following files:
- TypeMock.dll
- Typemock.ArrangeActAssert.dll
- Typemock.Isolator.VisualBasic.dll
- Configuration.dll
- TypeMock.Configuration.exe
- TypeMock.MSBuild.dll or TypeMock.NAntBuild.dll
- TypeMock.MSBuild.Tasks (in case of using MSBuild)
- Typemock.Interceptors.dll
- typemockconfig.xml
- namespaces.dat
- exclude.dat
- MockWeaver.dll (see below for more info)
- ProfileLinker.dll (see below for more info)
Now use the TypeMockRegister task in your build script and set the AutoDeploy attribute to “true”.
This will let you run the tests with the Isolator enabled.
Example (MSBuild):
1 |
<span style="color:#0000ff;"><</span><span style="color:#800000;">Project</span> <span class="Apple-style-span" style="color:#FF0000;">xmlns</span><span style="color:#0000ff;">="http://schemas.microsoft.com/developer/msbuild/2003"</span><span style="color:#0000ff;">></span> |
1 |
<span style="color:#0000ff;"><</span><span style="color:#800000;">PropertyGroup</span><span style="color:#0000ff;">></span> |
1 |
<span style="color:#0000ff;"><</span><span style="color:#800000;">TypeMockLocation</span><span style="color:#0000ff;">></span>C:BuildIsolator<span style="color:#0000ff;"></</span><span style="color:#800000;">TypeMockLocation</span><span style="color:#0000ff;">></span> |
1 |
<span style="color:#0000ff;"><</span><span style="color:#800000;">NUNIT</span><span style="color:#0000ff;">></span>C:BuildNUnitnunit-console.exe<span style="color:#0000ff;"></</span><span style="color:#800000;">NUNIT</span><span style="color:#0000ff;">></span> |
1 |
<span style="color:#0000ff;"><</span><span style="color:#800000;">TestAssembly</span><span style="color:#0000ff;">></span>C:BuildTestsTests.dll<span style="color:#0000ff;"></</span><span style="color:#800000;">TestAssembly</span><span style="color:#0000ff;">></span> |
1 |
<span style="color:#0000ff;"></</span><span style="color:#800000;">PropertyGroup</span><span style="color:#0000ff;">></span> |
1 |
<span style="color:#0000ff;"><</span><span style="color:#800000;">Import</span> <span style="color:#ff0000;">Project</span> <span style="color:#0000ff;">="$(TypeMockLocation)TypeMock.MSBuild.Tasks"</span><span style="color:#0000ff;">/></span> |
1 |
<span style="color:#0000ff;"><</span><span style="color:#800000;">Target</span> <span style="color:#ff0000;">Name</span><span style="color:#0000ff;">="RegisterTypeMock"</span><span style="color:#0000ff;">></span> <span style="color:#0000ff;"><</span><span style="color:#800000;">TypeMockRegister</span> <span style="color:#ff0000;">Company</span> <span style="color:#0000ff;">="TypeMock"</span> <span style="color:#ff0000;">License</span><span style="color:#0000ff;">="XXX-XXX"</span> <span style="color:#ff0000;">AutoDeploy</span><span style="color:#0000ff;">="true"</span><span style="color:#0000ff;">/></span> |
1 |
<span style="color:#0000ff;"><</span><span style="color:#800000;">TypeMockStart</span><span style="color:#0000ff;">/></span> |
1 |
<span style="color:#0000ff;"><</span><span style="color:#800000;">Exec</span> <span style="color:#ff0000;">ContinueOnError</span><span style="color:#0000ff;">="false"</span> <span style="color:#ff0000;">Command</span><span style="color:#0000ff;">="$(NUNIT) $(TestAssembly)"</span><span style="color:#0000ff;">/></span> |
1 |
<span style="color:#0000ff;"><</span><span style="color:#800000;">TypeMockStop</span> <span style="color:#ff0000;">Undeploy</span><span style="color:#0000ff;">="true"</span><span style="color:#0000ff;">/></span> |
1 |
<span style="color:#0000ff;"></</span><span style="color:#800000;">Target</span><span style="color:#0000ff;">></span> |
1 |
<span style="color:#0000ff;"></</span><span style="color:#800000;">Project</span><span style="color:#0000ff;">></span> |
Changes in native assemblies placement
A note about placing the native assemblies (MockWeaver.dll and ProfileLinker.dll)
In the previous versions you had to place these assemblies in the same directory as the other assemblies this created extra work for users who needed to run tests in x64 and x86 machines. Those users had to copy the appropriate assemblies into the root directory before each run. This of course tend to confuse the users and lead to errors in the build script.
From version 6.0 of the Isolator this is no longer needed. You can create two directories – “x86” and “x64” under the root deployment directory and copy the native assemblies to those folders. This is the same directory structure as the standard installation of the Isolator.
The old mode is still supported for backwards compatibility so if you already have a build script that is working you don’t have to modify it.