标签:
public String getPAUrl(){ String PAUrl = ""; try { String filePath = System.getProperty ("user.dir").toString()+"/src/test/resources/config/environment.xml"; logger.info("The path of environment.xml is : "+filePath); File file = new File(filePath); SAXReader saxReader = new SAXReader(); Document document = saxReader.read(file); String currentEnv = Util.getEnvStr(); Element el =XmlUtil.getSingleElement(document, "/root/environment[@type=‘" + currentEnv + "‘]/PAUrl"); PAUrl = XmlUtil.getElementValue(el, "No default PA URL"); logger.info("PA Url : "+PAUrl); } catch (DocumentException e) { e.printStackTrace(); } return PAUrl; }
标签:
原文地址:http://www.cnblogs.com/MasterMonkInTemple/p/5190229.html