CN112069078B - ESA interface pressure test method, ESA interface pressure test device, ESA interface pressure test equipment and storage medium - Google Patents

ESA interface pressure test method, ESA interface pressure test device, ESA interface pressure test equipment and storage medium Download PDF

Info

Publication number
CN112069078B
CN112069078B CN202010967715.XA CN202010967715A CN112069078B CN 112069078 B CN112069078 B CN 112069078B CN 202010967715 A CN202010967715 A CN 202010967715A CN 112069078 B CN112069078 B CN 112069078B
Authority
CN
China
Prior art keywords
esa
pressure test
interface
test
esasample
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
CN202010967715.XA
Other languages
Chinese (zh)
Other versions
CN112069078A (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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202010967715.XA priority Critical patent/CN112069078B/en
Publication of CN112069078A publication Critical patent/CN112069078A/en
Application granted granted Critical
Publication of CN112069078B publication Critical patent/CN112069078B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance

Abstract

The invention relates to the technical field of software testing, and provides an ESA interface pressure testing method, an ESA interface pressure testing device, ESA interface pressure testing equipment and a storage medium, wherein the ESA interface pressure testing method comprises the following steps of: packaging the test parameters input in the ESA interactive interface to obtain request parameters; packaging the request parameters in the Esasample class to obtain a packaging request; responding to the packaging request, and calling an ESA interface in a generalized calling mode to perform pressure test of the round; after the pressure test of the round is finished, response data returned by the ESA interface are obtained, and the response data are transmitted to the Esasample class; judging whether the execution of the Sample method in the Esasample class of the round pressure test is passed or not according to the response data by the Esasample class; after determining that the Sample method in the Esasample class passes, calling the ESA interface by adopting a generalized calling mode to perform the pressure test of the next round. The invention can directly call the ESA interface to carry out pressure test. In addition, the invention also relates to the technical field of block chains, and a test report generated after the pressure test is finished is stored in the block chain.

Description

ESA interface pressure test method, ESA interface pressure test device, ESA interface pressure test equipment and storage medium
Technical Field
The invention relates to the technical field of software testing, in particular to an ESA interface pressure testing method, an ESA interface pressure testing device, ESA interface pressure testing equipment and a storage medium.
Background
The bank ESA interface is an interface protocol based on a bank-specific framework for internal system calls, and is the most used interface type for internal systems.
When a tester is in a bank to press and test an ESA interface, a special Http protocol to ESA interface needs to be developed, transfer service needs to be independently developed, the cost is high, the call is inconvenient, and the ESA interface test efficiency is low; and the performance of the transfer service may cause inaccurate pressure measurement results, and deviate from a real test scene.
Therefore, it is necessary to provide a solution that can directly call the ESA interface for pressure testing.
Disclosure of Invention
In view of the above, it is necessary to provide a method, a device, a test apparatus and a storage medium for testing pressure of an ESA interface, which can directly call the ESA interface to perform the pressure test, and has high test efficiency and accurate test result.
A first aspect of the present invention provides a method for testing ESA interface pressure, the method comprising:
acquiring test parameters input in an ESA interactive interface and packaging the test parameters to obtain request parameters;
Sending the request parameters to an Esasample class, and encapsulating the request parameters in the Esasample class to obtain an encapsulation request;
responding to the packaging request, and calling an ESA interface in a generalized calling mode to perform pressure test of the round;
after the pressure test of the round is finished, response data returned by the ESA interface are obtained, and the response data are transmitted to the Esasample class;
judging whether the execution of the Sample method in the Esasample class passes or not according to the response data;
and after determining that the Sample method in the Esasample class passes, calling the ESA interface to perform the next round of pressure test by adopting the generalized calling mode, and ending the pressure test when a preset pressure test ending condition is met.
According to an alternative embodiment of the present invention, before the obtaining the test parameters input in the ESA interface, the method further comprises:
receiving a starting instruction of a Jmeter frame, and running the Jmeter frame;
when detecting a determining instruction of a user to a Jmeter plug-in of a preset ESA interface in the Jmeter frame, displaying the ESA interactive interface;
and displaying the address of the alternative registry and the name of ESA interface service in the ESA interactive interface.
According to an alternative embodiment of the present invention, the developing process of the Jmeter plug-in of the preset ESA interface includes:
defining an Esasample class;
defining a sample method in the Esasample class;
inheriting an abstract sampler in the Jmeter framework through the EsaSample class;
and implementing the calling logic of ESA interface pressure test in the sample method.
According to an optional embodiment of the invention, the determining, according to the response data, whether the Sample method in the EsaSample class is executed by the Sample method includes:
acquiring index items of the ESA interface in the response data;
judging whether the index item accords with a preset pressure test index or not;
determining that the Sample method in the Esasample class is executed when the index item accords with the preset pressure test index;
and determining that the Sample method in the Esasample class is not executed when the index item does not accord with the preset pressure test index.
According to an optional embodiment of the invention, the determining whether the indicator item meets a preset pressure test indicator includes:
judging whether the index item is smaller than a preset index item threshold value or not;
When the index item is smaller than or equal to the preset index item threshold value, determining that the index item accords with the preset pressure test index;
and when the index item is larger than the preset index item threshold value, determining that the index item does not accord with the preset pressure test index.
According to an alternative embodiment of the present invention, the invoking the ESA interface to perform the next round of pressure testing includes:
simulating a first concurrent quantity to access the ESA interface in a first round of test;
and in the latter round of test, adding a preset concurrency amount on the basis of the concurrency amount of the former round of test to obtain a second concurrency amount, and simulating the second concurrency amount to access the ESA interface.
According to an alternative embodiment of the present invention, the preset pressure test ending condition includes: the number of rounds of performing the pressure test is greater than a preset number of rounds, and the concurrence of the pressure test for any round is greater than a preset concurrence, the method further comprising:
after the pressure test is finished, a test report is generated according to the concurrency of each round of test and the corresponding index item by adopting a preset format.
A second aspect of the invention provides an ESA interface pressure test device, said device comprising:
The first packaging module is used for acquiring the test parameters input in the ESA interactive interface and packaging the test parameters to obtain request parameters;
the second encapsulation module is used for sending the request parameters to an Esasample class and encapsulating the request parameters in the Esasample class to obtain an encapsulation request;
the pressure test module is used for responding to the packaging request and calling an ESA interface in a generalized calling mode to perform pressure test of the round;
the data transmission module is used for acquiring response data returned by the ESA interface after the pressure test of the round is finished, and transmitting the response data to the Esasample class;
the test judging module is used for judging whether the execution of the Sample method in the Esasample class passes or not according to the response data;
and the pressure test module is also used for calling the ESA interface to perform the pressure test of the next round by adopting the generalized calling mode after determining that the Sample method in the Esasample class passes, and ending the pressure test when the preset pressure test ending condition is met.
A third aspect of the present invention provides a test apparatus comprising:
a memory for storing a computer program;
And the processor is used for realizing the ESA interface pressure testing method when executing the computer program.
A fourth aspect of the present invention provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor implements the ESA interface pressure test method.
In summary, the method, the device, the test equipment and the storage medium for testing the ESA interface pressure do not need to develop a special HTTP protocol to transfer the ESA interface pressure test as in the prior art, and the process of transferring service is eliminated by developing a tool of an ESA interface Jmeter plug-in and integrating the tool into a Jmeter frame. The method can directly call the ESA interface to carry out pressure test through the JMter plug-in of the ESA interface in the JMter framework, so that the test process can be consistent with a real system call scene, the test efficiency is higher, and the test result is more accurate.
Drawings
Fig. 1 is a flowchart of an ESA interface pressure test method according to an embodiment of the present invention.
Fig. 2 is a block diagram of an ESA interface pressure test device according to a second embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a test apparatus according to a third embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will be more clearly understood, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. It should be noted that, without conflict, the embodiments of the present invention and features in the embodiments may be combined with each other.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
Fig. 1 is a flowchart of an ESA interface pressure test method according to an embodiment of the present invention. The ESA interface pressure testing method specifically comprises the following steps, the sequence of the steps in the flow chart can be changed according to different requirements, and some steps can be omitted.
S11, acquiring test parameters input in the ESA interactive interface and packaging the test parameters to obtain request parameters.
Wherein the test parameters may include, but are not limited to: the address of the registry, the name of the ESA interface service, etc.
Wherein, the test parameter may be in Json format.
In an alternative embodiment, before the obtaining the test parameters input in the ESA interaction interface, the method further comprises:
receiving a starting instruction of a Jmeter frame, and running the Jmeter frame;
when detecting a determining instruction of a user to a Jmeter plug-in of a preset ESA interface in the Jmeter frame, displaying the ESA interactive interface;
and displaying the address of the alternative registry and the name of ESA interface service in the ESA interactive interface.
The Jmeter framework is an open source testing tool developed based on java language and mainly used for testing. The user develops a customized sampler plug-in, firstly, a graphical interface of a sampler needs to be developed, and Abstract samplerGui class of the Meter is expanded and realized; then developing a processing logic class of the sampler, expanding an Abstract sampler class of the Meter, realizing protocol interaction, sending a request message and processing a returned response result; and finally compiling the developed and debugged code, and marking the code together with the pos.xml describing the dependency relationship into a JAR package, copying the JAR package to a lib/ext directory of the JFER, and copying other related dependent JAR packages to the lib directory of the JFER.
The development of the sampler plug-in for realizing customized ESA interface pressure test call requires the expansion of processing logic for creating a customized ESA interface pressure test sampler interface by using an org.apoche.jmeter.samplers.gui.abstract sampler guide abstract class and for completing the customized ESA interface pressure test sampler by using the org.apoche.jmeter.samplers.abstract.
The selection instruction may be triggered by the user clicking on the path of the ESA interface to be tested, or by the user entering the path of the ESA interface to be tested in a specific input box in the ESA interactive interface.
For example, if addresses of different registries and names of ESA interface services are displayed in the ESA interactive interface, or a drop-down button is displayed in the ESA interactive interface, when a user clicks the drop-down button corresponding to the ESA interface to be tested, the addresses of the registries and names of ESA interface services corresponding to the ESA interface to be tested are displayed in the ESA interactive interface.
In an alternative embodiment, the developing process of the Jmeter plug-in of the preset ESA interface includes:
defining an Esasample class;
defining a sample method in the Esasample class;
Inheriting an abstract sampler in the Jmeter framework through the EsaSample class;
and implementing the calling logic of ESA interface pressure test in the sample method.
The EsaSmale is a self-defined sampler, the sample is a method in the EsaSmale, and the Esasample class inherits the abstract sampler abstract sample, so that a Jmeter framework can call the sample method in the Esasample class when in operation, and the sample method realizes the calling logic of ESA interface pressure test.
S12, sending the request parameters to an Esasample class, and encapsulating the request parameters in the Esasample class to obtain an encapsulation request.
And the test equipment transmits the request parameters as the entry to the Esasample class, so that the Esasample class encapsulates the request parameters into an encapsulation request of a Map type.
S13, responding to the packaging request, and calling an ESA interface in a generalized calling mode to perform pressure test of the round.
The generalized call refers to a call of an independent application program interface (Application Programming Interface, API) package, so that the Jmeter plug-in of the ESA interface has more independence and usability.
And S14, after the pressure test of the round is finished, acquiring response data returned by the ESA interface, and transmitting the response data to the Esasample class.
When the ESA interface is called through the Jmeter plug-in of the preset ESA interface, the ESA interface responds and returns response data to the Jmeter plug-in of the preset ESA interface, and the response data is obtained through the Esasample class in the Jmeter plug-in of the preset ESA interface.
And S15, judging whether the execution of the Sample method in the Esasample class passes or not according to the response data.
Because more response data are returned each time the ESA interface responds, but the response data are not all the data required by the tester, the EsaSample class acquires a plurality of key data from the response data, assembles the plurality of key data, and judges whether the execution of the Sample method in the EsaSample class is passed or not according to the assembled data by the EsaSample class.
In an alternative embodiment, the determining, according to the response data, whether the Sample method in the EsaSample class is executed by a Sample method includes:
acquiring index items of the ESA interface in the response data;
judging whether the index item accords with a preset pressure test index or not;
determining that the Sample method in the Esasample class is executed when the index item accords with the preset pressure test index;
And determining that the Sample method in the Esasample class is not executed when the index item does not accord with the preset pressure test index.
In this alternative embodiment, multiple rounds of testing may be performed, and it is determined, during each round of testing, whether the index item of the ESA interface meets the preset pressure test index, and when it is determined that the index item of the ESA interface meets the preset pressure test index during a certain round of testing, the pressure test ending instruction of the round is triggered, and the pressure test of the ESA interface of the round is ended.
In an optional embodiment, the determining whether the indicator item meets a preset pressure test indicator includes:
judging whether the index item is smaller than a preset index item threshold value or not;
when the index item is smaller than or equal to the preset index item threshold value, determining that the index item accords with the preset pressure test index;
and when the index item is larger than the preset index item threshold value, determining that the index item does not accord with the preset pressure test index.
The index item may include: CPU utilization, network bandwidth, etc. And when the CPU utilization rate of the test node exceeds a preset CPU utilization rate threshold value or when the network bandwidth exceeds a preset network bandwidth threshold value, confirming that the index item does not accord with the preset pressure test index.
S16, after the fact that the Sample method in the Esasample class is executed is confirmed to pass, the ESA interface is called by adopting the generalized calling mode to conduct pressure test of the next round, and the pressure test is ended when a preset pressure test ending condition is met.
The execution of the Sample method in the Esasample class passes the pressure test at the same time, which shows that the ESA interface can also receive more concurrent access quantity, so that the pressure test can be continued.
The pressure test ending condition may be preset, and the entire process of the pressure test may be ended when the preset pressure test ending condition is satisfied. Wherein the pressure test ending condition may include: the cycle of performing the pressure test is greater than a preset cycle; alternatively, the pressure test is discontinued; or the concurrency of the pressure test of any round is greater than the preset concurrency.
In an alternative embodiment, the invoking the ESA interface to perform the next round of pressure testing comprises:
simulating a first concurrent quantity to access the ESA interface in a first round of test;
and in the latter round of test, adding a preset concurrency amount on the basis of the concurrency amount of the former round of test to obtain a second concurrency amount, and simulating the second concurrency amount to access the ESA interface.
Illustratively, in a first round of testing, a first concurrency is set to 100; in the second round of test, 100 concurrency is increased, namely, the ESA interface is simulated to be accessed in 200 concurrency; on the third round of testing, the ESA interface was accessed in 300 concurrency simulations.
Further, the method further comprises:
after the pressure test is finished, a test report is generated according to the concurrency of each round of test and the corresponding index item by adopting a preset format.
Since test reports generated directly by automatic test scripts after the test procedure is performed are often not in a fixed format, the readability of the test report is poor. And the test report is generated by adopting a preset format, so that the readability of the test report is enhanced, and the content in the test report is convenient for a tester to check and understand. The preset format may be an extensible markup language (XML, extensible Markup Language) format.
In summary, the present embodiment does not need to develop a special HTTP protocol to perform the pressure test of the intermediate ESA interface as in the prior art, and eliminates the intermediate services by developing a tool, i.e., an ESA interface Jmeter plug-in, and integrating the tool into the Jmeter framework. The method can directly call the ESA interface to carry out pressure test through the JMter plug-in of the ESA interface in the JMter framework, so that the test process can be consistent with a real system call scene, the test efficiency is higher, and the test result is more accurate.
The pressure test method of the ESA interface can be applied to a pressure test scene of the bank ESA interface, so that the test efficiency of the bank ESA interface pressure test is improved, and the test accuracy of the bank ESA interface pressure test is improved. In the specific implementation, a tester develops a Jmeter plug-in of a bank ESA interface and a customized bank ESA interactive interface in test equipment, so that an Esasample class in the Jmeter plug-in inherits an abstract sampler in a Jmeter frame, and therefore, the invoking logic of ESA interface pressure test is realized in a sample method of the Esasample class, and the consistency of a test process and a real system invoking scene can be ensured.
It is emphasized that to further ensure the privacy and security of the above-described test reports, the above-described test reports may be stored in nodes of the blockchain.
Fig. 2 is a block diagram of an ESA interface pressure test device according to a second embodiment of the present invention.
In some embodiments, the ESA interface pressure test means 20 may comprise a plurality of functional modules consisting of computer program segments. The computer program of each program segment in the ESA interface pressure test means 20 may be stored in the memory of the test device and executed by at least one processor to perform the functions of ESA interface pressure testing (described in detail with reference to fig. 1).
In this embodiment, the ESA interface pressure test device 20 may be divided into a plurality of functional modules according to the functions performed by the device. The functional module may include: a first packaging module 201, an interface display module 202, a plug-in development module 203, a second packaging module 204, a pressure test module 205, a data transmission module 206, a test judgment module 207, and a report generation module 208. The module referred to in the present invention refers to a series of computer program segments capable of being executed by at least one processor and of performing a fixed function, stored in a memory. In the present embodiment, the functions of the respective modules will be described in detail in the following embodiments.
The first packaging module 201 is configured to obtain a test parameter input in the ESA interface and package the test parameter to obtain a request parameter.
Wherein the test parameters may include, but are not limited to: the address of the registry, the name of the ESA interface service, etc.
Wherein, the test parameter may be in Json format.
The interface display module 202 is configured to display the ESA interaction interface before the test parameters input in the ESA interaction interface are obtained.
In an alternative embodiment, the interface display module 202 displays the ESA interaction interface comprising:
receiving a starting instruction of a Jmeter frame, and running the Jmeter frame;
when detecting a determining instruction of a user to a Jmeter plug-in of a preset ESA interface in the Jmeter frame, displaying the ESA interactive interface;
and displaying the address of the alternative registry and the name of ESA interface service in the ESA interactive interface.
The Jmeter framework is an open source testing tool developed based on java language and mainly used for testing. The user develops a customized sampler plug-in, firstly, a graphical interface of a sampler needs to be developed, and Abstract samplerGui class of the Meter is expanded and realized; then developing a processing logic class of the sampler, expanding an Abstract sampler class of the Meter, realizing protocol interaction, sending a request message and processing a returned response result; and finally compiling the developed and debugged code, and marking the code together with the pos.xml describing the dependency relationship into a JAR package, copying the JAR package to a lib/ext directory of the JFER, and copying other related dependent JAR packages to the lib directory of the JFER.
The development of the sampler plug-in for realizing customized ESA interface pressure test call requires the expansion of processing logic for creating a customized ESA interface pressure test sampler interface by using an org.apoche.jmeter.samplers.gui.abstract sampler guide abstract class and for completing the customized ESA interface pressure test sampler by using the org.apoche.jmeter.samplers.abstract.
The selection instruction may be triggered by the user clicking on the path of the ESA interface to be tested, or by the user entering the path of the ESA interface to be tested in a specific input box in the ESA interactive interface.
For example, if addresses of different registries and names of ESA interface services are displayed in the ESA interactive interface, or a drop-down button is displayed in the ESA interactive interface, when a user clicks the drop-down button corresponding to the ESA interface to be tested, the addresses of the registries and names of ESA interface services corresponding to the ESA interface to be tested are displayed in the ESA interactive interface.
The plug-in development module 203 is configured to develop a Jmeter plug-in of the ESA interface.
In an alternative embodiment, the process of developing the Jmeter plug-in of the preset ESA interface by the plug-in development module 203 includes:
defining an Esasample class;
defining a sample method in the Esasample class;
inheriting an abstract sampler in the Jmeter framework through the EsaSample class;
and implementing the calling logic of ESA interface pressure test in the sample method.
The EsaSmale is a self-defined sampler, the sample is a method in the EsaSmale, and the Esasample class inherits the abstract sampler abstract sample, so that a Jmeter framework can call the sample method in the Esasample class when in operation, and the sample method realizes the calling logic of ESA interface pressure test.
The second encapsulation module 204 is configured to send the request parameter to an EsaSample class and encapsulate the request parameter in the EsaSample class to obtain an encapsulated request.
And the test equipment transmits the request parameters as the entry to the Esasample class, so that the Esasample class encapsulates the request parameters into an encapsulation request of a Map type.
The pressure test module 205 is configured to respond to the package request, and call an ESA interface in a generalized call manner to perform the pressure test of the present round.
The generalized call refers to a call of an independent application program interface (Application Programming Interface, API) package, so that the Jmeter plug-in of the ESA interface has more independence and usability.
The data transmission module 206 is configured to obtain response data returned by the ESA interface after the pressure test of the present round is finished, and transmit the response data to the EsaSample class.
When the ESA interface is called through the Jmeter plug-in of the preset ESA interface, the ESA interface responds and returns response data to the Jmeter plug-in of the preset ESA interface, and the response data is obtained through the Esasample class in the Jmeter plug-in of the preset ESA interface.
The test judging module 207 is configured to judge whether the Sample method in the EsaSample class is executed according to the response data.
Because more response data are returned each time the ESA interface responds, but the response data are not all the data required by the tester, the EsaSample class acquires a plurality of key data from the response data, assembles the plurality of key data, and judges whether the execution of the Sample method in the EsaSample class is passed or not according to the assembled data by the EsaSample class.
In an alternative embodiment, the test determination module 207 determines whether the Sample method in the EsaSample class is performed by a method comprising:
acquiring index items of the ESA interface in the response data;
judging whether the index item accords with a preset pressure test index or not;
determining that the Sample method in the Esasample class is executed when the index item accords with the preset pressure test index;
and determining that the Sample method in the Esasample class is not executed when the index item does not accord with the preset pressure test index.
In this alternative embodiment, multiple rounds of testing may be performed, and it is determined, during each round of testing, whether the index item of the ESA interface meets the preset pressure test index, and when it is determined that the index item of the ESA interface meets the preset pressure test index during a certain round of testing, the pressure test ending instruction of the round is triggered, and the pressure test of the ESA interface of the round is ended.
In an optional embodiment, the determining whether the indicator item meets a preset pressure test indicator includes:
judging whether the index item is smaller than a preset index item threshold value or not;
when the index item is smaller than or equal to the preset index item threshold value, determining that the index item accords with the preset pressure test index;
and when the index item is larger than the preset index item threshold value, determining that the index item does not accord with the preset pressure test index.
The index item may include: CPU utilization, network bandwidth, etc. And when the CPU utilization rate of the test node exceeds a preset CPU utilization rate threshold value or when the network bandwidth exceeds a preset network bandwidth threshold value, confirming that the index item does not accord with the preset pressure test index.
The pressure test module 205 is further configured to, after determining that the Sample method in the EsaSample class passes, call the ESA interface to perform a next round of pressure test by using the generalized call mode, and end the pressure test when a preset pressure test end condition is satisfied.
The execution of the Sample method in the Esasample class passes the pressure test at the same time, which shows that the ESA interface can also receive more concurrent access quantity, so that the pressure test can be continued.
The pressure test ending condition may be preset, and the entire process of the pressure test may be ended when the preset pressure test ending condition is satisfied. Wherein the pressure test ending condition may include: the cycle of performing the pressure test is greater than a preset cycle; alternatively, the pressure test is discontinued; or the concurrency of the pressure test of any round is greater than the preset concurrency.
In an alternative embodiment, the pressure test module 205 invokes the ESA interface to perform the next round of pressure testing comprises:
simulating a first concurrent quantity to access the ESA interface in a first round of test;
and in the latter round of test, adding a preset concurrency amount on the basis of the concurrency amount of the former round of test to obtain a second concurrency amount, and simulating the second concurrency amount to access the ESA interface.
Illustratively, in a first round of testing, a first concurrency is set to 100; in the second round of test, 100 concurrency is increased, namely, the ESA interface is simulated to be accessed in 200 concurrency; on the third round of testing, the ESA interface was accessed in 300 concurrency simulations.
The report generating module 208 is configured to generate a test report according to the concurrency of each round of test and the corresponding index item in a preset format after the pressure test is ended.
Since test reports generated directly by automatic test scripts after the test procedure is performed are often not in a fixed format, the readability of the test report is poor. And the test report is generated by adopting a preset format, so that the readability of the test report is enhanced, and the content in the test report is convenient for a tester to check and understand. The preset format may be an extensible markup language (XML, extensible Markup Language) format.
In summary, the present embodiment does not need to develop a special HTTP protocol to perform the pressure test of the intermediate ESA interface as in the prior art, and eliminates the intermediate services by developing a tool, i.e., an ESA interface Jmeter plug-in, and integrating the tool into the Jmeter framework. The method can directly call the ESA interface to carry out pressure test through the JMter plug-in of the ESA interface in the JMter framework, so that the test process can be consistent with a real system call scene, the test efficiency is higher, and the test result is more accurate.
It is emphasized that to further ensure the privacy and security of the above-described test reports, the above-described test reports may be stored in nodes of the blockchain.
Referring to fig. 3, a schematic structural diagram of a test apparatus according to a third embodiment of the present invention is shown. In the preferred embodiment of the invention, the test device 3 includes a memory 31, at least one processor 32, at least one communication bus 33, and a transceiver 34. The test device 3 of the present invention can execute the pressure test method of the ESA interface, that is, the test device 3 can be applied to a pressure test scene of a bank ESA interface, so as to improve the test efficiency of the bank ESA interface pressure test and improve the test accuracy of the bank ESA interface pressure test. In the specific implementation, a tester develops a Jmeter plug-in of a bank ESA interface and a customized bank ESA interactive interface in the test equipment 3, so that EsaSample class in the Jmeter plug-in inherits an abstract sampler in the Jmeter frame, and therefore, the calling logic of ESA interface pressure test is realized in a sample method of the EsaSample class, and the consistency of a test process and a real system calling scene can be ensured. It will be appreciated by those skilled in the art that the configuration of the test apparatus shown in fig. 3 is not limiting of the embodiments of the present invention, and that the test apparatus 3 may be of a bus type configuration, a star type configuration, or may include more or less other hardware or software than illustrated, or a different arrangement of components.
In some embodiments, the test device 3 is a test device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit, a programmable gate array, a digital processor, an embedded device, and the like. The test device 3 may also include a client device, including but not limited to any electronic product that can interact with a client by way of a keyboard, mouse, remote control, touch pad, or voice control device, such as a personal computer, tablet, smart phone, digital camera, etc.
It should be noted that the test apparatus 3 is only an example, and other electronic products that may be present in the present invention or may be present in the future are also included in the scope of the present invention by way of reference.
In some embodiments, the memory 31 has stored therein a computer program which, when executed by the at least one processor 32, performs all or part of the steps in the ESA interface pressure test method as described. The Memory 31 includes Read-Only Memory (ROM), programmable Read-Only Memory (PROM), erasable programmable Read-Only Memory (EPROM), one-time programmable Read-Only Memory (One-time Programmable Read-Only Memory, OTPROM), electrically erasable rewritable Read-Only Memory (EEPROM), compact disc Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM) or other optical disc Memory, magnetic tape Memory, or any other medium that can be used for computer-readable carrying or storing data.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
In an alternative embodiment, the computer program when executed by the processor performs the steps of:
acquiring test parameters input in an ESA interactive interface and packaging the test parameters to obtain request parameters;
sending the request parameters to an Esasample class, and encapsulating the request parameters in the Esasample class to obtain an encapsulation request;
responding to the packaging request, and calling an ESA interface in a generalized calling mode to perform pressure test of the round;
after the pressure test of the round is finished, response data returned by the ESA interface are obtained, and the response data are transmitted to the Esasample class;
judging whether the execution of the Sample method in the Esasample class passes or not according to the response data;
after determining that the Sample method in the Esasample class passes, calling the ESA interface by adopting the generalized calling mode to perform the next round of pressure test, and ending the pressure test when a preset pressure test ending condition is met.
In an alternative embodiment, the computer program, when executed by the processor, performs the following functions:
the first packaging module 201 is configured to obtain a test parameter input in an ESA interactive interface and package the test parameter to obtain a request parameter;
the interface display module 202 is configured to display the ESA interaction interface before the test parameters input in the ESA interaction interface are obtained;
the plug-in development module 203 is configured to develop a Jmeter plug-in of the ESA interface;
the second encapsulation module 204 is configured to send the request parameter to an EsaSample class and encapsulate the request parameter in the EsaSample class to obtain an encapsulation request;
the pressure test module 205 is configured to respond to the packaging request, and call an ESA interface in a generalized call manner to perform a pressure test of the present round;
the data transmission module 206 is configured to obtain response data returned by the ESA interface after the end of the pressure test of the present round, and transmit the response data to the EsaSample class;
the test judging module 207 is configured to judge whether execution of a Sample method in the EsaSample class passes according to the response data;
The report generating module 208 is configured to generate a test report according to the concurrence of each round of testing and the corresponding index item in a preset format after the preset round of pressure testing is performed.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
In some embodiments, the at least one processor 32 is a Control Unit (Control Unit) of the test device 3, connects the various components of the entire test device 3 using various interfaces and lines, and performs various functions of the test device 3 and processes data by running or executing programs or modules stored in the memory 31, and invoking data stored in the memory 31. For example, the at least one processor 32, when executing the computer program stored in the memory, implements all or part of the steps of the ESA interface pressure test method described in embodiments of the present invention; or to implement all or part of the functionality of the ESA interface pressure test device. The at least one processor 32 may be comprised of integrated circuits, such as a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functionality, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like.
In some embodiments, the at least one communication bus 33 is arranged to enable connected communication between the memory 31 and the at least one processor 32 or the like.
Although not shown, the test device 3 may further comprise a power source (such as a battery) for powering the various components, preferably the power source may be logically connected to the at least one processor 32 via a power management means, whereby the functions of managing charging, discharging, and power consumption are performed by the power management means. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The test device 3 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional modules described above are stored in a storage medium and include instructions for causing a test device (which may be a personal computer, a test device, or a network device, etc.) or processor (processor) to perform portions of the methods described in the various embodiments of the invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it will be obvious that the term "comprising" does not exclude other elements or that the singular does not exclude a plurality. A plurality of units or means recited in the apparatus claims can also be implemented by means of one unit or means in software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (7)

1. A method for ESA interface pressure testing, the method comprising:
receiving a starting instruction of a Jmeter frame, and running the Jmeter frame; when detecting a determining instruction of a user to a Jmeter plug-in of a preset ESA interface in the Jmeter frame, displaying the ESA interactive interface; displaying the address of a registry for selection and the name of ESA interface service in the ESA interactive interface; the development process of the Jmeter plug-in of the preset ESA interface comprises the following steps: defining an Esasample class; defining a sample method in the Esasample class; inheriting an abstract sampler in the Jmeter framework through the EsaSample class; calling logic for ESA interface pressure test is realized in the sample method;
acquiring test parameters input in an ESA interactive interface and packaging the test parameters to obtain request parameters;
Sending the request parameters to an Esasample class, and encapsulating the request parameters in the Esasample class to obtain an encapsulation request;
responding to the packaging request, and calling an ESA interface in a generalized calling mode to perform pressure test of the round;
after the pressure test of the round is finished, response data returned by the ESA interface are obtained, and the response data are transmitted to the Esasample class;
judging whether the execution of the sample method in the Esasample class passes or not according to the response data, wherein the method comprises the following steps: acquiring index items of the ESA interface in the response data; judging whether the index item accords with a preset pressure test index or not; determining that the sample method in the Esasample class is executed when the index item accords with the preset pressure test index; determining that sample method execution in the Esasample class is not passed when the index item does not accord with the preset pressure test index;
and after determining that the sample method in the Esasample class passes, calling the ESA interface to perform the next round of pressure test by adopting the generalized calling mode, and ending the pressure test when a preset pressure test ending condition is met.
2. The ESA interface pressure test method of claim 1 wherein said determining whether said indicator term meets a predetermined pressure test indicator comprises:
judging whether the index item is smaller than a preset index item threshold value or not;
when the index item is smaller than or equal to the preset index item threshold value, determining that the index item accords with the preset pressure test index;
and when the index item is larger than the preset index item threshold value, determining that the index item does not accord with the preset pressure test index.
3. The ESA interface pressure test method of any one of claims 1 to 2 wherein said invoking said ESA interface for a next round of pressure testing comprises:
simulating a first concurrent quantity to access the ESA interface in a first round of test;
and in the latter round of test, adding a preset concurrency amount on the basis of the concurrency amount of the former round of test to obtain a second concurrency amount, and simulating the second concurrency amount to access the ESA interface.
4. The ESA interface pressure test method according to any one of claims 1 to 2, wherein said preset pressure test ending condition comprises: the number of rounds of performing the pressure test is greater than a preset number of rounds, and the concurrence of the pressure test for any round is greater than a preset concurrence, the method further comprising:
After the pressure test is finished, a test report is generated according to the concurrency of each round of test and the corresponding index item by adopting a preset format.
5. An ESA interface pressure test device, said device comprising:
the first packaging module is used for receiving a starting instruction of the Jmeter frame and running the Jmeter frame; when detecting a determining instruction of a user to a Jmeter plug-in of a preset ESA interface in the Jmeter frame, displaying the ESA interactive interface; displaying the address of a registry for selection and the name of ESA interface service in the ESA interactive interface; the development process of the Jmeter plug-in of the preset ESA interface comprises the following steps: defining an Esasample class; defining a sample method in the Esasample class; inheriting an abstract sampler in the Jmeter framework through the EsaSample class; calling logic for ESA interface pressure test is realized in the sample method; acquiring test parameters input in an ESA interactive interface and packaging the test parameters to obtain request parameters;
the second encapsulation module is used for sending the request parameters to an Esasample class and encapsulating the request parameters in the Esasample class to obtain an encapsulation request;
The pressure test module is used for responding to the packaging request and calling an ESA interface in a generalized calling mode to perform pressure test of the round;
the data transmission module is used for acquiring response data returned by the ESA interface after the pressure test of the round is finished, and transmitting the response data to the Esasample class;
the test judging module is used for judging whether the execution of the sample method in the Esasample class passes or not according to the response data, and comprises the following steps: acquiring index items of the ESA interface in the response data; judging whether the index item accords with a preset pressure test index or not; determining that the sample method in the Esasample class is executed when the index item accords with the preset pressure test index; determining that sample method execution in the Esasample class is not passed when the index item does not accord with the preset pressure test index;
and the pressure test module is also used for calling the ESA interface to perform the pressure test of the next round by adopting the generalized calling mode after determining that the sample method in the Esasample class passes, and ending the pressure test when the preset pressure test ending condition is met.
6. A test apparatus, the test apparatus comprising:
a memory for storing a computer program;
a processor for implementing the ESA interface pressure test method according to any one of claims 1 to 4 when executing said computer program.
7. A computer readable storage medium having a computer program stored thereon, wherein the computer program when executed by a processor implements the ESA interface pressure test method according to any of claims 1 to 4.
CN202010967715.XA 2020-09-15 2020-09-15 ESA interface pressure test method, ESA interface pressure test device, ESA interface pressure test equipment and storage medium Active CN112069078B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010967715.XA CN112069078B (en) 2020-09-15 2020-09-15 ESA interface pressure test method, ESA interface pressure test device, ESA interface pressure test equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010967715.XA CN112069078B (en) 2020-09-15 2020-09-15 ESA interface pressure test method, ESA interface pressure test device, ESA interface pressure test equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112069078A CN112069078A (en) 2020-12-11
CN112069078B true CN112069078B (en) 2024-03-19

Family

ID=73695861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010967715.XA Active CN112069078B (en) 2020-09-15 2020-09-15 ESA interface pressure test method, ESA interface pressure test device, ESA interface pressure test equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112069078B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112882910A (en) * 2021-01-22 2021-06-01 中国建设银行股份有限公司 Interface pressure testing method and device of workflow engine

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101415A (en) * 2018-06-25 2018-12-28 平安科技(深圳)有限公司 Interface test method, system, equipment and the storage medium compared based on database
CN109344076A (en) * 2018-10-22 2019-02-15 浙江执御信息技术有限公司 A kind of automatic interface testing method and its device based on JMeter and Jenkins
WO2019153472A1 (en) * 2018-02-07 2019-08-15 平安科技(深圳)有限公司 Automated interface testing method, device, equipment, and storage medium
WO2019178967A1 (en) * 2018-03-22 2019-09-26 平安科技(深圳)有限公司 Jmeter-based stress testing method and apparatus, and device and storage medium
WO2019196213A1 (en) * 2018-04-12 2019-10-17 平安科技(深圳)有限公司 Interface test method, apparatus and device, and computer-readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150113331A1 (en) * 2013-10-17 2015-04-23 Wipro Limited Systems and methods for improved software testing project execution

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019153472A1 (en) * 2018-02-07 2019-08-15 平安科技(深圳)有限公司 Automated interface testing method, device, equipment, and storage medium
WO2019178967A1 (en) * 2018-03-22 2019-09-26 平安科技(深圳)有限公司 Jmeter-based stress testing method and apparatus, and device and storage medium
WO2019196213A1 (en) * 2018-04-12 2019-10-17 平安科技(深圳)有限公司 Interface test method, apparatus and device, and computer-readable storage medium
CN109101415A (en) * 2018-06-25 2018-12-28 平安科技(深圳)有限公司 Interface test method, system, equipment and the storage medium compared based on database
CN109344076A (en) * 2018-10-22 2019-02-15 浙江执御信息技术有限公司 A kind of automatic interface testing method and its device based on JMeter and Jenkins

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
使用JMeter插件提高性能测试效率;吴志刚;;软件导刊(第04期);第35-37页 *
手把手教你基于 JMeter 开发一个自动化测试平台;IT咖啡馆;《https://zhuanlan.zhihu.com/p/163354573》;第1-16页 *

Also Published As

Publication number Publication date
CN112069078A (en) 2020-12-11

Similar Documents

Publication Publication Date Title
CN108415832B (en) Interface automation test method, device, equipment and storage medium
CN109933522B (en) Test method, test system and storage medium for automatic case
CN109302522B (en) Test method, test device, computer system, and computer medium
CN110032511A (en) A kind of interface test method and interface testing equipment
CN111176626B (en) Cross-programming-language code calling method and device, medium and equipment
WO2022037690A1 (en) Application construction system, method and platform, and application publication system, method and platform
CN113032244B (en) Interface test method, device, computer system and computer readable storage medium
CN113110963A (en) Service processing method, service processing device, electronic equipment and readable storage medium
CN108965375A (en) Service call proxy control system, method, server and readable storage medium storing program for executing
CN110659206A (en) Simulation architecture establishing method, device, medium and electronic equipment based on microservice
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN112069078B (en) ESA interface pressure test method, ESA interface pressure test device, ESA interface pressure test equipment and storage medium
CN111752820B (en) gRPC interface pressure test method, computer equipment and storage medium
Diakov et al. Design and implementation of a framework for monitoring distributed component interactions
CN107360036A (en) A kind of network failure locating method, terminal and server
US11539612B2 (en) Testing virtualized network functions
CN111506305B (en) Tool pack generation method, device, computer equipment and readable storage medium
CN112181822A (en) Test method and test method for starting time consumption of application program
CN114020414B (en) Android system and bottom Linux symbiotic method and device, electronic equipment and storage medium
Schmid et al. A generic application-oriented performance instrumentation for multi-tier environments
CN116483899A (en) Calling method and device for converged service interface, electronic equipment and storage medium
CN114567571B (en) Performance test method, device, electronic equipment and computer readable storage medium
CN115454878A (en) Interface calling test method applied to micro service and related device
CN112073462B (en) Positioning method and device
CN115048294A (en) Test execution method and device, storage medium and electronic equipment

Legal Events

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