CN112069078A - ESA interface pressure testing method, device, testing equipment and storage medium - Google Patents

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

Info

Publication number
CN112069078A
CN112069078A CN202010967715.XA CN202010967715A CN112069078A CN 112069078 A CN112069078 A CN 112069078A CN 202010967715 A CN202010967715 A CN 202010967715A CN 112069078 A CN112069078 A CN 112069078A
Authority
CN
China
Prior art keywords
esa
interface
test
pressure 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.)
Granted
Application number
CN202010967715.XA
Other languages
Chinese (zh)
Other versions
CN112069078B (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

Images

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 an ESA interface pressure testing storage medium, wherein the ESA interface pressure testing device comprises the following components: packaging the test parameters input in the ESA interactive interface to obtain request parameters; packaging the request parameters in an EsASample class to obtain a packaging request; responding to the packaging request, calling an ESA interface in a generalized calling mode to carry out the pressure test of the round; after the pressure test of the current round is finished, response data returned by an ESA interface is obtained, and the response data is transmitted to EsASamples; judging whether the execution of the Sample method in the EsASample class passes or not according to the response data by the EsASample class; after the Sample method in the EsASample class is determined to be executed, calling an ESA interface to perform the next round of pressure test by adopting a generalized calling mode. The invention can directly call the ESA interface to carry out pressure test. In addition, the invention also relates to the technical field of the block chain, and the test report generated after the pressure test is finished is stored in the block chain.

Description

ESA interface pressure testing method, device, testing 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 for calling between internal systems based on a bank proprietary framework, and is the interface type used by the internal systems most.
When a tester presses and tests an ESA interface in a bank, a special Http protocol-to-ESA interface needs to be developed, transfer service needs to be developed independently, the cost is high, and calling is inconvenient, so that the ESA interface testing efficiency is low; and the performance of the transfer service may cause inaccurate pressure measurement results and deviation with a real test scene.
Therefore, it is necessary to provide a solution that can directly call the ESA interface for the stress test.
Disclosure of Invention
In view of the above, there is a need to provide a method, an apparatus, a testing device and a storage medium for testing the pressure of the ESA interface, which can directly call the ESA interface to perform the pressure test, and have high testing efficiency and accurate testing result.
The first aspect of the invention provides an ESA interface pressure testing method, which comprises the following steps:
acquiring test parameters input in an ESA (enterprise service association) 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 the pressure test of the current round;
after the pressure test of the current round is finished, response data returned by the ESA interface is obtained, and the response data is 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 the Sample method in the EsASample class is determined to be executed, calling the ESA interface to perform the next pressure test by adopting the generalized calling mode, and finishing the pressure test when a preset pressure test finishing condition is met.
According to an alternative embodiment of the present invention, before the obtaining the test parameters input in the ESA interactive interface, the method further comprises:
receiving a starting instruction of a Jmeter frame, and operating the Jmeter frame;
when a user detects a determination instruction of a Jmeter plug-in of a preset ESA in the Jmeter frame, displaying the ESA interactive interface;
and displaying the addresses of the selectable registration centers and the names of the ESA interface services in the ESA interactive interface.
According to an alternative embodiment of the present invention, the process of developing the meter 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 calling logic of ESA interface pressure test in the sample method.
According to an optional embodiment of the present invention, the determining, according to the response data, whether the execution of the Sample method in the EsaSample class passes through a process including:
acquiring an index item of the ESA interface in the response data;
judging whether the index item meets a preset pressure test index or not;
when the index item conforms to the preset pressure test index, determining that a Sample method in the EsASample class passes execution;
and when the index item does not meet the preset pressure test index, determining that the execution of the Sample method in the EsASample class does not pass.
According to an optional embodiment of the present 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 for the next round of stress testing includes:
simulating a first concurrent access to the ESA interface during a first round of testing;
and in the next round of test, increasing preset concurrency quantity on the basis of the concurrency quantity of the previous round of test to obtain second concurrency quantity, and simulating the second concurrency quantity to access the ESA interface.
According to an alternative embodiment of the present invention, the preset pressure test end condition includes: the number of pressure test execution rounds is greater than the preset number of pressure test execution rounds, and the concurrence amount of the pressure test of any round is greater than the preset concurrence amount, and the method further comprises the following steps:
and after the pressure test is finished, generating a test report according to the concurrency of each round of test and the corresponding index items by adopting a preset format.
A second aspect of the present invention provides an ESA interface pressure testing apparatus, comprising:
the first encapsulation module is used for acquiring test parameters input in an ESA (electronic service Association) interactive interface and encapsulating the test parameters to obtain request parameters;
the second packaging module is used for sending the request parameters to an EsASample class and packaging the request parameters in the EsASample class to obtain a packaging request;
the pressure test module is used for responding to the packaging request and calling an ESA interface in a generalization calling mode to carry out the pressure test of the current round;
the data transmission module is used for acquiring response data returned by the ESA interface after the pressure test of the current round is finished, and transmitting the response data to the EsASample class;
the test judgment 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 next pressure test by adopting the generalized calling mode after the Sample method in the EsASample class is determined to pass the execution, and finishing the pressure test when a preset pressure test finishing 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 stored thereon a computer program which, when executed by a processor, implements the ESA interface pressure testing method.
In summary, the ESA interface pressure testing method, device, testing apparatus and storage medium according to the present invention do not need to develop a special HTTP protocol for performing a pressure test of an ESA interface as in the prior art, and the ESA interface Jmeter plug-in is developed and integrated into a Jmeter frame, thereby eliminating the process of a relay service. The method can directly call the ESA interface for pressure test in the Jmeter frame through the Jmeter plug-in of the ESA interface, so that the test process can be consistent with the 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 testing method according to an embodiment of the present invention.
Fig. 2 is a structural diagram of an ESA interface pressure testing apparatus according to a second embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a testing apparatus according to a third embodiment of the present invention.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a detailed description of the present invention will be given below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and features of the embodiments may be combined with each other without conflict.
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 in the description of the invention herein 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 testing method according to an embodiment of the present invention. The ESA interface pressure testing method specifically comprises the following steps, and the sequence of the steps in the flow chart can be changed and some steps can be omitted according to different requirements.
S11, obtaining the testing parameters input in the ESA interactive interface and packaging the testing parameters to obtain the request parameters.
Wherein the test parameters may include, but are not limited to: the address of the registry and the name of the ESA interface service, etc.
The test parameters may be in a Json format.
In an optional 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 operating the Jmeter frame;
when a user detects a determination instruction of a Jmeter plug-in of a preset ESA in the Jmeter frame, displaying the ESA interactive interface;
and displaying the addresses of the selectable registration centers and the names of the ESA interface services in the ESA interactive interface.
The Jmeter framework is an open source testing tool which is developed based on java language and mainly used for testing. A user develops a customized sampler plug-in, firstly, a graphical interface of a sampler needs to be developed, and the AbstractSamplerGui class of JMeter is expanded and realized; then developing a processing logic class of the sampler, expanding and realizing an abstract sampler class of JMeter, realizing protocol interaction, sending a request message and processing a returned response result; and finally compiling the developed and debugged codes, and making the compiled codes and the pom. xml describing the dependency relationship into a JAR package, copying the JAR package into a lib \ ext directory of the JMeter, and copying other related dependency JAR packages into the lib directory of the JMeter.
The development of a sampler plug-in for calling the ESA interface pressure test in a customized manner needs to expand to realize the creation of a customized ESA interface pressure test sampler interface in org.
The selection instruction can be triggered by the user clicking on the route of the ESA interface to be tested, or by the user inputting the route of the ESA interface to be tested in a specific input box in the ESA interactive interface.
For example, if addresses of different registration centers and names of ESA interface services are displayed in the ESA interactive interface, or a pull-down button is displayed on the ESA interactive interface, when a user clicks the pull-down button corresponding to an ESA interface to be tested, the addresses of the registration centers and the names of the ESA interface services corresponding to the ESA interface to be tested are displayed on the ESA interactive interface.
In an optional embodiment, the developing process of the meter 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 calling logic of ESA interface pressure test in the sample method.
The EsASample is a self-defined sampler, the sample is a method in the EsASample, and the EsASample inherits the abstract sampler, so that the sample method in the EsASample can be called by the Jmeter framework during operation, and the call logic of the ESA interface pressure test is realized in the sample method.
S12, sending the request parameter to an EsASample class and packaging the request parameter in the EsASample class to obtain a packaging request.
And the test equipment transmits the request parameters as access parameters to an EsASample class, so that the EsASample class encapsulates the request parameters into a Map type encapsulation request.
And S13, responding to the packaging request, and calling an ESA interface in a generalization calling mode to perform the pressure test of the round.
The generalized call refers to a call of an Application Programming Interface (API) package that is not dependent, so that a meter plug-in of an ESA Interface is more independent and available.
And S14, after the pressure test of the current round is finished, acquiring response data returned by the ESA interface, and transmitting the response data to the EsASample class.
When the ESA is called through the Jmeter plug-in of the preset ESA, the ESA responds, response data are transmitted back to the Jmeter plug-in of the preset ESA, and the response data are obtained through the EsASample in the Jmeter plug-in of the preset ESA.
And S15, judging whether the execution of the Sample method in the EsASample class passes or not according to the response data.
The ESA interface returns more response data each time when responding, but the response data are not all data required by testers, so that the EsASample class acquires a plurality of key data from the response data, assembles the key data, and judges whether the Sample method in the EsASample class passes or not according to the assembled data.
In an optional embodiment, the determining, according to the response data, whether the execution of the Sample method in the EsaSample class passes through the following steps:
acquiring an index item of the ESA interface in the response data;
judging whether the index item meets a preset pressure test index or not;
when the index item conforms to the preset pressure test index, determining that a Sample method in the EsASample class passes execution;
and when the index item does not meet the preset pressure test index, determining that the execution of the Sample method in the EsASample class does not pass.
In this optional embodiment, multiple rounds of tests may be performed, and it is determined whether the index item of the ESA interface meets the preset pressure test index in each round of tests, and when it is determined that the index item of the ESA interface meets the preset pressure test index in a certain round of tests, the pressure test termination instruction of the current round is triggered, and the pressure test of the ESA interface of the current round is terminated.
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 usage, 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, determining that the index item does not accord with the preset pressure test index.
And S16, after the Sample method in the EsASample class is determined to pass, calling the ESA interface to perform the next pressure test by adopting the generalized calling mode, and finishing the pressure test when a preset pressure test finishing condition is met.
The Sample method in the EsASample class is executed and passed through in the pressure test in this round, which indicates that the ESA interface can also receive more concurrent access, so that the pressure test can be continued.
The pressure test end condition may be preset, and the entire process of the pressure test may be ended when the preset pressure test end condition is satisfied. Wherein the stress test end condition may include: the number of times of executing the pressure test is larger than the preset number of times; alternatively, the pressure test is discontinued; or the concurrency of the pressure test of any round is greater than the preset concurrency.
In an optional embodiment, the invoking the ESA interface for the next round of stress testing includes:
simulating a first concurrent access to the ESA interface during a first round of testing;
and in the next round of test, increasing preset concurrency quantity on the basis of the concurrency quantity of the previous round of test to obtain second concurrency quantity, and simulating the second concurrency quantity to access the ESA interface.
Illustratively, at the first round of testing, a first concurrency level is set to 100; in the second round of test, 100 concurrency amounts are added, namely 200 concurrency amounts are used for simulating and accessing the ESA interface; at the third round of testing, access to the ESA interface was simulated with 300 concurrencies.
Further, the method further comprises:
and after the pressure test is finished, generating a test report according to the concurrency of each round of test and the corresponding index items by adopting a preset format.
Since the test report generated directly by the automatic test script after the test procedure is performed is often not in a fixed format, the readability of the test report is poor. The test report is generated by adopting the preset format, so that the readability of the test report is enhanced, and the content in the test report can be conveniently checked and understood by testers. The preset format may be an Extensible Markup Language (XML) format.
In summary, the present embodiment does not need to develop a special HTTP protocol for performing a pressure test of forwarding the ESA interface as in the prior art, and the forwarding service process is eliminated by developing a tool of the ESA interface meter plug-in and integrating the tool into the meter framework. The method can directly call the ESA interface for pressure test in the Jmeter frame through the Jmeter plug-in of the ESA interface, so that the test process can be consistent with the 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 as to improve the test efficiency of the pressure test of the bank ESA interface and improve the test accuracy of the pressure test of the bank ESA interface. During 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 calling logic of ESA interface pressure test is realized in a sample method of the EsASample class, and thus, the test process and a real system calling scene can be kept consistent.
It is emphasized that the test report may be stored in a node of the block chain in order to further ensure the privacy and security of the test report.
Fig. 2 is a structural diagram of an ESA interface pressure testing apparatus according to a second embodiment of the present invention.
In some embodiments, the ESA interface pressure testing apparatus 20 may include a plurality of functional modules comprising computer program segments. The computer program of each program segment in ESA interface pressure testing apparatus 20 may be stored in the memory of the testing device and executed by at least one processor to perform the functions of ESA interface pressure testing (described in detail in fig. 1).
In this embodiment, the ESA interface pressure testing apparatus 20 may be divided into a plurality of functional modules according to the functions performed by the apparatus. The functional module may include: the system comprises a first packaging module 201, an interface display module 202, a plug-in development module 203, a second packaging module 204, a pressure testing module 205, a data transmission module 206, a test judgment module 207 and a report generation module 208. The module referred to herein is a series of computer program segments capable of being executed by at least one processor and capable of performing a fixed function and is stored in memory. In the present embodiment, the functions of the modules will be described in detail in the following embodiments.
The first encapsulation module 201 is configured to obtain a test parameter input in the ESA interaction interface and encapsulate the test parameter to obtain a request parameter.
Wherein the test parameters may include, but are not limited to: the address of the registry and the name of the ESA interface service, etc.
The test parameters may be in a Json format.
The interface display module 202 is configured to display the ESA interactive interface before the test parameters input in the ESA interactive interface are obtained.
In an alternative embodiment, the interface display module 202 displays the ESA interaction interface including:
receiving a starting instruction of a Jmeter frame, and operating the Jmeter frame;
when a user detects a determination instruction of a Jmeter plug-in of a preset ESA in the Jmeter frame, displaying the ESA interactive interface;
and displaying the addresses of the selectable registration centers and the names of the ESA interface services in the ESA interactive interface.
The Jmeter framework is an open source testing tool which is developed based on java language and mainly used for testing. A user develops a customized sampler plug-in, firstly, a graphical interface of a sampler needs to be developed, and the AbstractSamplerGui class of JMeter is expanded and realized; then developing a processing logic class of the sampler, expanding and realizing an abstract sampler class of JMeter, realizing protocol interaction, sending a request message and processing a returned response result; and finally compiling the developed and debugged codes, and making the compiled codes and the pom. xml describing the dependency relationship into a JAR package, copying the JAR package into a lib \ ext directory of the JMeter, and copying other related dependency JAR packages into the lib directory of the JMeter.
The development of a sampler plug-in for calling the ESA interface pressure test in a customized manner needs to expand to realize the creation of a customized ESA interface pressure test sampler interface in org.
The selection instruction can be triggered by the user clicking on the route of the ESA interface to be tested, or by the user inputting the route of the ESA interface to be tested in a specific input box in the ESA interactive interface.
For example, if addresses of different registration centers and names of ESA interface services are displayed in the ESA interactive interface, or a pull-down button is displayed on the ESA interactive interface, when a user clicks the pull-down button corresponding to an ESA interface to be tested, the addresses of the registration centers and the names of the ESA interface services corresponding to the ESA interface to be tested are displayed on the ESA interactive interface.
The plug-in development module 203 is used for developing a meter plug-in of an ESA interface.
In an alternative embodiment, the process of the plug-in development module 203 developing a Jmeter plug-in of a 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 calling logic of ESA interface pressure test in the sample method.
The EsASample is a self-defined sampler, the sample is a method in the EsASample, and the EsASample inherits the abstract sampler, so that the sample method in the EsASample can be called by the Jmeter framework during operation, and the call logic of the ESA interface pressure test is realized in the sample method.
The second encapsulating module 204 is configured to send the request parameter to an esaservice class and encapsulate the request parameter in the esaservice class to obtain an encapsulating request.
And the test equipment transmits the request parameters as access parameters to an EsASample class, so that the EsASample class encapsulates the request parameters into a Map type encapsulation request.
The stress test module 205 is configured to respond to the encapsulation request and call an ESA interface in a generalized calling manner to perform the stress test of the current round.
The generalized call refers to a call of an Application Programming Interface (API) package that is not dependent, so that a meter plug-in of an ESA Interface is more independent and available.
The data transmission module 206 is configured to obtain response data returned by the ESA interface after the pressure test of the current round is finished, and transmit the response data to the EsaSample class.
When the ESA is called through the Jmeter plug-in of the preset ESA, the ESA responds, response data are transmitted back to the Jmeter plug-in of the preset ESA, and the response data are obtained through the EsASample in the Jmeter plug-in of the preset ESA.
The test judgment module 207 is configured to judge whether the execution of the Sample method in the EsaSample class passes according to the response data.
The ESA interface returns more response data each time when responding, but the response data are not all data required by testers, so that the EsASample class acquires a plurality of key data from the response data, assembles the key data, and judges whether the Sample method in the EsASample class passes or not according to the assembled data.
In an optional embodiment, the determining module 207 determines whether the execution of the Sample method in the EsaSample class passes the following steps according to the response data:
acquiring an index item of the ESA interface in the response data;
judging whether the index item meets a preset pressure test index or not;
when the index item conforms to the preset pressure test index, determining that a Sample method in the EsASample class passes execution;
and when the index item does not meet the preset pressure test index, determining that the execution of the Sample method in the EsASample class does not pass.
In this optional embodiment, multiple rounds of tests may be performed, and it is determined whether the index item of the ESA interface meets the preset pressure test index in each round of tests, and when it is determined that the index item of the ESA interface meets the preset pressure test index in a certain round of tests, the pressure test termination instruction of the current round is triggered, and the pressure test of the ESA interface of the current round is terminated.
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 usage, 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, determining that the index item does not accord with the preset pressure test index.
The pressure testing module 205 is further configured to call the ESA interface to perform a next pressure test in the generalized calling manner after determining that the Sample method in the esasam class passes the execution, and terminate the pressure test when a preset pressure test termination condition is met.
The Sample method in the EsASample class is executed and passed through in the pressure test in this round, which indicates that the ESA interface can also receive more concurrent access, so that the pressure test can be continued.
The pressure test end condition may be preset, and the entire process of the pressure test may be ended when the preset pressure test end condition is satisfied. Wherein the stress test end condition may include: the number of times of executing the pressure test is larger than the preset number of times; 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 stress test module 205 invokes the ESA interface to perform the next stress test round includes:
simulating a first concurrent access to the ESA interface during a first round of testing;
and in the next round of test, increasing preset concurrency quantity on the basis of the concurrency quantity of the previous round of test to obtain second concurrency quantity, and simulating the second concurrency quantity to access the ESA interface.
Illustratively, at the first round of testing, a first concurrency level is set to 100; in the second round of test, 100 concurrency amounts are added, namely 200 concurrency amounts are used for simulating and accessing the ESA interface; at the third round of testing, access to the ESA interface was simulated with 300 concurrencies.
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 by using a preset format after the pressure test is finished.
Since the test report generated directly by the automatic test script after the test procedure is performed is often not in a fixed format, the readability of the test report is poor. The test report is generated by adopting the preset format, so that the readability of the test report is enhanced, and the content in the test report can be conveniently checked and understood by testers. The preset format may be an Extensible Markup Language (XML) format.
In summary, the present embodiment does not need to develop a special HTTP protocol for performing a pressure test of forwarding the ESA interface as in the prior art, and the forwarding service process is eliminated by developing a tool of the ESA interface meter plug-in and integrating the tool into the meter framework. The method can directly call the ESA interface for pressure test in the Jmeter frame through the Jmeter plug-in of the ESA interface, so that the test process can be consistent with the real system call scene, the test efficiency is higher, and the test result is more accurate.
It is emphasized that the test report may be stored in a node of the block chain in order to further ensure the privacy and security of the test report.
Fig. 3 is a schematic structural diagram of a testing apparatus according to a third embodiment of the present invention. In the preferred embodiment of the present invention, the test equipment 3 includes a memory 31, at least one processor 32, at least one communication bus 33, and a transceiver 34. The testing equipment 3 can execute the pressure testing method of the ESA interface, namely, the testing equipment 3 can be applied to a pressure testing scene of a bank ESA interface so as to improve the testing efficiency and the testing accuracy of the pressure testing of the bank ESA interface. During specific implementation, a tester develops a Jmeter plug-in of a bank ESA interface and a customized bank ESA interactive interface in the testing equipment 3, so that an EsASample class in the Jmeter plug-in inherits an abstract sampler in a Jmeter frame, and calling logic of ESA interface pressure testing is realized in a sample method of the EsASample class, and thus, the testing process and a real system calling scene can be kept consistent. It will be appreciated by those skilled in the art that the configuration of the test device shown in fig. 3 does not constitute a limitation of the embodiments of the present invention, and may be either a bus-type configuration or a star-type configuration, and that the test device 3 may also include more or less hardware or software than shown, or a different arrangement of components.
In some embodiments, the testing device 3 is a testing device capable of automatically performing numerical calculation and/or information processing according to instructions set or stored in advance, and the hardware thereof 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 testing device 3 may also include a client device, which includes, but is not limited to, any electronic product capable of interacting with a client through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device, for example, a personal computer, a tablet computer, a smart phone, a digital camera, etc.
It should be noted that the test device 3 is only an example, and other existing or future electronic products, such as those that may be adapted to the present invention, should also be included in the scope of the present invention, and is included by reference.
In some embodiments, the memory 31 has stored therein a computer program that, when executed by the at least one processor 32, performs all or part of the steps of the ESA interface stress testing method as described. The Memory 31 includes a Read-Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), a One-time Programmable Read-Only Memory (OTPROM), an electronically Erasable rewritable Read-Only Memory (Electrically-Erasable Programmable Read-Only Memory (EEPROM)), an optical Read-Only disk (CD-ROM) or other optical disk Memory, a magnetic disk Memory, a tape Memory, or any other medium readable by a computer capable of 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 according to the use of the blockchain node, and the like.
In an alternative embodiment, the computer program when executed by the processor implements the steps of:
acquiring test parameters input in an ESA (enterprise service association) 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 the pressure test of the current round;
after the pressure test of the current round is finished, response data returned by the ESA interface is obtained, and the response data is 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 the Sample method in the EsASample class is determined to pass execution, the ESA interface is called by adopting the generalized calling mode to carry out the next pressure test, and the pressure test is finished when a preset pressure test finishing condition is met.
In an alternative embodiment, the computer program when executed by the processor implements the following functions:
the first encapsulation module 201 is configured to obtain a test parameter input in an ESA interaction interface and encapsulate the test parameter to obtain a request parameter;
the interface display module 202 is configured to display the ESA interactive interface before the test parameters input in the ESA interactive interface are obtained;
the plug-in development module 203 is used for developing a Jmeter plug-in of an ESA interface;
the second encapsulating 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 encapsulating request;
the pressure test module 205 is configured to respond to the encapsulation request, and call an ESA interface in a generalized calling manner to perform the pressure test of the current round;
the data transmission module 206 is configured to obtain response data returned by the ESA interface after the pressure test of the current round is finished, and transmit the response data to the esasam class;
the test judgment module 207 is configured to judge whether the execution of the Sample method in the EsaSample class passes or not according to the response data;
the report generating module 208 is configured to generate a test report according to the concurrency of each test round and the corresponding index item by using a preset format after the pressure test of the preset test round is performed.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service 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 various components of the entire test device 3 by using various interfaces and lines, and executes various functions and processes data of the test device 3 by running or executing programs or modules stored in the memory 31 and calling 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 a portion of the steps of the ESA interface pressure testing method described in embodiments of the present invention; or to implement all or part of the functions of the ESA interface pressure testing apparatus. The at least one processor 32 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips.
In some embodiments, the at least one communication bus 33 is arranged to enable connection communication between the memory 31 and the at least one processor 32 or the like.
Although not shown, the testing device 3 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 32 through a power management device, so as to implement functions of managing charging, discharging, and power consumption through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The testing device 3 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
The integrated unit implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a testing device (which may be a personal computer, a testing device, or a network device) or a processor (processor) to execute parts of the methods according to the embodiments of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
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 attributes 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 is obvious that the word "comprising" does not exclude other elements or that the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A pressure testing method for an ESA interface is characterized by comprising the following steps:
acquiring test parameters input in an ESA (enterprise service association) 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 the pressure test of the current round;
after the pressure test of the current round is finished, response data returned by the ESA interface is obtained, and the response data is 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 the Sample method in the EsASample class is determined to be executed, calling the ESA interface to perform the next pressure test by adopting the generalized calling mode, and finishing the pressure test when a preset pressure test finishing condition is met.
2. The ESA interface pressure testing method of claim 1, wherein prior to said obtaining test parameters entered in an ESA interaction interface, said method further comprises:
receiving a starting instruction of a Jmeter frame, and operating the Jmeter frame;
when a user detects a determination instruction of a Jmeter plug-in of a preset ESA in the Jmeter frame, displaying the ESA interactive interface;
and displaying the addresses of the selectable registration centers and the names of the ESA interface services in the ESA interactive interface.
3. The ESA interface pressure testing method as claimed in claim 2, wherein the development process of the meter plug-in of the preset ESA interface comprises:
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 calling logic of ESA interface pressure test in the sample method.
4. The ESA interface pressure testing method according to claim 1, wherein said determining whether the execution of the Sample method in the ESA Sample class passes or not according to the response data comprises:
acquiring an index item of the ESA interface in the response data;
judging whether the index item meets a preset pressure test index or not;
when the index item conforms to the preset pressure test index, determining that a Sample method in the EsASample class passes execution;
and when the index item does not meet the preset pressure test index, determining that the execution of the Sample method in the EsASample class does not pass.
5. The ESA interface pressure testing method of claim 4, wherein said determining whether said indicator item 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.
6. The ESA interface pressure testing method according to any one of claims 1 to 5, wherein the calling the ESA interface for the next round of pressure testing comprises:
simulating a first concurrent access to the ESA interface during a first round of testing;
and in the next round of test, increasing preset concurrency quantity on the basis of the concurrency quantity of the previous round of test to obtain second concurrency quantity, and simulating the second concurrency quantity to access the ESA interface.
7. The ESA interface pressure testing method according to any of claims 1 to 5, wherein said preset pressure test end condition comprises: the number of pressure test execution rounds is greater than the preset number of pressure test execution rounds, and the concurrence amount of the pressure test of any round is greater than the preset concurrence amount, and the method further comprises the following steps:
and after the pressure test is finished, generating a test report according to the concurrency of each round of test and the corresponding index items by adopting a preset format.
8. An ESA interface pressure test apparatus, comprising:
the first encapsulation module is used for acquiring test parameters input in an ESA (electronic service Association) interactive interface and encapsulating the test parameters to obtain request parameters;
the second packaging module is used for sending the request parameters to an EsASample class and packaging the request parameters in the EsASample class to obtain a packaging request;
the pressure test module is used for responding to the packaging request and calling an ESA interface in a generalization calling mode to carry out the pressure test of the current round;
the data transmission module is used for acquiring response data returned by the ESA interface after the pressure test of the current round is finished, and transmitting the response data to the EsASample class;
the test judgment 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 next pressure test by adopting the generalized calling mode after the Sample method in the EsASample class is determined to pass the execution, and finishing the pressure test when a preset pressure test finishing condition is met.
9. A test apparatus, characterized in that the test apparatus comprises:
a memory for storing a computer program;
a processor for implementing the ESA interface pressure testing method as claimed in any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the ESA interface pressure testing method according to any one of claims 1 to 7.
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 true CN112069078A (en) 2020-12-11
CN112069078B 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)

Cited By (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 (6)

* 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
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

Patent Citations (6)

* 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
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
IT咖啡馆: "手把手教你基于 JMeter 开发一个自动化测试平台", 《HTTPS://ZHUANLAN.ZHIHU.COM/P/163354573》, pages 1 - 16 *
吴志刚;: "使用JMeter插件提高性能测试效率", 软件导刊, no. 04, pages 35 - 37 *

Cited By (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

Also Published As

Publication number Publication date
CN112069078B (en) 2024-03-19

Similar Documents

Publication Publication Date Title
CN109302522B (en) Test method, test device, computer system, and computer medium
CN110443573A (en) Examination & approval management platform and its measures and procedures for the examination and approval, workflow generation method
CN107608901B (en) Jmeter-based testing method and device, storage medium and electronic equipment
CN112256406B (en) Operation flow platformization scheduling method
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN113672441A (en) Method and device for testing intelligent equipment
CN112069078B (en) ESA interface pressure test method, ESA interface pressure test device, ESA interface pressure test equipment and storage medium
CN114168471A (en) Test method, test device, electronic equipment and storage medium
CN107908565B (en) Test method and test equipment
CN112579452A (en) Software automation test method, device, equipment and storage medium
CN112445490A (en) File sequence processing method and device, terminal equipment and 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
CN116483899A (en) Calling method and device for converged service interface, electronic equipment and storage medium
CN112073462B (en) Positioning method and device
CN112527668A (en) Applet safety debugging method and device, mobile terminal and storage medium
CN114036068A (en) Update detection method, device, equipment and storage medium based on privacy security
CN110083523A (en) Interface test method, device, computer installation and readable storage medium storing program for executing
CN112634047B (en) Foreign exchange transaction simulation test method and device, computer equipment and storage medium
CN114448823B (en) NFS service testing method and system and electronic equipment
CN116931965B (en) Integrated stream processing method, device, electronic equipment and storage medium
CN107677301B (en) Monitoring device detection method and device
CN114218072A (en) Test script generation method and device, storage medium and computer equipment
CN117493162A (en) Data verification method, system, equipment and storage medium for interface test
CN113778881A (en) Data processing method and device 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