Eureka AIR delivers breakthrough ideas for toughest innovation challenges, trusted by R&D personnel around the world.

Interface mock method and interface test method

A technology of interface testing and interface, which is applied in the field of data computer software, can solve the problems that SOAPUI does not support interface Mock, cannot support testing, etc., and achieves the effects of easy maintenance and use, decoupling dependencies, and fast and convenient maintenance

Inactive Publication Date: 2017-09-19
BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF5 Cites 26 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, although tools such as SOAPUI do not need to write code, they only support webservice and Rest protocol interfaces, and cannot support testing for some complex protocol interfaces such as hessian and Saf interfaces
In addition, SOAP UI does not support interface Mock

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Interface mock method and interface test method
  • Interface mock method and interface test method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0047] For the Saf interface, the user configures the interface name on the test platform, selects the corresponding interface type, method name, primary parameter name, input and output data, and stores these information in the database of the interface test platform. This is mainly for MOCK data and input Match the parameters to achieve the logic of the data.

[0048] The client implements the com.alibaba.dubbo.rpc.Filter interface, and the filter interface includes the Filter class, which is used to intercept the request sent by the client to implement the Invoke method. For example, Saf 1.0.8 provides a function. All Saf clients will call the invoke method of the Filter class before executing the method of remote calling the server. When the client needs to call the server interface, it will use the invoke method according to the interface name. Version number, Group (group), go to the platform to find the interface of the specified publisher.

[0049]There is also a Mock...

Embodiment 2

[0052] For the HTTP interface and Webservice interface, configure the interface name on the interface test platform, select the corresponding interface type, method name, primary parameter name, input and output data, the default Mock interface is closed, click to call the real interface.

[0053] If the interface type is selected as HTTP type, the background calls the real interface according to the request method of the HTTP interface, then modify the returned json string to the field of the corresponding parameter, and save it into the database. After saving, generate a unique interface address such as:

[0054] http: / / test.webserivce.jd.com / com_test_webserivice, replace the interface in the environment configuration file with this URL to realize the mock of the HTTP interface.

[0055] If the interface is selected as the Webservice type published by the CXF framework, the background will request the real interface method in the form of Webservice, parse the returned xml in...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides an interface mock method and an interface test method. An interface is tested by configuring input data and output data of the interface in an interface test platform. The interface mock method comprises the steps of firstly obtaining a request sent to a server by a client; secondly analyzing the request to obtain the interface needed to be called by the client; thirdly configuring interface information of the interface in the interface test platform; and finally according to the interface information, configuring the input data and the output data of the interface in the interface test platform. According to the interface mock method and the interface test method, test personnel can be assisted to quickly realize interface Mock only through configuration information without programming, so that the interface test efficiency is greatly improved.

Description

technical field [0001] The invention relates to the field of data computer software, in particular to an interface mock method for an interface test platform and an interface test method based on the interface test platform. Background technique [0002] Traditional interface testing is a test for testing the interface between system components. Interface testing is mainly used to detect the interaction points between external systems and internal subsystems. The focus of the test is to check the exchange of data, the process of delivery and control management, and the mutual logical dependencies between the systems. The current implementation is mainly by developers or white-box test engineers who write their own programs to call or use some tools to perform interface tests. This method requires a relatively high level of programming for testers, and there is no good tool that can support all interface types. For example, mainstream tools like SOAPUI only support interfac...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/36
Inventor 贾鸥谭鹏飞
Owner BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Eureka Blog
Learn More
PatSnap group products