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

Ive just been looking over a couple of BizUnit steps and have decided to create a couple of custom versions.  The main reason that I have modified them is that I can reduce the length of time taken on my build process if the tests are quicker.  The changes I have made are as follows:


In the standard step the executing thread is put to sleep for the timeout duration before looking for the file.  In practice you often have to modify this setting as you learn how long your tests take to execute.  What I also find in practice is that developers often set this value quite high to stop their tests failing, but this just makes the tests all run longer.

I have added a DelayBeforeCheck parameter which will let you put the thread to sleep for a period before checking for the files.  I will then keep checking for the number of seconds defined in the timeout value.  There is also an IntervalBetweenChecks parameter which will allow you to pause the thread  for a given time between checks.  the rest of the parameters are the same as the standard step.

An example of how you might use this step is that you would run your BizTalk process in your test, and then use the FilesExistStep.  You might configure it to wait for 5 seconds before looking for the file.  It would then check for upto 60 seconds with a 5 second pause between each check.  When the step detects the file it has executed successfully.


I have also created a custom version of the EventLogCheckStep which does exactly the same process of checking as the FilesExist step above, but checks the event log instead. 


If you would like to check out these steps the sample is available below:


Update: Just spotted the wait on file step in BizUnit.  Dont know where this little bitch has been hiding but very useful

Posted on Friday, April 18, 2008 6:31 PM BizTalk , BizTalk Testing | Back to top

Comments on this post: BizUnit - Modified FilesExist and EventLogCheck steps

# re: BizUnit - Modified FilesExist and EventLogCheck steps
Requesting Gravatar...
Hey, We wrote an extension for waitOnFile as well when we found that sometimes the messaging was faster than our tests and the final file would be output well before the tests got to checking it, so waitonFile will fail because it doesnt take into account files already existing... waitonFileEx will allow the file to already exist and get the file name and put it into the context..

Left by Benjy on Jun 25, 2008 12:34 PM

Your comment:
 (will show your gravatar)

Copyright © Michael Stephenson | Powered by: | Join free