為了基于上文我們的xml文件的架構(gòu),對其進(jìn)行解析,我自己寫了一個DataProviderEngine作為解析xml文件的引擎,它主要的架構(gòu)如下圖:
創(chuàng)新互聯(lián)公司作為成都網(wǎng)站建設(shè)公司,專注網(wǎng)站建設(shè)公司、網(wǎng)站設(shè)計,有關(guān)企業(yè)網(wǎng)站制作方案、改版、費用等問題,行業(yè)涉及成都軟裝設(shè)計等多個領(lǐng)域,已為上千家企業(yè)服務(wù),得到了客戶的尊重與認(rèn)可。

具體細(xì)節(jié)如下,為了節(jié)省時間,我直接復(fù)制我的英文郵件內(nèi)容了:
Step 1: The XMLReader read the raw test suite xml file (now we adopt the xml file ,since it is not binary file and easy to edit and version control)
Step 2: After reading ,XMLReader store the xml string into a string variable named “ originalXmlString “, this is our starting point.
Step 3: The XIncludeConverter read the originalXmlString ,and resolve the XInclude namespace ,when it resolve this file ,it will replace all the <xi:include href> element with the actual xml fragments one by one.
Step 4: After replacing all <xi:include> ,XIncludeConverter will store the new xml string into string variable named “convertedXmlString”.
Step 5: The XMLManipulator read the convertedXmlString ,and remove all the user configuration part from such as <add_elements>,<update_elements>,<remove_elements> ,since these information is used for letting test case end user configure how to operate the base data to meet special requirements,so these part shouldn’t exist in final data.
Step 6:After removing all config elements ,The XMLManipulator store the xml string into a new string variable named “ removeAllConfXmlString”
Step 7:Since the configuration information are removed in Step 5-6 ,but they still exist in original xml string ,so XMLModifyInfoExtractor read all the <add_elements>,<update_elements>,<remove_elements> part from original xml string ,and smartly match which corresponding testcase data it will operate .
Step 8:After analyzing all the user modification requirement ,the XMLModifyInfoExtractor store these modification info into 3 arraylists , addElementInfoList,updateElementInfoList,removeElementInfoList.
Step 9:Now it is time to begin modifying the xml ,so the XMLManipulator read the “removeAllConfXmlString” in Step 6 .
Step 10:Then XMLManipulator use all the modification info in Step 8 ,and do modification operation one by one : addElementToXML() ,updateElementFromXML(),removeElementFromXML()
Step 11: after finish all the modification ,XMLManipulator store the final xml string into string variable named “modifiedXmlString”
Step 12: Finally it convert the xml formatted string to a jsonobject and it now can be used as a data provider which can be consumed in each test case.
標(biāo)題名稱:關(guān)于項目自動化測試架構(gòu)的改良計劃-DataProviderEngine架構(gòu)
轉(zhuǎn)載來于:http://chinadenli.net/article32/jijdsc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站收錄、網(wǎng)站維護(hù)、面包屑導(dǎo)航、、企業(yè)網(wǎng)站制作
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)