New to Telerik JustMock? Download free 30-day trial

TFS 2013

The JustMock Code Activity Workflow for Team Foundation Server 2013 is designed to deploy your JustMock test projects to TFS 2013 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 2013.

Important

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

Steps for Integrating Justmock in New Build Configurations (TfvcTemplate.12.xaml)

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

    Note

    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.VS2013.dll.

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

  2. Continue by customizing the Default Template (TfvcTemplate.12.xaml) of your team project. If you are new to TFS, follow the next steps in order to download and access your build process template:

    • Open your Build Definition and navigate to the Process tab.

    • Click the Show details button in the Build process template field and Download the Default Template (TfvcTemplate.12.xaml). You should save it somewhere in the current projects repository.

    • Then, add the downloaded precess template under Source Control in your project.

    • Open your Build Definition again 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.VS2013.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 (TfvcTemplate.12.xaml):

    Default Template (TfvcTemplate.12.xaml) section: Inside the red square is the test execution activity. TFS 2013 Code Activity Workflow Screen 3

    You need to wrap the Run VS Test Runner activity with the custom JustMockStart/JustMockStop activities from the Telerik.JustMock.Build.Workflow.VS2013.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.VS2013.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 (TfvcTemplate.12.xaml) section: The red arrows show where the custom JustMockStart/JustMockStop activities must be placed. TFS 2013 Code Activity Workflow Screen 5

    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.VS2013.dll. To unlink profilers, set the UnlinkProfilers parameter on JustMockStop.

    Important

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

  3. 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

Steps for Integrating Justmock in Updated Build Configurations (DefaultTemplate.11.1.xaml)

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

    Note

    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.VS2013.dll.

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

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

    • Start by adding 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.VS2013.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.VS2013.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.VS2013.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.VS2013.dll. To unlink profilers, set the UnlinkProfilers parameter on JustMockStop.

    Important

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

  3. 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