public TbwConfiguration Parse(XElement inputElement) { var configuration = new TbwConfiguration(); var applicationElement = inputElement.Element(XmlnsConstant.ConfigNamespace + "application"); configuration.Name = inputElement.Attribute("name").Value; configuration.RepoInstanceName = inputElement.Element(XmlnsConstant.ConfigNamespace + "repoInstanceName").Value; var servicesElement = inputElement.Element(XmlnsConstant.ConfigNamespace + "services"); configuration.ServicesConfig = new TbwServiceConfig(); if (servicesElement.Elements(XmlnsConstant.ConfigNamespace + "adapter") != null) { configuration.ServicesConfig.TbwAdapters = this.GetTbwAdapters(servicesElement.Elements(XmlnsConstant.ConfigNamespace + "adapter")); } if (servicesElement.Elements(XmlnsConstant.ConfigNamespace + "bw") != null) { configuration.ServicesConfig.TbwProcessContainers = this.TbwProcessContainers(servicesElement.Elements(XmlnsConstant.ConfigNamespace + "bw")); } return(configuration); }
public void SetUp() { this.configurationParser = new ConfigurationParser(); this.xml = @"<?xml version=""1.0"" encoding=""UTF-8"" ?> <application xmlns=""http://www.tibco.com/xmlns/ApplicationManagement"" name=""PNOEXP/tibcoae-pno_monthly""> <repoInstanceName>%%DOMAIN%%-tibcoae-pno_monthly</repoInstanceName> <contact>Marius STAN</contact> <services> <adapter name=""IFSAdapter.aar""> <enabled>false</enabled> </adapter> <bw name=""Panorama.par""> <enabled>true</enabled> <bwprocesses> <bwprocess name=""Process/DAI/PNO/Monitoring/PrMonitoring.IFS.FileInput.process""> <starter>PubInstrument Subscriber</starter> <enabled>true</enabled> <maxJob>1</maxJob> <activation>true</activation> <flowLimit>1</flowLimit> </bwprocess> <bwprocess name=""Process/DAI/PNO/Routing/EVLOTC/ProcessTRS.process""> <starter>Timer</starter> <enabled>false</enabled> <maxJob>0</maxJob> <activation>true</activation> <flowLimit>0</flowLimit> </bwprocess> </bwprocesses> </bw> </services> </application> "; config = this.configurationParser.Parse(XElement.Parse(this.xml)); }