Geeks With Blogs

News View Michael Stephenson's profile on BizTalk Blog Doc View Michael Stephenson's profile on LinkedIn
Michael Stephenson keeping your feet on premise while your heads in the cloud

Continuing the series of articles on testing in BizTalk, this time I am going to talk about our approach to testing pipelines.

The traditional way to testing pipelines was to use the pipeline.exe tool in the BizTalk SDK.  This allows you to use various ways to call this command line tool to execute your pipeline.  The key points of this tool are as follows:

  • It is a command line tool so is a bit fiddly to call from a C# test but can be done by using the Process object
  • It takes input and output documents so you can validate what comes out of the pipeline
  • It is awkward to interact with the message context from your test

Pipeline.exe allows you to test, but is best suited to standalone or manual tests and is not easily integrated in a test driven or agile approach.

Preferred Approach

 Again as usual the aims of the approach are as follows:

  • The tests should be simple to develop and maintain
  • They should be automated and fit into a continuous integration process
  • We want to test the component before using it in BizTalk

In my preferred approach I like to use the Pipeline Component Test Library to help me execute the pipelines.  This is a very similar approach to how I test pipeline components and it also uses the same library.  The key difference is that when testing pipeline components I create an empty pipeline in code to execute my component in, where as when testing pipelines I tell the Pipeline Component Library to create a PipelineWrapper object based on my pipeline artifact.

The following picture shows the code sample from my test:

The key points of the sample are:

  • My tests project makes a reference to the project containing my pipelines so I can use the .net types which are compiled from my .btp files
  • I have full access to the IBaseMessage objects to interrogate the output from the pipeline
  • I can use the helper features of the Pipeline Component Test Library to help create my IBaseMessage input instance
  • The code required to execute the pipeline is very simple

The sample showing this technique is available below




Posted on Sunday, March 30, 2008 12:16 AM BizTalk , BizTalk Testing | Back to top

Comments on this post: BizTalk Testing Series - Testing Pipelines

# re: BizTalk Testing Series - Testing Pipelines
Requesting Gravatar...

Thanks for the great articles! If you get any news on NServiceBus adapters for Biztalk, please let me know :)
Left by Romiko on Aug 06, 2010 12:04 AM

# re: BizTalk Testing Series - Testing Pipelines
Requesting Gravatar...
nice post
Left by rajni on Jan 06, 2011 12:10 AM

Your comment:
 (will show your gravatar)

Copyright © Michael Stephenson | Powered by: