New to Telerik JustMock? Download free 30-day trial

Cruise Control .NET

CruiseControl.NET is a free and open source software tool for automating software build processes. It targets the .NET environment. CruiseControl.NET (also known as "ccnet") uses pure XML in its config files where you can assemble tasks in order to build your project.

This article explains how the JustMock Runner is integrated inside the ccnet configuration file, so that it can execute the tests inside your solution.

You can learn more about CruiseControl.NET at their official website or sourceforge.

CruiseControl.NET and JustMock Runner

We will be using the Telerik.JustMock.CSExamples.VS2010.sln (found in the JustMock root folder under Examples) to show the process of integrating JustMock with Cruise Control.

To build the solution with ccnet we first have to add the appropriate entries inside the ccnet.config file, which can be found in the CruiseControl.Net root folder (ex: C:\Program Files (x86)\CruiseControl.NET\server).

Start by adding a new project, like the example below:

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
      <!-- This is your CruiseControl.NET Server Configuration file. Add your projects below! -->

      <workingDirectory>C:\Program Files (x86)\Telerik\JustMock\ExamplesNew</workingDirectory>

      <state type="state" directory="C:\Program Files (x86)\CruiseControl.NET\server\State" />

To check if the tests in your project are passing or failing you will need to add a publisher like this:

      <file>C:\Program Files (x86)\CruiseControl.NET\server\Log\ccnet.xml</file>
      <xmllogger />

After this we will add the tasks:


      <executable>C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\</executable>

      <executable>C:\Program Files (x86)\Telerik\JustMock\Libraries\JustMockRunner.exe</executable>
      <baseDirectory>C:\Program Files (x86)\Telerik\JustMock\Examples\Telerik.JustMock.Tests\bin\Debug</baseDirectory>
      <buildArgs>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe" /testcontainer:Telerik.JustMock.Tests.dll</buildArgs>


The first task is setting the path to Visual Studio ( and our solution file. The second is the task that actually executes the JustMock Runner.

Finally you will be able test if everything is working as expected.

  1. Open any browser and go to the following URL: http://localhost/ccnet/server/local/project/MyProjectWithJustMock/ViewProjectReport.aspx

    Cruise Control.NET 1

  2. Build your project and check if the tests in it have passed or failed.

    Cruise Control.NET 2

See Also

In this article