Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Improvement Plan for Project Automation Test Architecture-DataProviderEngine Architecture

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

In order to parse based on the architecture of our xml file above, I wrote a DataProviderEngine as the engine for parsing xml files. Its main architecture is as follows:

The details are as follows. In order to save time, I copied the contents of my English email directly:

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 element with the actual xml fragments one by one.

Step 4: After replacing all, 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, 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, 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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report