I've released BizUnit 2.0, in case you’ve not come across it before, BizUnit is a framework that I put together to enable the rapid development of automated functional testing for BizTalk solutions, the motivation was to provide a framework that would bring automated testing of BizTalk solutions to the masses!! BizTalk solutions are often mission critical, an automated testing approach helps to drive quality before go-live and is essential post go-live to ensure that patches to not cause regressions. BizUnit is not restricted to testing BizTalk solutions, but it is targeted at them.
BizUnit defines test cases as Xml documents, which, enables test cases to be rapidly written and also enables the same test cases to moved between different environments by fixing up the Url’s for the endpoints, for example the endpoint Url’s for a development environment will be different to a testing, and pre-production environments.
Also, by having the test cases defined as Xml, it allows them to be easily generated, some of the customers that I have worked with define their test matrixes in Excel, and then auto-generate the BizUnit test cases from Excel.
Test Case Format
A test case is made up of three stages, test setup, test execution and test cleanup, the cleanup stage is always executed and intended to leave the platform in the same state that it started.
Each stage may consist of zero or more test steps, test steps are in general autonomous, state can be flowed between them if required using the ‘context’ object that is passed to each test step.
How does it Work?
BizUnit takes a black box approach to testing BizTalk solutions, if you look at the scenario below, a BizTalk solution receives a request-response message over HTTP, the message is routed to an Orchestration which, sends a message to MSMQ and another to a FILE drop, the Orchestration waits for a FILE to be received, after which the Orchestration sends the response back to the waiting HTTP client. The solution also uses BAM, writing business data to the BAM database.
In order to test this scenario, a BizUnit test case is defined that has 5 test steps:
BizUnit 2.0 Enhancements
A number of enhancements have been added to BizUnit 2.0, firstly, there are now some 37 test steps, which is vastly improved from the previous version. A lot of people have contributed test steps which I’ve included in this version. Briefly, here’s some of the enhancements:
Here’s a list of all of the test steps in BizUnit build 2.0.1062.0, the documentation provides more details around what these steps do and how to use them:
BAMDeploymentStep
CheckPop3MailStep
ContextManipulatorStep
CrossReferenceDataVerificationStep
CrossReferenceSeedClearStep
CrossReferenceSeedLoadStep
DatabaseDeleteStep
DatabaseRowCountStep
DBQueryStep
DelayStep
DotNetObjectInvokerStep
EventLogCheckStep
EventLogClearStep
ExecuteCommandStep
FileCreateStep
FileDeleteMultipleStep
FileDeleteStep
FileMoveStep
FileMultiValidateStep
FilesExistStep
FilesMoveStep
FileValidateStep
HttpPostStep
HttpRequestResponseStep
MSMQCreateQueueStep
MSMQDeleteQueueStep
MSMQQueuePurgeStep
MSMQReadStep
MSMQWriteStep
OrchestrationConductorStep
ReceiveLocationEnabledStep
ReceivePortConductorStep
RenameDirectoryStep
RuleEngineStep
SMTPReadStep
SOAPHTTPRequestResponseStep
WaitOnFileStep
MQSeriesClearQueueStep
MQSeriesGetStep
MQSeriesPutStep
OutlookReadStep
Validation Steps:
BinaryValidationStep
ContextValidationStep
RegExValidationStep
XmlValidationStep
Context Loader Steps:
RegExContextLoader
TextContextLoader
XmlContextLoader
Test Coverage:
So, you’ve developed all of your BVT’s (Build Verification Tests) for your BizTalk solution using BizUnit, how do you know whether you’ve done a good job, and how much test coverage you have? Enter Jason Births “Orchestration Profiler”. This is a great tool that you can use in conjunction with BizUnit to ensure that you have adequate test coverage, it produces a detailed graphical report of what the test coverage is like, I highly recommend using it with BizUnit.
Finally, I’d like to give my special thanks to a number of people that have contributed test steps, requirements and ideas for BizUnit 2.0, my apologies if I have missed off anyone, it’s not intentional just my disorganisation!, please let me know if that is the case:
Dave Regan
Tanveer Rashid
Daren Jefford
Kevin Purcell
Karina Apostolides
Jon Bonnick
Brian Milburn
Rahmatullah Khan
Future work:
A couple of the guys above have done some great work building a Visual Studio plugin for BizUnit and a command line driver. I didn’t have time to get it in this release, but it’ll be following soon. If you find any bugs, or have test steps you'd like to contribute please sned them along to me and I'll get them into the next drop.
Enjoy!