Pipeline Testing Library Updated

Link. May 18, 2006. Comments [0]. Posted in: BizTalk

I've just now updated my Pipeline Testing Library. In this version, I've created my own mock IPipelineContext[Ex] implementation, to support configuring some functionality not previously available:

  1. You can now configure at the pipeline level the thumbprint for the Group Signing Certificate so that it is returned from IPipelineContext.GroupSigningCertificate to pipeline components. Here's how you'd configure it:

    SendPipelineWrapper pipeline = PipelineFactory.CreateEmptySendPipeline();

    pipeline.GroupSigningCertificate = "....";

  2. Now transactional support is available for pipeline components if you enable it (it's disabled by default). If you do enable it, then components will get a valid DTC transaction returned from IPipelineContextEx.GetTransaction(). I'm not 100% comfortable with this, but it can be useful in a few scenarios (see below for one such one). To enable it, call the EnableTransactions() method on the pipeline wrapper object just before calling Execute().

The reason why I implemented the transactional support in the pipeline context mock object is that some components require it. In particular, it turns out that the BizTalk Framework Disassembler Component (BtfDasmComp) will not work unless the pipeline context returns a valid transaction from IPipelineContextEx.GetTransaction().  With this update, you can now test pipelines that use the BtfDasmComp component, though be aware that the transaction object is then used to access some of the biztalk databases (I'm not exactly sure yet what for, though). Here's an example piece of code with such a trick:

ReceivePipelineWrapper pipeline = PipelineFactory.CreateEmptyReceivePipeline();

pipeline.AddComponent(new BtfDasmComp(), PipelineStage.Disassemble);

FixEncodingComponent fix = new FixEncodingComponent();

fix.Encoding = Encoding.Unicode;

pipeline.AddComponent(fix, PipelineStage.Decode);

 

pipeline.EnableTransactions();

 

Stream input = new FileStream(@"e:\temp\BtfDasmTest\BOBUILDING_SITE2.xml", FileMode.Open);

IBaseMessage inputMsg = MessageHelper.CreateFromStream(input);

 

MessageCollection outputMsgs = pipeline.Execute(inputMsg);

 



Comments are closed.

Syndicate

About

Tomas Restrepo is a software developer located in Colombia, South America. His interests include .NET, Connected Systems, PowerShell and lately dynamic programming languages. More...

tomasrestrepo @ twitter My Flickr photostream My saved links on delicious My Technorati Profile

email: tomas@winterdom.com
msn: tomasr@passport.com

View my profile on LinkedIn

MVP logo

Ads


Categories

Statistics

Total Posts: 1050
This Year: 1
This Month: 1
This Week: 0
Comments: 825

Archive

Other

Copyright © 2002-2008, Tomas Restrepo.

Powered by: newtelligence dasBlog 2.2.8279.16125

Sign In