CN105162646B - A kind of multi-protocol interface test system and method - Google Patents

A kind of multi-protocol interface test system and method Download PDF

Info

Publication number
CN105162646B
CN105162646B CN201510454260.0A CN201510454260A CN105162646B CN 105162646 B CN105162646 B CN 105162646B CN 201510454260 A CN201510454260 A CN 201510454260A CN 105162646 B CN105162646 B CN 105162646B
Authority
CN
China
Prior art keywords
interface
data
interfaces
measured
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510454260.0A
Other languages
Chinese (zh)
Other versions
CN105162646A (en
Inventor
谭鹏飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201510454260.0A priority Critical patent/CN105162646B/en
Publication of CN105162646A publication Critical patent/CN105162646A/en
Application granted granted Critical
Publication of CN105162646B publication Critical patent/CN105162646B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a kind of multi-protocol interfaces to test system and method, the system includes dispensing unit, call unit, execution unit and comparing unit, wherein configuration of described dispensing unit interface parameters, call unit is according to interface parameters, local interface is called, obtains expected data, execution unit is according to interface parameters, call interface to be measured, test data is obtained, comparing unit compares expected data and test data, obtains test result.The present invention can test main webservice interfaces, http interfaces and Saf interfaces, need not can be achieved with interface testing, and a large amount of interfaces and the operation of data energy rapid batch by writing program, and can Fast-Maintenance interface data.

Description

A kind of multi-protocol interface test system and method
Technical field
The invention belongs to computer testing fields, especially design a kind of multi-protocol interface test system and method.
Background technology
Traditional interface testing refers to the interface between test system components.Interface testing mainly for detection of external system with Interaction point between system and between internal subsystems, the emphasis of test is the exchange of data to be checked, transmits and controls Mutual logic dependencies etc. between management process and system processed.Current realization is mainly surveyed by developer or whitepack Engineer is tried, program oneself is write and goes to call or go to execute interface testing using some tools.
SoapUI is the interface testing tool of current industry mainstream, provides simple interface, provides interface IP address and parameter Type, so that it may which to support the interface testing of webservice and Rest agreements, however existing interface testing tool is with following Defect:
1. the interface such as HTTP interface and Saf interfaces for some complex protocols cannot be supported to test;
2. being currently the system towards SOA framework, interface is especially more, and traditional interface testing is all to need oneself to write to connect Mouth calls code to realize interface testing, and threshold is relatively high, therefore common test personnel realize that interface testing is relatively difficult;
3. since inputoutput data is too many, the interface testing tool of mainstream can not disposably realize large batch of connect at present Mouthful, mass data is performed simultaneously;
4. there are many usual number of interface data, an interface may correspond to hundreds of test datas, if newly-increased or change word Section, the expected result of hundreds of datas must all be changed, and maintenance workload is bigger.
Invention content
(1) technical problems to be solved
The purpose of the present invention is to provide a kind of multi-protocol interfaces to test system and method, can be to main webservice Interface, http interfaces and Saf interfaces are tested, and need not can be achieved with interface testing by writing program, and largely connect Mouth and the operation of data energy rapid batch, and can Fast-Maintenance interface data.
(2) technical solution
The present invention provides a kind of multi-protocol interface test system, including dispensing unit, call unit, execution unit and comparison Unit, wherein:
Dispensing unit is for configuring interface parameters;
Call unit calls local interface, obtains expected data according to interface parameters;
Execution unit calls interface to be measured, obtains test data according to interface parameters;
Comparing unit obtains test result for comparing expected data and test data.
The present invention also provides a kind of multi-protocol interface test methods, which is characterized in that includes the following steps:
S1 calls local interface, obtains expected data according to interface parameters;
S2 calls interface to be measured, obtains test data according to the interface parameters;
S3 compares the expected data and the test data, obtains test result.
(3) advantageous effect
Multi-protocol interface provided by the invention tests system and method, has the following advantages:
1, by carrying out relevant parameter configuration to not interface so that can to the interface of different agreement (webservice interfaces, HTTP interface and Saf interfaces) it is tested, improve testing efficiency.
2, the present invention can realize interface testing by way of configuring, and without writing code, be suitable for all testers Member.
3, because foreground interface initiate test request after, background server receive request after execution task is distributed to it is more Platform executes and concurrently executes task on machine, and more machines are performed simultaneously task, thus can rapid batch a large amount of interface of operation and Test data.
4, the present invention by test data all can persistence be stored in inside database, can Fast-Maintenance interface data.
Description of the drawings
Fig. 1 is the structural schematic diagram of multi-protocol interface test system provided in an embodiment of the present invention.
Fig. 2 is the fundamental diagram of multi-protocol interface test system provided in an embodiment of the present invention.
Fig. 3 is the flow chart of multi-protocol interface test method provided in an embodiment of the present invention.
Specific implementation mode
The present invention provides a kind of multi-protocol interface test system, including dispensing unit, call unit, execution unit and comparison Unit, wherein configuration of described dispensing unit interface parameters, call unit call local interface according to interface parameters, obtain it is expected number According to execution unit calls interface to be measured according to interface parameters, obtains test data, and comparing unit compares expected data and test Data obtain test result.
In one embodiment, interface parameters include interface type, interface IP address, interface method name, version number, Group and input data, wherein interface type may include Saf interfaces, HTTP interface and webservice interfaces, interface IP address Refer to the URL of interface to be measured, interface method name is the title of interface method to be measured, and version number is the distinctive attribute of Saf interfaces It is used cooperatively with subsequent group fields, group refers to the grouping where interface, and input data refers to the input ginseng of interface Number, including legal input parameter and illegal input parameter.
In one embodiment, call unit calls corresponding local interface according to interface type, and input data is defeated Enter to local interface, obtain output data, and check whether the output data is correct, if correctly, output data is saved as Expected data.
In one embodiment, if local interface and the interface to be measured are Saf interfaces, execution unit is by interface method Name, group and version number encapsulate to HTTP request, and HTTP request is sent Rest interfaces, and Rest interfaces are according to interface method Name, group and version number find Saf interfaces to be measured, and input data is input to Saf interfaces to be measured, obtains test data.
In one embodiment, if local interface and interface to be measured are HTTP interface, execution unit by interface method name, Group and version number encapsulate to HTTP request, and by HTTP request transmission interface address, find HTTP interface to be measured, will be defeated Enter data and be input to HTTP interface to be measured, obtains test data.
In one embodiment, if local interface and interface to be measured are webservice interfaces, execution unit is according to visitor The mode of webservice interfaces is called at family end, is called webservice interfaces to be measured, input data is input to be measured Webservice interfaces, obtain test data.
In one embodiment, which further includes database, for storing the expected data.
In one embodiment, comparing unit carries out global registration or local matching to expected data and test data, Obtain test result, wherein global registration refers to the comparison of full text, and local matching refers to the matching of part field, is joined in output Number does not change every time in the case that, global registration is carried out, in the case where the non-key field of output parameter often changes, is carried out Local matching.
The present invention also provides a kind of multi-protocol interface test methods, which is characterized in that includes the following steps:
S1 calls local interface, obtains expected data according to interface parameters;
S2 calls interface to be measured, obtains test data according to the interface parameters;
S3 compares the expected data and the test data, obtains test result.
Multi-protocol interface provided by the invention tests system and method, can be connect to main webservice interfaces, http Mouth and Saf interfaces are tested, and need not can be achieved with interface testing by writing program, and a large amount of interfaces and data can be fast Fast batch is run, and can Fast-Maintenance interface data.
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with specific embodiment, and reference Attached drawing, the present invention is described in more detail.
Fig. 1 is the structural schematic diagram of multi-protocol interface test system provided in an embodiment of the present invention, as shown in Figure 1, more associations View interface test system includes dispensing unit, call unit, execution unit and comparing unit, wherein:
Configuration of described dispensing unit interface parameters, interface parameters include interface type, interface IP address, interface method name, version number, Group and input data.
For example, for saf interfaces:
<saf:Registryid=" jdZooKeeper " protocol=" jdZooKeeper " address=" jdZooK eeper://192.168.150.119,192.168.150.120,192.168.150.121:2181 " timeout=" 10000 " Wait=" 0 "/><saf:Referenceid=" IServiceExecTask " interface=" Com.jd.service.IServerExecTask " version=" 1.0 " group=" coo-easy-test-service ">
Wherein, the value of Addreess is exactly the address where interface, and by interface titles version and Whether unique the value of group, distinguishing interface be.Because each interface may issue multiple versions.Input data refers to The input parameter of the method for this interface is waited for if getOrderById (String orderid) belongs to some interface to be measured Survey method is getOrderById, is passed to different parameters, and such as input parameters such as 0000,12345678 go test this method.
For HTTP or webservice interfaces:
The URL that the interface IP address of HTTP interface is, such as http://qone.jd.com/system/delete, input parameter {"code":0,"systemid":1001 }, the interface URL of Webservice is typically an address wsdl or wadl, such as http://localhost:8080/helloWorldWsdl, input parameter are for the method under this address, such as SayHello (String word) method, value of the input parameter aiming at this method.
Call unit calls corresponding local interface according to interface type, and input data is input to local interface, is obtained Output data, and check whether the output data is correct, if correctly, output data is saved as expected data, wherein interface Type may include Saf interfaces, HTTP interface and webservice interfaces.
If local interface and the interface to be measured are Saf interfaces, execution unit is by interface method name, group and version number Encapsulation sends Rest interfaces to HTTP request, and by HTTP request, and Rest interfaces are according to interface method name, group and version number Saf interfaces to be measured are found, input data is input to Saf interfaces to be measured, obtains test data.
If local interface and interface to be measured are HTTP interface, execution unit encapsulates interface method name, group and version number To HTTP request, and by HTTP request transmission interface address, HTTP interface to be measured is found, input data is input to be measured HTTP interface obtains test data.
If local interface and interface to be measured are webservice interfaces, execution unit is according to client call webservice The mode of interface calls webservice interfaces to be measured, and input data is input to webservice interfaces to be measured, is obtained Test data.
Comparing unit carries out global registration or local matching to expected data and test data, obtains test result.
It please refers to shown in Fig. 2, obtained expected data is stored in database by multi-protocol interface test system, is facilitated The maintenance in later stage.Meanwhile the present embodiment carries out data exchange using routing with interface to be measured, and distinct interface is stored in routing Method for routing different interfaces is found by different method for routing.
Fig. 3 is the flow chart of multi-protocol interface test method provided in an embodiment of the present invention, as shown in figure 3, method includes:
S1 calls corresponding local interface according to the interface type, and the input data, which is input to the local, to be connect Mouthful, output data is obtained, and check whether the output data is correct, if correctly, the output data is saved as desired number According to, and expected data stores in a database.
S2 encapsulates interface method name, group and version number to HTTP if local interface and interface to be measured are Saf interfaces Request, and HTTP request is sent into Rest interfaces, Rest interfaces find to be measured according to interface method name, group and version number Input data is input to Saf interfaces to be measured, obtains test data by Saf interfaces;If local interface and interface to be measured are HTTP Interface encapsulates interface method name, group and version number to HTTP request, and by HTTP request transmission interface address, finds and wait for Input data is input to HTTP interface to be measured, obtains test data by the HTTP interface of survey;If local interface and interface to be measured Webservice interfaces to be measured are called according to the mode of client call webservice interfaces for webservice interfaces, Input data is input to webservice interfaces to be measured, obtains test data.
S3 carries out global registration or local matching to expected data and test data, obtains test result.
It is worth noting that multi-protocol interface provided by the invention tests system and method, interface type is not limited to The interface of Saf, HTTP, Web Service three types can be configured on demand, to be extended to any type of interface.
Particular embodiments described above has carried out further in detail the purpose of the present invention, technical solution and advantageous effect It describes in detail bright, it should be understood that the above is only a specific embodiment of the present invention, is not intended to restrict the invention, it is all Within the spirit and principles in the present invention, any modification, equivalent substitution, improvement and etc. done should be included in the guarantor of the present invention Within the scope of shield.

Claims (18)

1. a kind of multi-protocol interface tests system, which is characterized in that including dispensing unit, call unit, execution unit and comparison Unit, wherein:
For configuring interface parameters, the interface parameters includes the dispensing unit:Information, use for distinguishing interface uniqueness In the input data of test interface;
The call unit calls local interface, obtains expected data according to the interface parameters;
The execution unit calls interface to be measured, obtains test data according to the interface parameters;
The comparing unit obtains test result for comparing the expected data and the test data.
2. multi-protocol interface according to claim 1 tests system, which is characterized in that the interface parameters includes interface class Type, interface IP address, interface method name, version number, group and input data.
3. multi-protocol interface according to claim 2 tests system, which is characterized in that the call unit connects according to Mouth type, calls corresponding local interface, the input data is input to the local interface, obtains output data, and examine Whether correct the output data is looked into, if correctly, the output data is saved as expected data.
4. multi-protocol interface according to claim 2 tests system, which is characterized in that the interface type includes that Saf connects Mouth, HTTP interface and webservice interfaces.
5. multi-protocol interface according to claim 4 tests system, which is characterized in that if the local interface and described waiting for Survey interface is Saf interfaces, and the execution unit encapsulates interface method name, group and version number to HTTP request, and by HTTP Request sends Rest interfaces, and the Rest interfaces find Saf to be measured according to the interface method name, group and version number and connect Mouthful, the input data is input to the Saf interfaces to be measured, obtains test data.
6. multi-protocol interface according to claim 4 tests system, which is characterized in that if the local interface and described waiting for Survey interface is HTTP interface, and the execution unit encapsulates interface method name, group and version number to HTTP request, and will HTTP request sends the interface IP address, finds HTTP interface to be measured, the input data is input to described to be measured HTTP interface obtains test data.
7. multi-protocol interface according to claim 4 tests system, which is characterized in that if the local interface and described waiting for Survey interface is webservice interfaces, and the execution unit is waited for according to the modes of client call webservice interfaces, calling The input data is input to the webservice interfaces to be measured, obtains test data by the webservice interfaces of survey.
8. multi-protocol interface according to claim 1 tests system, which is characterized in that further include database, for storing The expected data.
9. multi-protocol interface according to claim 1 tests system, which is characterized in that the comparing unit is to the expectation Data and the test data carry out global registration or local matching, obtain test result.
10. a kind of multi-protocol interface test method, which is characterized in that include the following steps:
S1 calls local interface, obtains expected data according to interface parameters;
S2 calls interface to be measured, obtains test data according to the interface parameters;
S3 compares the expected data and the test data, obtains test result;
Wherein, the interface parameters includes:Information for distinguishing interface uniqueness, the input data for test interface.
11. multi-protocol interface test method according to claim 10, which is characterized in that the interface parameters includes interface Type, interface IP address, interface method name, version number, group and input data.
12. multi-protocol interface test method according to claim 11, which is characterized in that the S1 includes:
According to the interface type, corresponding local interface is called, the input data is input to the local interface, is obtained Output data, and check whether the output data is correct, if correctly, the output data is saved as expected data.
13. multi-protocol interface test method according to claim 11, which is characterized in that the interface type includes Saf Interface, HTTP interface and webservice interfaces.
14. multi-protocol interface test method according to claim 13, which is characterized in that if the local interface and described Interface to be measured is Saf interfaces, and the S2 includes:
Interface method name, group and version number are encapsulated to HTTP request, and HTTP request is sent into Rest interfaces, it is described Rest interfaces find Saf interfaces to be measured according to the interface method name, group and version number, and the input data is inputted To the Saf interfaces to be measured, test data is obtained.
15. multi-protocol interface test method according to claim 13, which is characterized in that if the local interface and described Interface to be measured is HTTP interface, and the S2 includes:
Interface method name, group and version number are encapsulated to HTTP request, and HTTP request is sent into the interface IP address, is looked for To HTTP interface to be measured, the input data is input to the HTTP interface to be measured, obtains test data.
16. multi-protocol interface test method according to claim 13, which is characterized in that if the local interface and described Interface to be measured is webservice interfaces, and the S2 includes:
According to the mode of client call webservice interfaces, webservice interfaces to be measured are called, by the input number According to the webservice interfaces to be measured are input to, test data is obtained.
17. multi-protocol interface test method according to claim 10, which is characterized in that the expected data stores one In database.
18. multi-protocol interface test method according to claim 10, which is characterized in that the S3 includes:
Global registration or local matching are carried out to the expected data and the test data, obtain test result.
CN201510454260.0A 2015-07-29 2015-07-29 A kind of multi-protocol interface test system and method Active CN105162646B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510454260.0A CN105162646B (en) 2015-07-29 2015-07-29 A kind of multi-protocol interface test system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510454260.0A CN105162646B (en) 2015-07-29 2015-07-29 A kind of multi-protocol interface test system and method

Publications (2)

Publication Number Publication Date
CN105162646A CN105162646A (en) 2015-12-16
CN105162646B true CN105162646B (en) 2018-09-11

Family

ID=54803407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510454260.0A Active CN105162646B (en) 2015-07-29 2015-07-29 A kind of multi-protocol interface test system and method

Country Status (1)

Country Link
CN (1) CN105162646B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598838B (en) * 2016-10-19 2019-07-19 广州品唯软件有限公司 OSP system detection method and device
CN106506210B (en) * 2016-11-04 2020-01-24 广东亿迅科技有限公司 Method and system for integrating multiple protocols to realize interface interfacing
CN107070735B (en) * 2016-12-30 2018-04-20 上海壹账通金融科技有限公司 Method, test terminal and the system of asynchronous interface test
CN106960348B (en) * 2017-03-24 2020-07-03 泰华智慧产业集团股份有限公司 Payment docking method and payment docking system
CN107171897A (en) * 2017-07-14 2017-09-15 上海瀚银信息技术有限公司 A kind of interface test method and data-interface test system
CN108600048B (en) * 2018-04-12 2021-10-08 平安科技(深圳)有限公司 Interface testing method, device, equipment and computer readable storage medium
CN108681507A (en) * 2018-05-08 2018-10-19 浪潮软件集团有限公司 Method for realizing automatic testing of RESTful API and web service
CN111382050B (en) * 2018-12-29 2023-08-18 航天信息股份有限公司 Network service interface testing method and device
CN111562490B (en) * 2019-02-14 2023-01-20 深圳市汇顶科技股份有限公司 Test method and system
CN110333897A (en) * 2019-05-09 2019-10-15 重庆天蓬网络有限公司 A kind of interface allocation method, device, medium and electronic equipment
CN111090588A (en) * 2019-12-12 2020-05-01 京东数字科技控股有限公司 Test method, device, system, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212357A (en) * 2006-12-31 2008-07-02 亿阳信通股份有限公司 Interface testing method and device
CN104639390A (en) * 2014-12-31 2015-05-20 曙光信息产业(北京)有限公司 Method and device for testing system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8099629B2 (en) * 2006-07-14 2012-01-17 Marvell World Trade Ltd. System-on-a-chip (SoC) test interface security

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212357A (en) * 2006-12-31 2008-07-02 亿阳信通股份有限公司 Interface testing method and device
CN104639390A (en) * 2014-12-31 2015-05-20 曙光信息产业(北京)有限公司 Method and device for testing system

Also Published As

Publication number Publication date
CN105162646A (en) 2015-12-16

Similar Documents

Publication Publication Date Title
CN105162646B (en) A kind of multi-protocol interface test system and method
US10496605B2 (en) Application deployment for data intake and query system
US7647370B1 (en) Screen scraping interface
CN104750469B (en) Source code statistical analysis technique and system
RU2648966C2 (en) Apparatus and method for processing multiple open api
US20140279835A1 (en) Self-analyzing data processing job to determine data quality issues
CN108200111B (en) Resource configuration information updating method and device and resource interface equipment
Soldani et al. The μTOSCA toolchain: Mining, analyzing, and refactoring microservice‐based architectures
US8726298B1 (en) Cloud-based instrument driver system
KR100945282B1 (en) Verifying method for implementing management software
WO2020244307A1 (en) Vulnerability detection method and apparatus
US20200117587A1 (en) Log File Analysis
US20200293310A1 (en) Software development tool integration and monitoring
CN113360377B (en) Test method and device
CN104899134A (en) Automatic domain name registration server testing system and method
US10873628B2 (en) System and method for non-intrusive context correlation across cloud services
WO2008000143A1 (en) Method for equipment quality check, method and device for automatically adapting quality check data
CN113347060B (en) Method, device and system for detecting power network fault based on process automation
US8738755B2 (en) Providing external access to service versions via a bundle framework
CN114237821A (en) Self-discovery method and device for Kubernetes container cluster, electronic device and storage medium
CN111447273A (en) Cloud processing system and data processing method based on cloud processing system
CN105204870B (en) The access method of shell script, apparatus and system
CN111651330A (en) Data acquisition method and device, electronic equipment and computer readable storage medium
CN108270604B (en) Method and system for tracking service data change
CN106156339B (en) The access method of declaration form management system, apparatus and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant