BizTalk Testing Guidance – Revisited

I’ve updated my BizTalk Testing Guidance with some new articles based on what we learned today about BizTalk 2009. Please find the latest index below:

Title

Link

Introduction

http://geekswithblogs.net/michaelstephenson/archive/2008/03/30/120849.aspx

Testing Schemas

http://geekswithblogs.net/michaelstephenson/archive/2008/03/30/120850.aspx

Testing Maps

http://geekswithblogs.net/michaelstephenson/archive/2008/03/30/120851.aspx

Testing Pipeline Components

http://geekswithblogs.net/michaelstephenson/archive/2008/03/30/120852.aspx

Testing Pipelines

http://geekswithblogs.net/michaelstephenson/archive/2008/03/30/120853.aspx

Testing Orchestrations

http://geekswithblogs.net/michaelstephenson/archive/2008/03/30/120854.aspx

Testing .net Components

http://geekswithblogs.net/michaelstephenson/archive/2008/03/30/120855.aspx

Testing Schemas with BizTalk 2009

http://geekswithblogs.net/michaelstephenson/archive/2008/12/12/127825.aspx

Testing Maps with BizTalk 2009

http://geekswithblogs.net/michaelstephenson/archive/2008/12/12/127826.aspx

Testing Pipelines and Pipeline Components with BizTalk 2009

http://geekswithblogs.net/michaelstephenson/archive/2008/12/12/127827.aspx

BizTalk Testing Series – Testing Pipelines and Pipeline Components in BizTalk 2009

A while back in my series of articles about testing with BizTalk I covered a technique for testing pipelines and pipeline components. The background to the approach is still valid in BizTalk 2009, but the technique is improved. To review the previous article refer to the following link:

Pipeline Components – http://geekswithblogs.net/michaelstephenson/archive/2008/03/30/120852.aspx

Pipelines – http://geekswithblogs.net/michaelstephenson/archive/2008/03/30/120853.aspx

In this post although we could do testing of pipelines and pipelines components using the excellent pipeline component test library. While that component is excellent for testing, I think the new model provides a simpler option and to be honest with Pipeline Component Test Library it sometimes took a little bit of fiddling with setting up the pipeline wrappers to get your test to work. My gut feeling is that the new approach will just be that bit more straightforward.

I will extend on the sample from the previous post about testing schemas. So our solution now looks like the below picture containing a pipeline

  1. Configure your BizTalk Project for Tests

Just to reiterate this step from the previous post you need to ensure the enable unit testing property is set for the BizTalk project.

  1. Adding references to your test assembly

Again reiterating this step, in your test project you will need to add a couple of references, the main one is the new Microsoft.BizTalk.TestTools assembly which is in the Visual Studio Add Reference list. This will allow you to use these new testing features. You would also need to add references to the pipeline assemblies highlighted in the below picture

  1. The test code

In the below code you can see that I will construct an instance of the TestableReceivePipeline which is what my custom receive pipeline will derive from. I can then provide documents and schema information and then execute my pipeline. Unfortunately the documentation of these objects doesn’t seem to be complete in the initial CTP so Im guessing there are a few more ways you can configure these objects, but they will give you an easy way to test send and receive pipelines.

  1. What about Pipeline Components

In the Pipeline Component Test Library there was the ability to be able to construct a pipeline wrapper in code so you could simulate adding your custom pipeline component to different types of pipeline. I’m not sure that you can do this in the new features of BizTalk 2009, however you can just create a pipeline artefact and add your component to that. The other cool feature is you might not (haven’t tried this) even have to add a new project for the BizTalk artefact as you can have BizTalk and C# files in the same project.

Summary

As you can see this new technique appears like it will be a simpler way to encourage testing.

The sample for this demo is available at the following location: http://www.box.net/shared/7rb81bcxsm

If you have problems accessing it then let me know.

BizTalk Testing Series – Testing Maps in BizTalk 2009

A while back in my series of articles about testing with BizTalk I covered a technique for testing maps. The background to the approach is still valid in BizTalk 2009, but the technique is improved. To review the previous article refer to the following link:

http://geekswithblogs.net/michaelstephenson/archive/2008/03/30/120851.aspx

In this post although we could do testing of maps, to be honest it was a little bit of a pain. In the newly released BizTalk 2009 CTP there have been some improvements in how you can do some of the testing and I would like to demonstrate this. I will walk through the steps to test your schema.

I will extend on the sample from the previous post about testing schemas. So our solution now looks like the below picture containing an additional schema and a new map.

  1. Configure your BizTalk Project for Tests

Just to reiterate this step from the previous post you need to ensure the enable unit testing property is set for the BizTalk project.

  1. Adding references to your test assembly

Again reiterating this step, in your test project you will need to add a couple of references, the main one is the new Microsoft.BizTalk.TestTools assembly which is in the Visual Studio Add Reference list. This will allow you to use these new testing features.

  1. The test code

In the below picture you can see that I am doing two things. The first is that I create an instance of the new TestableMapBase class which my map derives from. I can use this to execute my map by passing the details of an input file. The results are written to the output file.

I’m also using the schema validation to confirm that the message is valid that comes out. I think there are also properties of the TestableMapBase object which can do this.

In practice when I use this technique I will probably execute the map with a known input file and then compare the results of the output file with a predefined example output file so rather than just validating the schema I’m actually also ensuring the content is exactly as expected. You can do this with a binary comparison of the file.

Summary

As you can see this new technique just simplifies what we had been doing in BizTalk 2006 R2 and is a very nice interface to support this testing.

The sample for this demo is available at the following location: http://www.box.net/shared/yro0poto3m

If you have problems accessing it then let me know.

BizTalk Testing Series – Testing Schema in BizTalk 2009

A while back in my series of articles about testing with BizTalk I covered a technique for testing schema. The background to the approach is still valid in BizTalk 2009, but the technique is improved. To review the previous article refer to the following link:

http://geekswithblogs.net/michaelstephenson/archive/2008/03/30/120850.aspx

In the newly released BizTalk 2009 CTP there have been some improvements in how you can do some of the testing and I would like to demonstrate this. I will walk through the steps to test your schema.

Before I go into the details, we start with a simple project with two projects. The first is a BizTalk project with a schema and the second is a C# test project. The following steps need to be taken to setup your tests

  1. Configure your BizTalk Project for Tests

The first step is to open the properties for your new BizTalk project. If you go to the Deployment section you can see highlighted in the below picture the setting which will turn on the generation of some additional code to allow you to test BizTalk artefacts.

  1. Adding references to your test assembly

In your test project you will need to add a couple of references, the main one is the new Microsoft.BizTalk.TestTools assembly which is in the Visual Studio Add Reference list. This will allow you to use these new testing features.

  1. The test code

The following code snippet shows how you can create an instance of your schema which derives from the new TestableSchemaBase object. This has the new ValidateInstance method which allows you to pass in the path to a file containing the message you wish to validate.

Summary

As you can see this new technique just simplifies what we had been doing in BizTalk 2006 R2 and is a very nice interface to support this testing.

The sample for this demo is available at the following location: http://www.box.net/shared/2ojysf5ys3

If you have problems accessing it then let me know.

Screencast: Configuring bindings

Screencast: Configuring bindings

In this WCF screencast, I'll show you how to configure bindings on your WCF endpoints, which will allow you to customize the precise communication details you wish to support on your WCF services.

configuring-bindings-300

Be sure to check out our growing collection of short screencasts on Pluralsight's screencast landing page.

Previous WCF Screencasts (RSS for all posts in the series)

Screencast: Configuring bindings in WCF

Screencast: Configuring bindings in WCF

I recently published a free video on Configuring bindings in WCF.

configuring-bindings-200

In this WCF screencast, I'll show you how to configure bindings on your WCF endpoints, which will allow you to customize the precise communication details you wish to support on your WCF services.

Check out our growing collection of free .NET screencasts and videos.  Subscribe to the Pluralsight feed to be notified when new screencasts are published.  Also, check out our growing library of online .NET training courses — see what you can learn with Pluralsight On-Demand!

Signs of the Apocalypse


1.       Protest in Auburn over a football coach draws more than an anti-war protest


2.       Despite all the economic, environmental and social woes in the world, top press outlets still have the time to cover Oprah’s weight and giant feats of agriculture


3.       Sun talks about the importance of the client and escaping the browser


 


Please feel free to add your own.