コード例 #1
0
 /// <summary>
 /// Executes the task.
 /// </summary>
 /// <returns>Indicating if the task was successful.</returns>
 public override bool Execute()
 {
     BizTalkApplication bizTalkApplication = new BizTalkApplication(ManagementDatabaseConnectionString, ApplicationName);
     Log.LogMessage("Starting all Send Ports for BizTalk application '{0}'.", ApplicationName);
     bizTalkApplication.StartAllSendPorts();
     return true;
 }
コード例 #2
0
 /// <summary>
 /// Executes the task.
 /// </summary>
 /// <returns>Indicating if the task was successful.</returns>
 public override bool Execute()
 {
     BizTalkApplication bizTalkApplication = new BizTalkApplication(ManagementDatabaseConnectionString, ApplicationName);
     Log.LogMessage("Disabling all Receive Locations for BizTalk application '{0}'.", ApplicationName);
     bizTalkApplication.DisableAllReceiveLocations();
     return true;
 }
コード例 #3
0
 /// <summary>
 /// Executes the task.
 /// </summary>
 /// <returns>Indicating if the task was successful.</returns>
 public override bool Execute()
 {
     BizTalkApplication bizTalkApplication = new BizTalkApplication(ManagementDatabaseConnectionString, ApplicationName);
     Log.LogMessage("Terminating all Orchestrations for BizTalk application '{0}'.", ApplicationName);
     bizTalkApplication.TerminateAllOrchestrations();
     return true;
 }
コード例 #4
0
        /// <summary>
        /// Executes the task.
        /// </summary>
        /// <returns>Indicating if the task was successful.</returns>
        public override bool Execute()
        {
            BizTalkCatalogExplorer bizTalkCatalogExplorer = new BizTalkCatalogExplorer(ManagementDatabaseConnectionString);
            if (bizTalkCatalogExplorer.ApplicationExists(ApplicationName))
            {
                BizTalkApplication bizTalkApplication = new BizTalkApplication(
                    ManagementDatabaseConnectionString, ApplicationName);
                if (this.TerminateOrchestrations)
                {
                    Log.LogMessage("Disabling all Receive Locations for BizTalk application '{0}'.", ApplicationName);
                    bizTalkApplication.DisableAllReceiveLocations();
                    Log.LogMessage("Terminating all Orchestrations for BizTalk application '{0}'.", ApplicationName);
                    bizTalkApplication.TerminateAllOrchestrations();
                }

                Log.LogMessage("Bringing BizTalk application '{0}' to a complete stop.", ApplicationName);
                bizTalkApplication.StopAll();
            }
            else
            {
                Log.LogMessage("Skipping stopping of BizTalk application '{0}' as none exist matching that name.", ApplicationName);
            }

            return true;
        }
コード例 #5
0
        internal static BizTalkApplication TransformModel(Microsoft.BizTalk.ExplorerOM.Application omApplication)
        {
            var application = new BizTalkApplication();

            application.Name = omApplication.Name;
            application.Description = omApplication.Description;

            return application;
        }
コード例 #6
0
        /// <summary>
        /// Executes the task.
        /// </summary>
        /// <returns>Indicating if the task was successful.</returns>
        public override bool Execute()
        {
            BizTalkApplication bizTalkApplication = new BizTalkApplication(ManagementDatabaseConnectionString, ApplicationName);
            foreach (ITaskItem orchestrationName in this.OrchestrationNames)
            {
                Log.LogMessage("Terminating Orchestration '{0}' for BizTalk application '{1}'.", orchestrationName.ItemSpec, ApplicationName);
                bizTalkApplication.TerminateOrchestration(orchestrationName.ItemSpec);
            }

            return true;
        }
コード例 #7
0
        /// <summary>
        /// Executes the task.
        /// </summary>
        /// <returns>Indicating if the task was successful.</returns>
        public override bool Execute()
        {
            BizTalkApplication bizTalkApplication = new BizTalkApplication(ManagementDatabaseConnectionString, ApplicationName);
            foreach (ITaskItem recieveLocationName in this.ReceiveLocationNames)
            {
                Log.LogMessage("Enabling Receive Location '{0}' for BizTalk application '{1}'.", recieveLocationName.ItemSpec, ApplicationName);
                bizTalkApplication.EnableReceiveLocation(recieveLocationName.ItemSpec);
            }

            return true;
        }
コード例 #8
0
        /// <summary>
        /// Executes the task.
        /// </summary>
        /// <returns>Indicating if the task was successful.</returns>
        public override bool Execute()
        {
            BizTalkApplication bizTalkApplication = new BizTalkApplication(ManagementDatabaseConnectionString, ApplicationName);
            foreach (ITaskItem sendPortName in this.SendPortNames)
            {
                Log.LogMessage("Stopping Send Port '{0}' for BizTalk application '{1}'.", sendPortName.ItemSpec, ApplicationName);
                bizTalkApplication.StopSendPort(sendPortName.ItemSpec);
            }

            return true;
        }
コード例 #9
0
 public void IntegrationTestStopAll()
 {
     BizTalkApplication bizTalkApplication = new BizTalkApplication("server=.\\MSSqlSvr2008;database=BizTalkMgmtDb;integrated security=sspi;", "BizTalk Application 1");
     bizTalkApplication.StopAll();
 }
コード例 #10
0
ファイル: TransformViewModel.cs プロジェクト: riha/btswebdoc
 public TransformViewModel(BizTalkApplication currentApplication, IEnumerable<Manifest> manifests, Manifest currentManifest, IEnumerable<BizTalkBaseObject> breadCrumbs, IEnumerable<BizTalkApplication> applications, IEnumerable<Host> hosts, Transform transform)
     : base(currentApplication, manifests, currentManifest, breadCrumbs,  applications, hosts)
 {
     Transform = transform;
 }
コード例 #11
0
 public OrchestrationViewModel(BizTalkApplication currentApplication, IEnumerable<Manifest> manifests, Manifest currentManifest, IEnumerable<BizTalkBaseObject> breadCrumbs, IEnumerable<BizTalkApplication> applications, IEnumerable<Host> hosts, Orchestration orchestration)
     : base(currentApplication, manifests, currentManifest, breadCrumbs, applications, hosts)
 {
     Orchestration = orchestration;
 }
コード例 #12
0
 protected ApplicationViewModelBase(BizTalkApplication currentApplication, IEnumerable <Manifest> manifests, Manifest currentManifest, IEnumerable <BizTalkBaseObject> breadCrumbs, IEnumerable <BizTalkApplication> applications, IEnumerable <Host> hosts)
     : base(manifests, currentManifest, breadCrumbs, applications, hosts)
 {
     CurrentApplication = currentApplication;
 }
コード例 #13
0
ファイル: SchemaViewModel.cs プロジェクト: riha/btswebdoc
 public SchemaViewModel(BizTalkApplication currentApplication, IEnumerable<Manifest> manifests, Manifest currentManifest, IEnumerable<BizTalkBaseObject> breadCrumbs, IEnumerable<BizTalkApplication> applications, IEnumerable<Host> hosts, Schema schema)
     : base(currentApplication, manifests, currentManifest, breadCrumbs, applications, hosts)
 {
     Schema = schema;
 }
コード例 #14
0
ファイル: SendPortViewModel.cs プロジェクト: riha/btswebdoc
 public SendPortViewModel(BizTalkApplication currentApplication, IEnumerable<Manifest> manifests, Manifest currentManifest, IEnumerable<BizTalkBaseObject> breadCrumbs, IEnumerable<BizTalkApplication> applications, IEnumerable<Host> hosts, SendPort sendPort)
     : base(currentApplication, manifests, currentManifest, breadCrumbs, applications, hosts)
 {
     SendPort = sendPort;
 }
コード例 #15
0
 public ApplicationViewModel(BizTalkApplication currentApplication, IEnumerable <Manifest> manifests, Manifest currentManifest, IEnumerable <BizTalkBaseObject> breadCrumbs, IEnumerable <BizTalkApplication> applications, IEnumerable <Host> hosts, BizTalkApplication application)
     : base(currentApplication, manifests, currentManifest, breadCrumbs, applications, hosts)
 {
     Application = application;
 }
コード例 #16
0
 protected ApplicationViewModelBase(BizTalkApplication currentApplication, IEnumerable<Manifest> manifests, Manifest currentManifest, IEnumerable<BizTalkBaseObject> breadCrumbs, IEnumerable<BizTalkApplication> applications, IEnumerable<Host> hosts)
     : base(manifests, currentManifest,breadCrumbs, applications,hosts)
 {
     CurrentApplication = currentApplication;
 }
コード例 #17
0
ファイル: PipelineViewModel.cs プロジェクト: riha/BtsWebDoc
 public PipelineViewModel(BizTalkApplication currentApplication, IEnumerable <Manifest> manifests, Manifest currentManifest, IEnumerable <BizTalkBaseObject> breadCrumbs, IEnumerable <BizTalkApplication> applications, IEnumerable <Host> hosts, Pipeline pipeline)
     : base(currentApplication, manifests, currentManifest, breadCrumbs, applications, hosts)
 {
     Pipeline = pipeline;
 }
コード例 #18
0
ファイル: AssemblyViewModel.cs プロジェクト: riha/BtsWebDoc
 public AssemblyViewModel(BizTalkApplication currentApplication, IEnumerable <Manifest> manifests, Manifest currentManifest, IEnumerable <BizTalkBaseObject> breadCrumbs, IEnumerable <BizTalkApplication> applications, IEnumerable <Host> hosts, BizTalkAssembly assembly)
     : base(currentApplication, manifests, currentManifest, breadCrumbs, applications, hosts)
 {
     Assembly = assembly;
 }
コード例 #19
0
 public ReceivePortViewModel(BizTalkApplication currentApplication, IEnumerable <Manifest> manifests, Manifest currentManifest, IEnumerable <BizTalkBaseObject> breadCrumbs, IEnumerable <BizTalkApplication> applications, IEnumerable <Host> hosts, ReceivePort receivePort)
     : base(currentApplication, manifests, currentManifest, breadCrumbs, applications, hosts)
 {
     ReceivePort = receivePort;
 }
コード例 #20
0
        public void ParseWithTwoApplicationsAndOneOrchestration(BizTalkOrchestrationParser parser, ILogger logger, MigrationContext context, BizTalkApplication applicationOne, BizTalkApplication applicationTwo, MetaModel metaModel, AzureIntegrationServicesModel model, ParsedBizTalkApplicationGroup group, Exception e)
        {
            "Given a model"
            .x(() =>
            {
                model = new AzureIntegrationServicesModel();
                group = new ParsedBizTalkApplicationGroup();
                model.MigrationSource.MigrationSourceModel = group;
            });

            "And a logger"
            .x(() => logger = new Mock <ILogger>().Object);

            "And a context"
            .x(() => context = new MigrationContext());

            "And an application with one orchestration with a valid ODX"
            .x(() =>
            {
                metaModel = new MetaModel
                {
                    Core    = "Core",
                    Element = new Element[]
                    {
                        new Element {
                            Type = MetaModelConstants.ElementTypeModule
                        }
                    },
                    MajorVersion = "MajorVersion",
                    MinorVersion = "MinorVersion"
                };

                var msiContainer = new ResourceContainer()
                {
                    Key = "TestMsi.Key", Name = "TestMsi", Type = ModelConstants.ResourceContainerMsi, ContainerLocation = @"C:\Test\Test.msi"
                };
                model.MigrationSource.ResourceContainers.Add(msiContainer);

                var cabContainer = new ResourceContainer()
                {
                    Key = "TestCab.Key", Name = "TestCab", Type = ModelConstants.ResourceContainerCab, ContainerLocation = @"C:\Test\Test.CAB"
                };
                msiContainer.ResourceContainers.Add(cabContainer);

                var asmContainer = new ResourceContainer()
                {
                    Key = "TestAssembly.Key", Name = "TestAssembly", Type = ModelConstants.ResourceContainerAssembly, ContainerLocation = @"C:\Test\Test.dll"
                };
                cabContainer.ResourceContainers.Add(asmContainer);

                var orchestration = new ResourceDefinition()
                {
                    Key = "TestOrchestration.Key", Name = "TestOrchestration", Type = ModelConstants.ResourceDefinitionOrchestration, ResourceContent = SerializeToString(metaModel)
                };
                asmContainer.ResourceDefinitions.Add(orchestration);

                applicationOne = new BizTalkApplication()
                {
                    Name = "ApplicationOne"
                };
                applicationOne.Orchestrations.Add(new Orchestration(asmContainer.Key, orchestration.Key)
                {
                    Name = "OrchestrationOne"
                });
                applicationOne.ApplicationDefinition = new ApplicationDefinitionFile {
                    ResourceKey = "ResourceKey"
                };

                var parsedApplication = new ParsedBizTalkApplication
                {
                    Application = applicationOne
                };
                group.Applications.Add(parsedApplication);

                var container = new ResourceContainer();
                container.ResourceDefinitions.Add(new ResourceDefinition());
                container.ResourceDefinitions[0].Resources.Add(new ResourceItem {
                    Key = "ResourceKey"
                });
                model.MigrationSource.ResourceContainers.Add(container);
            });

            "And an application with no orchestrations"
            .x(() =>
            {
                applicationTwo = new BizTalkApplication()
                {
                    Name = "ApplicationTwo"
                };

                group.Applications.Add(
                    new ParsedBizTalkApplication
                {
                    Application = applicationTwo
                });
            });

            "And a BizTalk Orchestration Parser"
            .x(() => parser = new BizTalkOrchestrationParser(model, context, logger));

            "When parsing"
            .x(() => e = Record.Exception(() => parser.Parse()));

            "Then the parser should not throw an exception"
            .x(() => e.Should().BeNull());

            "And the error count should be 0"
            .x(() =>
            {
                context.Errors.Should().BeNullOrEmpty();
            });

            "And the model on the orchestration should be equivalent to the ODX for the first application"
            .x(() =>
            {
                // Validate the structure of the model.
                group.Applications[0].Application.Orchestrations.Should().NotBeNullOrEmpty().And.HaveCount(1);
                var orchestration = group.Applications[0].Application.Orchestrations[0];
                group.Applications[0].Application.Orchestrations[0].Model.Should().NotBeNull();

                // Validate the contents of the model.
                orchestration.Model.MajorVersion.Should().Be(metaModel.MajorVersion);
                orchestration.Model.MinorVersion.Should().Be(metaModel.MinorVersion);
                orchestration.Model.Core.Should().Be(metaModel.Core);
                orchestration.Model.Element.Should().NotBeNullOrEmpty();
                orchestration.Model.Element.Should().HaveCount(metaModel.Element.Length);
            });
        }
コード例 #21
0
        public void ParseTransformWithSuccess(TransformParser parser, ILogger logger, MigrationContext context, AzureIntegrationServicesModel model, ParsedBizTalkApplicationGroup group, Exception e)
        {
            "Given a model with a transform"
            .x(() =>
            {
                model = new AzureIntegrationServicesModel();
                group = new ParsedBizTalkApplicationGroup();
                model.MigrationSource.MigrationSourceModel = group;

                var msiContainer = new ResourceContainer()
                {
                    Key = "TestMsi.Key", Name = "TestMsi", Type = ModelConstants.ResourceContainerMsi, ContainerLocation = @"C:\Test\Test.msi"
                };
                model.MigrationSource.ResourceContainers.Add(msiContainer);

                var cabContainer = new ResourceContainer()
                {
                    Key = "TestCab.Key", Name = "TestCab", Type = ModelConstants.ResourceContainerCab, ContainerLocation = @"C:\Test\Test.CAB"
                };
                msiContainer.ResourceContainers.Add(cabContainer);

                var asmContainer = new ResourceContainer()
                {
                    Key = "TestAssembly.Key", Name = "TestAssembly", Type = ModelConstants.ResourceContainerAssembly, ContainerLocation = @"C:\Test\Test.dll"
                };
                cabContainer.ResourceContainers.Add(asmContainer);

                var transformResourceDefinition = new ResourceDefinition()
                {
                    Key  = "transformDefinitionKey",
                    Name = "transformName",
                    Type = ModelConstants.ResourceDefinitionMap
                };

                asmContainer.ResourceDefinitions.Add(transformResourceDefinition);

                var application = new BizTalkApplication()
                {
                    Name = "ApplicationOne"
                };

                var transform = new Types.Entities.Transform
                {
                    Name = "transformName",
                    ResourceContainerKey  = asmContainer.Key,
                    ResourceDefinitionKey = transformResourceDefinition.Key
                };

                application.Transforms.Add(transform);

                group.Applications.Add(
                    new ParsedBizTalkApplication
                {
                    Application = application
                });
            });

            "And a logger"
            .x(() => logger = new Mock <ILogger>().Object);

            "And a context"
            .x(() => context = new MigrationContext());

            "And a parser"
            .x(() => parser = new TransformParser(model, context, logger));

            "When parsing"
            .x(() => e = Record.Exception(() => parser.Parse()));

            "Then the code should not throw an exception"
            .x(() => e.Should().BeNull());

            "And the resources should be set."
            .x(() =>
            {
                var appModel = (AzureIntegrationServicesModel)model;

                // Check the transform resource has been created.
                appModel.MigrationSource.ResourceContainers[0].ResourceContainers[0].ResourceContainers[0].ResourceDefinitions[0].Resources.Should().NotBeNullOrEmpty();
                appModel.MigrationSource.ResourceContainers[0].ResourceContainers[0].ResourceContainers[0].ResourceDefinitions[0].Resources.Should().HaveCount(1);
                var transformResourceDefinition = appModel.MigrationSource.ResourceContainers[0].ResourceContainers[0].ResourceContainers[0].ResourceDefinitions[0];
                var transformResource           = transformResourceDefinition.Resources[0];

                // Get the transform.
                var transform = group.Applications[0].Application.Transforms[0];

                // Validate the transform resource.
                transformResource.Should().NotBeNull();
                transformResource.Key.Should().Be(transformResourceDefinition.Key + ":map");
                transformResource.Name.Should().Be(transform.Name);
                transformResource.Type.Should().Be(ModelConstants.ResourceMap);
                transformResource.Description.Should().Be(transform.FullName);

                transform.Resource.Should().Be(transformResource);                            // The pointer to the resource should be set.
                transformResource.ParentRefId.Should().Be(transformResourceDefinition.RefId); // The parent ref ID should be set.
                transformResource.SourceObject.Should().Be(transform);                        // The resource should have a pointer to the source object.
            });
        }
コード例 #22
0
        public void ParseWithTwoApplicationsAndOnePipeline(BizTalkPipelineParser parser, ILogger logger, MigrationContext context, BizTalkApplication applicationOne, BizTalkApplication applicationTwo, Document document, AzureIntegrationServicesModel model, ParsedBizTalkApplicationGroup group, Exception e)
        {
            "Given a model with one application"
            .x(() =>
            {
                model = new AzureIntegrationServicesModel();
                group = new ParsedBizTalkApplicationGroup();
                model.MigrationSource.MigrationSourceModel = group;
            });

            "And a logger"
            .x(() => logger = new Mock <ILogger>().Object);

            "And an application with one pipeline with valid XML"
            .x(() =>
            {
                document = new Document
                {
                    FriendlyName = "Friendly Name",
                    Description  = "Description",
                    Stages       = new DocumentStage[1]
                    {
                        new DocumentStage
                        {
                            Components = new DocumentStageComponent[]
                            {
                                new DocumentStageComponent {
                                    Name = "Staged Component"
                                }
                            }
                        }
                    }
                };

                var msiContainer = new ResourceContainer()
                {
                    Key = "TestMsi.Key", Name = "TestMsi", Type = ModelConstants.ResourceContainerMsi, ContainerLocation = @"C:\Test\Test.msi"
                };
                model.MigrationSource.ResourceContainers.Add(msiContainer);

                var cabContainer = new ResourceContainer()
                {
                    Key = "TestCab.Key", Name = "TestCab", Type = ModelConstants.ResourceContainerCab, ContainerLocation = @"C:\Test\Test.CAB"
                };
                msiContainer.ResourceContainers.Add(cabContainer);

                var asmContainer = new ResourceContainer()
                {
                    Key = "TestAssembly.Key", Name = "TestAssembly", Type = ModelConstants.ResourceContainerAssembly, ContainerLocation = @"C:\Test\Test.dll"
                };
                cabContainer.ResourceContainers.Add(asmContainer);

                var pipeline = new ResourceDefinition()
                {
                    Key = "TestPipeline.Key", Name = "TestPipeline", Type = ModelConstants.ResourceDefinitionReceivePipeline, ResourceContent = SerializeToString(document)
                };
                asmContainer.ResourceDefinitions.Add(pipeline);

                applicationOne = new BizTalkApplication()
                {
                    Name = "ApplicationOne"
                };
                applicationOne.Pipelines.Add(new Pipeline(asmContainer.Key, pipeline.Key)
                {
                    Name      = "Pipeline One",
                    Direction = PipelineDirection.Receive
                });

                group.Applications.Add(new ParsedBizTalkApplication
                {
                    Application = applicationOne
                });

                applicationOne.ApplicationDefinition = new ApplicationDefinitionFile {
                    ResourceKey = "ResourceKey"
                };
                model.MigrationSource.ResourceContainers.Add(new ResourceContainer());
                model.MigrationSource.ResourceContainers[0].ResourceDefinitions.Add(new ResourceDefinition());
                model.MigrationSource.ResourceContainers[0].ResourceDefinitions[0].Resources.Add(new ResourceItem {
                    Key = "ResourceKey"
                });
            });

            "And an application with no pipelines"
            .x(() =>
            {
                applicationTwo = new BizTalkApplication()
                {
                    Name = "ApplicationTwo"
                };

                group.Applications.Add(
                    new ParsedBizTalkApplication
                {
                    Application = applicationTwo
                });
            });

            "And a context"
            .x(() => context = new MigrationContext());

            "And a BizTalk Pipeline Parser"
            .x(() => parser = new BizTalkPipelineParser(model, context, logger));

            "When parsing"
            .x(() => e = Record.Exception(() => parser.Parse()));

            "Then the parser should not throw an exception"
            .x(() => e.Should().BeNull());

            "And the error count should be 0"
            .x(() =>
            {
                context.Errors.Should().BeNullOrEmpty();
            });

            "And the document on the pipeline in the first application should be equivalent to the pipeline XML"
            .x(() =>
            {
                group.Applications.Should().HaveCount(2);
                group.Applications[0].Application.Pipelines.Should().NotBeNullOrEmpty().And.HaveCount(1);
                var pipeline = group.Applications[0].Application.Pipelines[0];
                group.Applications[0].Application.Pipelines[0].Document.Should().NotBeNull();

                // Validate the contents of the pipeline.
                pipeline.Document.FriendlyName.Should().Be(document.FriendlyName);
                pipeline.Document.Description.Should().Be(document.Description);
                pipeline.Document.Stages.Should().NotBeNullOrEmpty();
                pipeline.Document.Stages.Should().HaveCount(document.Stages.Length);
                pipeline.Document.Stages[0].Components.Should().NotBeNull();
                pipeline.Document.Stages[0].Components[0].Should().NotBeNull();
                pipeline.Document.Stages[0].Components[0].Name.Should().Be(document.Stages[0].Components[0].Name);
            });

            "And the pipeline resource should be created"
            .x(() =>
            {
                var pipeline = group.Applications[0].Application.Pipelines[0];
                var pipelineResourceDefinition = model.MigrationSource.ResourceContainers[0].ResourceContainers[0].ResourceContainers[0].ResourceDefinitions[0];
                pipelineResourceDefinition.Should().NotBeNull();
                pipelineResourceDefinition.Resources.Should().NotBeNullOrEmpty();
                pipelineResourceDefinition.Resources.Should().HaveCount(1);

                var pipelineResource = pipelineResourceDefinition.Resources[0];
                pipelineResource.Name.Should().Be(pipeline.Name);
                pipelineResource.Type.Should().Be(ModelConstants.ResourceReceivePipeline);
                pipelineResource.Key.Should().NotBeNullOrEmpty();
                pipelineResource.Key.Should().Be(pipeline.ResourceKey);
                pipelineResource.Description.Should().Be(pipeline.Description);
                pipelineResource.ResourceRelationships.Should().HaveCount(1);
            });

            "And the the pipeline collection in the second applcation should be empty"
            .x(() =>
            {
                group.Applications.Should().HaveCount(2);
                group.Applications[1].Application.Pipelines.Should().BeNullOrEmpty();
            });
        }