Beispiel #1
0
        public void SendPipelineDslGrammarVariant6()
        {
            // not fluent-DSL
            var pipeline = new SendPipeline <Pipelines.XmlTransmit>();

            pipeline.Stages.PreAssemble.Component <FailedMessageRoutingEnablerComponent>().Enabled = false;
            pipeline.Stages.PreAssemble.Component <ActivityTrackerComponent>().TrackingModes       = ActivityTrackingModes.Claim;
            pipeline.Stages.Assemble.Component <XmlAsmComp>().DocumentSpecNames = new SchemaList {
                new SchemaWithNone(Schema <Any> .AssemblyQualifiedName),
                new SchemaWithNone(Schema <Claim.CheckIn> .AssemblyQualifiedName)
            };
            pipeline.Stages.Assemble.Component <XmlAsmComp>().AddXMLDeclaration = true;
            pipeline.Stages.Encode.Component <PolicyRunnerComponent>().Policy   = Policy <ProcessResolver> .Name;
            var binding = ((IPipelineSerializerFactory)pipeline).GetPipelineBindingSerializer().Serialize();

            // fluent-DSL sixth variant
            var pipeline6 = new SendPipeline <Pipelines.XmlTransmit>(
                pl => pl
                .PreAssemblerAt <FailedMessageRoutingEnablerComponent>(0).Configure(c => { c.Enabled = false; })
                .PreAssemblerAt <ActivityTrackerComponent>(3).Configure(c => { c.TrackingModes = ActivityTrackingModes.Claim; })
                .AssemblerAt <XmlAsmComp>(0).Configure(
                    c => {
                c.DocumentSpecNames = new SchemaList {
                    new SchemaWithNone(Schema <Any> .AssemblyQualifiedName),
                    new SchemaWithNone(Schema <Claim.CheckIn> .AssemblyQualifiedName)
                };
                c.AddXMLDeclaration = true;
            })
                .EncoderAt <PolicyRunnerComponent>(1).Configure(c => { c.Policy = Policy <ProcessResolver> .Name; }));
            var binding6 = ((IPipelineSerializerFactory)pipeline6).GetPipelineBindingSerializer().Serialize();

            Assert.That(binding6, Is.EqualTo(binding));
        }
Beispiel #2
0
        public void SendPipelineDslGrammarVariant3()
        {
            // not fluent-DSL
            var pipeline = new SendPipeline <Pipelines.XmlTransmit>();

            pipeline.Stages.PreAssemble.Component <FailedMessageRoutingEnablerComponent>().Enabled = false;
            pipeline.Stages.Assemble.Component <XmlAsmComp>().DocumentSpecNames = new SchemaList {
                new SchemaWithNone(Schema <Any> .AssemblyQualifiedName),
                new SchemaWithNone(Schema <Claim.CheckIn> .AssemblyQualifiedName)
            };
            pipeline.Stages.Assemble.Component <XmlAsmComp>().AddXMLDeclaration = true;
            pipeline.Stages.Encode.Component <PolicyRunnerComponent>().Policy   = Policy <ProcessResolver> .Name;
            var binding = ((IPipelineSerializerFactory)pipeline).GetPipelineBindingSerializer().Serialize();

            // fluent-DSL third variant
            var pipeline3 = new SendPipeline <Pipelines.XmlTransmit>(
                pl => {
                pl.FirstPreAssembler <FailedMessageRoutingEnablerComponent>(c => { c.Enabled = false; });
                pl.FirstAssembler <XmlAsmComp>(
                    c => {
                    c.DocumentSpecNames = new SchemaList {
                        new SchemaWithNone(Schema <Any> .AssemblyQualifiedName),
                        new SchemaWithNone(Schema <Claim.CheckIn> .AssemblyQualifiedName)
                    };
                    c.AddXMLDeclaration = true;
                });
                pl.FirstEncoder <PolicyRunnerComponent>(c => { c.Policy = Policy <ProcessResolver> .Name; });
            });
            var binding3 = ((IPipelineSerializerFactory)pipeline3).GetPipelineBindingSerializer().Serialize();

            Assert.That(binding3, Is.EqualTo(binding));
        }
Beispiel #3
0
 public TestReferencedSendPort()
 {
     Name              = "MyTestReferencedSendPort";
     SendPipeline      = new SendPipeline <XmlTransmit>();
     Transport.Adapter = new FileAdapter.Outbound(a => { a.DestinationFolder = @"c:\files"; });
     Transport.Host    = "host";
 }
Beispiel #4
0
 public TwoWaySendPort()
 {
     Name            = "TwoWaySendPort";
     Description     = "Some Useless Two-Way Test Send Port";
     SendPipeline    = new SendPipeline <PassThruTransmit>();
     ReceivePipeline = new ReceivePipeline <PassThruReceive>(
         rp => rp.Decoder <PolicyRunnerComponent>(
             c => {
         c.Enabled       = true;
         c.ExecutionMode = PluginExecutionMode.Deferred;
         c.Policy        = Policy <Policies.Send.Claim.ProcessResolver> .Name;
     }));
     Transport.Adapter = new DummyAdapter();
     Transport.Host    = "Send Host Name";
 }
Beispiel #5
0
 public TwoWayReceiveLocation()
 {
     Name            = "TwoWayReceiveLocation";
     Description     = "Some Useless Two-Way Test Receive Location";
     Enabled         = false;
     ReceivePipeline = new ReceivePipeline <PassThruReceive>();
     SendPipeline    = new SendPipeline <PassThruTransmit>(
         pl => pl.PreAssembler <PolicyRunnerComponent>(
             c => {
         c.Enabled       = true;
         c.ExecutionMode = PluginExecutionMode.Deferred;
         c.Policy        = Policy <Policies.Send.Claim.ProcessResolver> .Name;
     }));
     Transport.Adapter = new DummyAdapter();
     Transport.Host    = "Receive Host Name";
 }
Beispiel #6
0
        public void SendPipelineSerializeKeepsOnlyStagesWhoseComponentsDefaultConfigHasBeenOverridden2()
        {
            var pipeline = SendPipeline <Pipelines.XmlTransmit> .Configure(
                pl => pl
                .FirstPreAssembler <FailedMessageRoutingEnablerComponent>(c => { c.Enabled = false; })
                .FirstPreAssembler <ActivityTrackerComponent>(
                    c => {
                c.Enabled       = true;
                c.TrackingModes = ActivityTrackingModes.Claim;
            }));

            var binding = ((IPipelineSerializerFactory)pipeline).GetPipelineBindingSerializer().Serialize();

            Assert.That(
                binding,
                Is.EqualTo(
                    "<Root><Stages>" +
                    "<Stage CategoryId=\"9d0e4101-4cce-4536-83fa-4a5040674ad6\">" +
                    "<Components>" +
                    "<Component Name=\"Be.Stateless.BizTalk.Component.FailedMessageRoutingEnablerComponent\">" +
                    "<Properties><Enabled vt=\"11\">0</Enabled></Properties>" +
                    "</Component>" +
                    "<Component Name=\"Be.Stateless.BizTalk.Component.ContextPropertyExtractorComponent\">" +
                    "<Properties />" +
                    "</Component><Component Name=\"Be.Stateless.BizTalk.Component.PolicyRunnerComponent\">" +
                    "<Properties />" +
                    "</Component>" +
                    "<Component Name=\"Be.Stateless.BizTalk.Component.ActivityTrackerComponent\">" +
                    "<Properties><Enabled vt=\"11\">-1</Enabled><TrackingModes vt=\"8\">Claim</TrackingModes></Properties>" +
                    "</Component>" +
                    "<Component Name=\"Be.Stateless.BizTalk.Component.XsltRunnerComponent\">" +
                    "<Properties />" +
                    "</Component>" +
                    "</Components>" +
                    "</Stage>" +
                    "</Stages></Root>"));
        }
Beispiel #7
0
 public OneWaySendPort()
 {
     Name            = "OneWaySendPort";
     Description     = "Some Useless One-Way Test Send Port";
     Filter          = new Filter(() => BtsProperties.MessageType == Schema <Schemas.Xml.Batch.Content> .MessageType);
     Priority        = Priority.Highest;
     OrderedDelivery = true;
     StopSendingOnOrderedDeliveryFailure = true;
     SendPipeline = new SendPipeline <PassThruTransmit>(
         sp => sp.PreAssembler <PolicyRunnerComponent>(
             c => {
         c.Enabled       = true;
         c.ExecutionMode = PluginExecutionMode.Deferred;
         c.Policy        = Policy <Policies.Send.Claim.ProcessResolver> .Name;
     }));
     Transport.Adapter     = new DummyAdapter();
     Transport.Host        = "Send Host Name";
     Transport.RetryPolicy = new RetryPolicy {
         Count = 30, Interval = TimeSpan.FromMinutes(60)
     };
     Transport.ServiceWindow = new ServiceWindow {
         StartTime = new Time(8, 0), StopTime = new Time(20, 0)
     };
 }