New to Telerik JustMock? Download free 30-day trial

TFS 2012

The JustMock Code Activity Workflow for Team Foundation Server 2012 is designed to deploy your JustMock test projects to TFS 2012 with zero manual configurations for setting up your build environment.

It breaks you free from tedious configuration of environment variables and provides you simple options that can get you on the move in no time. In this topic we will focus on what are the required configuration steps when working with JustMock Code Activity Workflow for TFS 2012.


Be sure, you have referred to the Integrating Telerik JustMock in TFS 2010 Code Activity Workflow before continuing with the steps below.

Configuration steps

First, you need to point the custom assemblies folder that contains the Telerik.JustMock.Build.Workflow.VS2012.dll to your build controller.


The DLL is included in the JustMock installation directory under the Libraries folder.

Do this by editing your build controller properties. Go to Team Explorer, then Builds and from the Actions menu select Manage Build Controllers. You will be prompted with a dialog similar to the one below:

Manage Build Controllers: Select the controller and click TFS 2013 Code Activity Workflow Screen 1

Then you have to set:

  • The "Version control path to custom assemblies"

  • The property to the location of the folder containing the Telerik.JustMock.Build.Workflow.VS2012.dll.

Build Controller Properties: Here we have set the Version control path to custom assemblies: TFS 2013 Code Activity Workflow Screen 2

Continue by customizing the DefaultTemplate.11.1.xaml you wish to update. Follow the next steps:

  • Start by adding the the build precess template under Source Control in your project.

  • Then, open the Build Definition and in the Process tab > Build process template field, click New...

  • Browse the above build process template and select it as default to the project.

  • To edit the template, first check it out from Source Control.

  • Then, create new class library project (This will be a dummy project. Its only purpose is for editing the template. You don't need to add it to your solution or project collection) and refer the Telerik.JustMock.Build.Workflow.VS2012.dll.

  • Include the downloaded build process template in the class library project, using the Add as Link option.

  • Set its Build Action to None.

  • For the changes to take effect, later on you will need to save the "dummy" project and check-in the build process template.

Below is a screenshot of a section from the Default Template (DefaultTemplate.11.1.xaml):

DefaultTemplate.11.1.xaml): Inside the red square are the test execution activities. TFS 2013 Code Activity Workflow Screen 3-Old Temeplate

You need to wrap the Run Tests activity with the custom JustMockStart/JustMockStop activities from the Telerik.JustMock.Build.Workflow.VS2012.dll.

In order to drag/drop the JustMock activities to your build template, you have to add the assembly into your Toolbox pane. Do this by opening Tools > Choose Toolbox Items. Then, select Browse and point to the Telerik.JustMock.Build.Workflow.VS2012.dll in your custom assemblies folder (in this example: $/JustMockActivityWorkflowProject/Addons).

Choose Toolbox Items: Inside the red square are the custom JustMockStart/JustMockStop activities. TFS 2013 Code Activity Workflow Screen 4

After placing the JustMock activities, your template must look like this:

Final Default Template (DefaultTemplate.11.1.xaml) section: The red arrows show where the custom JustMockStart/JustMockStop activities must be placed. TFS 2013 Code Activity Workflow Screen 5-Old Template

Optionally, set the LinkProfilers parameter on JustMockStart to link 3rd party profilers, for example "Visual Studio 2012 Code Coverage/IntelliTrace". Multiple profilers can be specified by separating them with a semicolon. The names of the profilers must be specified exactly as they appear in the UI of the JustMock configuration tool. The files Telerik.JustMock.Configuration.exe and Telerik.JustMock.Configuration.exe.config must be present in the same folder as Telerik.JustMock.Build.Workflow.VS2012.dll. To unlink profilers, set the UnlinkProfilers parameter on JustMockStop.


Finally, save the "dummy" project and check-in the process template!

Once all is set, your JustMock tests that require profiler will work as expected.

Green JustMock tests: In the red square you can see the JustMockStart activity for the certain process, the actual test execution and the JustMockStop activity for the same process. TFS 2013 Code Activity Workflow Screen 6

See Also

In this article