CN107015906B - Test method and device, port generation method, port generator and test system - Google Patents

Test method and device, port generation method, port generator and test system Download PDF

Info

Publication number
CN107015906B
CN107015906B CN201610464998.XA CN201610464998A CN107015906B CN 107015906 B CN107015906 B CN 107015906B CN 201610464998 A CN201610464998 A CN 201610464998A CN 107015906 B CN107015906 B CN 107015906B
Authority
CN
China
Prior art keywords
test
port
port number
response message
connection
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
CN201610464998.XA
Other languages
Chinese (zh)
Other versions
CN107015906A (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.)
Ant Fortune Shanghai Financial Information Service Co ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201610464998.XA priority Critical patent/CN107015906B/en
Publication of CN107015906A publication Critical patent/CN107015906A/en
Application granted granted Critical
Publication of CN107015906B publication Critical patent/CN107015906B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs

Abstract

The application provides a test method and device, a port generation method, a port generator and a test system, and belongs to the technical field of test processing. The method comprises the following steps: acquiring port numbers of one or more test cases; respectively establishing one or more corresponding session connections for the one or more test cases between the test framework server and the wireless equipment based on the port numbers of the one or more test cases; a session connection based on one or more test cases communicates with a wireless device. The method includes the steps that on the basis of port numbers of one or more test cases, one or more corresponding session connections are respectively established for the one or more test cases through a test framework server and the wireless equipment; the session connection based on one or more test cases is communicated with the wireless equipment, and each test case establishes an independent session connection, so that the downtime caused by resource exhaustion of a test framework server due to the shared session connection is avoided, and the execution efficiency of the test cases is improved.

Description

Test method and device, port generation method, port generator and test system
Technical Field
The present application relates to the field of test technologies, and in particular, to a test method and apparatus, a port generation method, a port generator, and a test system.
Background
With the continuous expansion of the services related to products in wireless equipment, a mobile automatic testing tool serving the services is an important guarantee for better improving the research and development efficiency of the products and improving the quality of the products. The product is usually realized in wireless equipment based on WebView, but the interaction scene of the WebView is increasingly complicated, the number of test cases used in each test is large, the execution time of each test case is long, and high requirements are provided for the test method.
In order to improve this problem, one conventional method is: the method comprises the steps of adding a test framework server between a test device and wireless equipment, establishing session connection between a test case end and the wireless equipment through the test framework server, completing command receiving, sending, data transmission and other communication between the test device and the wireless equipment, and realizing execution of all test cases in the test device on the wireless equipment.
Specifically, the testing device sends a session connection request to the testing framework server, and the testing framework server determines a session ID (Identity) according to the current resource condition of the wireless device, and establishes a one-time single-session connection between the testing device and the wireless device based on the session ID. All test cases in the test device are communicated with the wireless equipment based on the single-session connection, so that all test cases in the test device can be executed on the wireless equipment to complete the test.
In the method, all the test cases share one session connection, each test case in a plurality of test cases needs to wait when performing a connection request, and when one case execution link is long, the whole test framework server resource is monopolized all the time, so that the execution efficiency of the test case based on the method is low.
Disclosure of Invention
In order to improve the execution efficiency of a test case, the embodiment of the application provides a test method, a test device, a port generator and a test system.
In a first aspect, an embodiment of the present application provides a test system, including a processor and a memory, where the memory stores program instructions executed by the processor, and the program instructions include:
acquiring port numbers of one or more test cases, wherein the port numbers of the one or more test cases are different from each other;
respectively establishing one or more corresponding session connections for the one or more test cases through the test framework server and the wireless equipment based on the port numbers of the one or more test cases;
communicating with the wireless device based on the session connection of the one or more test cases to execute the one or more test cases on the wireless device.
In a second aspect, an embodiment of the present application provides a testing method, where the method includes:
acquiring port numbers of one or more test cases, wherein the port numbers of the one or more test cases are different from each other;
respectively establishing one or more corresponding session connections for the one or more test cases through the test framework server and the wireless equipment based on the port numbers of the one or more test cases;
communicating with the wireless device based on the session connection of the one or more test cases to execute the one or more test cases on the wireless device.
Optionally, the obtaining port numbers of one or more test cases includes:
determining the current connection quantity of any one of one or more test cases;
judging whether the current connection quantity exceeds the connection upper limit of the test framework server or not;
and if the current connection quantity does not exceed the connection upper limit of the test framework server, selecting the port number of one available port as the port number of any test case.
Optionally, after determining whether the current connection number exceeds the connection upper limit of the test framework server, the method further includes:
if the current connection number exceeds the connection upper limit of the test framework server, the steps of determining the current connection number and judging whether the current connection number exceeds the connection upper limit of the test framework server are repeatedly executed every preset time period until the port number of one available port is selected as the port number of any test case.
Optionally, the obtaining port numbers of one or more test cases includes:
for any test case in one or more test cases, sending a port number acquisition request of the test case to a port generator;
receiving a response message returned by the port generator, wherein the response message corresponds to the port number obtaining request of any test case;
determining whether a port number is included in the response message;
and if the response message comprises the port number, determining the port number comprised in the response message as the port number of any test case.
Optionally, after determining whether the response message includes the port number, the method further includes:
if the response message does not include the port number, repeatedly executing the steps of sending the port number obtaining request of any test case to the port generator every other preset time period, receiving the response message returned by the port generator, and determining whether the response message includes the port number or not until the response message includes the port number, and determining the port number included in the response message as the port number of any test case.
Optionally, after the session connection based on the one or more test cases communicates with the wireless device, the method further includes:
and if the test case with the execution finished exists, closing the session connection of the test case with the execution finished through the test framework server.
In a third aspect, an embodiment of the present application provides a testing apparatus, where the apparatus includes:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring the port numbers of one or more test cases, and the port numbers of the one or more test cases are different from each other;
the establishing module is used for respectively establishing one or more corresponding session connections for the one or more test cases between the test framework server and the wireless equipment based on the port numbers of the one or more test cases acquired by the acquiring module;
the testing module is used for communicating with the wireless device based on the session connection of the one or more test cases established by the establishing module so as to execute the one or more test cases on the wireless device.
Optionally, the obtaining module includes:
the first determining unit is used for determining the current connection quantity of any one test case in one or more test cases;
a judging unit, configured to judge whether the current connection number determined by the first determining unit exceeds a connection upper limit of the test framework server;
and the selecting unit is used for selecting the port number of one available port as the port number of any test case when the judging unit judges that the current connection number does not exceed the connection limit of the test framework server.
Optionally, the obtaining module further includes:
and the first circulation unit is used for repeatedly executing the steps of determining the current connection number and judging whether the current connection number exceeds the connection upper limit of the test frame server every other preset time period when the current connection number exceeds the connection upper limit of the test frame server until the port number of one available port is selected as the port number of any test case.
Optionally, the obtaining module includes:
the device comprises a sending unit, a port generator and a processing unit, wherein the sending unit is used for sending a port number acquisition request of any test case to the port generator for any test case in one or more test cases;
a receiving unit, configured to receive a response message returned by the port generator, where the response message corresponds to the port number obtaining request of any test case sent by the sending unit;
a second determining unit configured to determine whether the response message received by the receiving unit includes a port number;
a third determining unit, configured to determine, when the second determining unit determines that the response message includes the port number, the port number included in the response message as the port number of the any test case.
Optionally, the obtaining module further includes:
a second circulation unit, configured to, when the response message does not include the port number, repeatedly execute, every preset time period, the step of sending the port number acquisition request of any test case to the port generator, receiving the response message returned by the port generator, and determining whether the response message includes the port number until it is determined that the response message includes the port number, and determine the port number included in the response message as the port number of any test case.
Optionally, the apparatus further comprises:
and the closing module is used for closing the session connection of the test case with the execution finished through the test framework server when the test case with the execution finished exists.
In a fourth aspect, an embodiment of the present application provides a port generation method, where the method includes:
after receiving a port number acquisition request sent by a testing device, determining the current connection number;
judging whether the current connection quantity exceeds the connection upper limit of the test framework server or not;
and if the current connection quantity does not exceed the connection upper limit of the test framework server, selecting a port number of an available port, and returning a response message corresponding to the port number acquisition request, wherein the response message comprises the selected port number.
Optionally, after determining whether the current connection number exceeds the connection upper limit of the test framework server, the method further includes:
and if the current connection quantity exceeds the connection upper limit of the test framework server, returning a response message corresponding to the port number acquisition request, wherein the response message does not include the port number.
In a fifth aspect, an embodiment of the present application provides a port generator, where the port generator includes:
the determining module is used for determining the current connection quantity after receiving the port number obtaining request sent by the testing device;
the judging module is used for judging whether the current connection number determined by the determining module exceeds the connection upper limit of the test framework server or not;
and the returning module is used for selecting the port number of one available port and returning a response message corresponding to the port number acquisition request when the judging module judges that the current connection number does not exceed the connection limit of the test framework server, wherein the response message comprises the selected port number.
Optionally, the returning module is further configured to return a response message corresponding to the port number obtaining request when the current connection number exceeds the connection upper limit of the test framework server, where the response message does not include the port number.
The beneficial effects are as follows:
acquiring port numbers of one or more test cases; respectively establishing one or more corresponding session connections for the one or more test cases between the test framework server and the wireless equipment based on the port numbers of the one or more test cases; the session connection based on one or more test cases is communicated with the wireless equipment to execute one or more test cases on the wireless equipment, the independent session connection is established for each test case, and the one or more test cases are executed based on the corresponding session connection, so that the sessions of the test cases and the wireless equipment are isolated from each other, the high availability of the test frame server resources is improved, the problem that the test frame server resources are exhausted due to the long-time connection of the shared session, the downtime is caused is avoided, the stability and the reliability of the test case execution are improved, and the execution efficiency of the test cases is improved.
Drawings
Specific embodiments of the present application will be described below with reference to the accompanying drawings, in which:
fig. 1 is a schematic flow chart illustrating a testing method according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating a port generation method according to another embodiment of the present application;
FIG. 3 is a schematic flow chart diagram illustrating another testing method provided in another embodiment of the present application;
FIG. 4 is a schematic diagram illustrating data flow interaction among a terminal where a testing apparatus is located, a testing framework server, and a wireless device according to another embodiment of the present application;
FIG. 5 is a schematic flow chart diagram illustrating another testing method provided in another embodiment of the present application;
FIG. 6 is a diagram illustrating port allocation among a testing apparatus, a port generator, and a testing framework server according to another embodiment of the present application;
FIG. 7 is a schematic structural diagram of a testing apparatus according to another embodiment of the present application;
fig. 8 is a schematic structural diagram of an acquisition module according to another embodiment of the present application;
fig. 9 is a schematic structural diagram of another acquisition module according to another embodiment of the present application;
fig. 10 is a schematic structural diagram of another acquisition module according to another embodiment of the present application;
fig. 11 is a schematic structural diagram of another acquisition module according to another embodiment of the present application;
FIG. 12 is a schematic diagram illustrating another testing apparatus according to another embodiment of the present application;
fig. 13 is a schematic structural diagram of a port generator according to another embodiment of the present application;
fig. 14 shows a schematic structural diagram of a test system according to another embodiment of the present application.
Detailed Description
In order to make the technical solutions and advantages of the present application more apparent, the following further detailed description of the exemplary embodiments of the present application with reference to the accompanying drawings makes it clear that the described embodiments are only a part of the embodiments of the present application, and not an exhaustive list of all embodiments. And the embodiments and features of the embodiments in the present description may be combined with each other without conflict.
In the existing test based on the disposable single-session connection, all test cases share one session connection, each test case in a plurality of test cases needs to wait when performing a connection request, and when one case execution link is long, the whole test frame server resource is monopolized all the time, so that the execution efficiency of the test case is low. In order to improve the execution efficiency of the test cases, the application provides a test method, and the test method can acquire the port numbers of one or more test cases; respectively establishing one or more corresponding session connections for the one or more test cases between the test framework server and the wireless equipment based on the port numbers of the one or more test cases; the session connection based on one or more test cases is communicated with the wireless equipment to execute one or more test cases on the wireless equipment, the independent session connection is established for each test case, and the one or more test cases are executed based on the corresponding session connection, so that the sessions of the test cases and the wireless equipment are isolated from each other, the high availability of the test frame server resources is improved, the problem that the test frame server resources are exhausted due to the long-time connection of the shared session, the downtime is caused is avoided, the stability and the reliability of the test case execution are improved, and the execution efficiency of the test cases is improved.
In combination with the above-described implementation environment, the present embodiment provides a testing method. Referring to fig. 1, the method flow provided by this embodiment is specifically as follows:
101: acquiring port numbers of one or more test cases, wherein the port numbers of the one or more test cases are different from each other;
optionally, obtaining port numbers of one or more test cases includes:
determining the current connection quantity of any one of one or more test cases;
judging whether the current connection quantity exceeds the connection upper limit of the test framework server or not;
and if the current connection number does not exceed the connection upper limit of the test framework server, selecting the port number of one available port as the port number of any test case.
Optionally, after determining whether the current connection number exceeds the connection upper limit of the test framework server, the method further includes:
if the current connection number exceeds the connection upper limit of the test framework server, the steps of determining the current connection number and judging whether the current connection number exceeds the connection upper limit of the test framework server are repeatedly executed every preset time period until the port number of one available port is selected as the port number of any test case.
Optionally, obtaining port numbers of one or more test cases includes:
for any test case in one or more test cases, sending a port number acquisition request of any test case to a port generator;
receiving a response message returned by the port generator, wherein the response message corresponds to the port number acquisition request of any test case;
determining whether a port number is included in the response message;
and if the response message comprises the port number, determining the port number contained in the response message as the port number of any test case.
Optionally, after determining whether the response message includes the port number, the method further includes:
if the response message does not include the port number, repeatedly executing the steps of sending a port number acquisition request of any test case to the port generator every other preset time period, receiving the response message returned by the port generator, determining whether the response message includes the port number or not until the response message includes the port number, and determining the port number included in the response message as the port number of any test case.
102: respectively establishing one or more corresponding session connections for the one or more test cases between the test framework server and the wireless equipment based on the port numbers of the one or more test cases;
103: the wireless device is communicated based on the session connection of the one or more test cases to execute the one or more test cases on the wireless device.
Optionally, after communicating with the wireless device based on the session connection of the one or more test cases, the method further includes:
and if the test case with the execution finished exists, closing the session connection of the test case with the execution finished through the test framework server.
Has the advantages that:
acquiring port numbers of one or more test cases; respectively establishing one or more corresponding session connections through one or more test cases between the test framework server and the wireless equipment based on the port numbers of the one or more test cases; the session connection based on one or more test cases is communicated with the wireless equipment to execute one or more test cases on the wireless equipment, and the one or more test cases are executed based on the corresponding session connection by establishing an independent session connection for each test case, so that the sessions of the test cases and the wireless equipment are isolated from each other, the high availability of the test frame server resources is improved, the problem that the test frame server resources are exhausted due to the long-time connection of the shared session, the downtime is caused, the stability and the reliability of the test case execution are improved, and the execution efficiency of the test cases is improved.
In combination with the above implementation environment, the present embodiment provides a port generation method. Referring to fig. 2, the method flow provided by this embodiment is specifically as follows:
201: after receiving a port number acquisition request sent by a testing device, determining the current connection number;
202: judging whether the current connection quantity exceeds the connection upper limit of the test framework server or not;
203: and if the current connection quantity does not exceed the connection upper limit of the test framework server, selecting a port number of an available port, and returning a response message corresponding to the port number acquisition request, wherein the response message comprises the selected port number.
Optionally, after determining whether the current connection number exceeds the connection upper limit of the test framework server, the method further includes:
and if the current connection quantity exceeds the connection upper limit of the test framework server, returning a response message corresponding to the port number acquisition request, wherein the response message does not include the port number.
Has the advantages that:
after receiving a port number acquisition request sent by a testing device, determining the current connection number; judging whether the current connection quantity exceeds the connection upper limit of the test framework server or not; if the current connection quantity does not exceed the connection upper limit of the test framework server, selecting a port number of an available port, and returning a response message corresponding to the port number acquisition request, wherein the response message comprises the selected port number, so that different segment expansion and acquisition requests correspond to one port number, the test device can conveniently establish independent session connection for different test cases according to different port numbers, and the execution efficiency of the test cases is improved.
The test method provided by the application can be executed for each test case, namely, when each test case is tested. However, when one test case is tested by using the method provided by the present application, there may be other one or more test cases simultaneously tested by using the method provided by the present application, and therefore, there may be a case where a plurality of test cases are simultaneously tested by using the test method provided by the present application.
In addition, the test method provided by the present application may have 2 implementation forms, one is implemented by the test apparatus alone, and the other is implemented by the test apparatus and the port generator together, and each implementation form is described in detail below with 2 embodiments.
This embodiment describes in detail a manner in which the test method is implemented by the test apparatus alone. For convenience of explanation, this embodiment only describes one test case a as an example, and for implementation of other test cases, reference may be made to an implementation manner of the test case a. When the test case a is tested by the test method provided by this embodiment, part of other test cases may be tested by the method provided by this embodiment at the same time, that is, the test case a and part of other test cases execute each step at the same time. When the test case a is tested by the test method provided by this embodiment, part of other test cases may also be tested before or after the test case a is tested by the method provided by this embodiment, that is, when the test case a starts to execute the test method provided by this embodiment, part of other test cases have completed part of the steps of the test method provided by this embodiment, or when the test case a completes part of the steps of the test method provided by this embodiment, part of other test cases start to execute the test method provided by this embodiment.
Referring to fig. 3, the flow of the testing method provided in this embodiment is specifically as follows:
301: when the test case A is started, acquiring a port number of the test case A;
wherein, the port numbers of the test cases are different from each other;
the specific implementation manner of obtaining the port number of the test case a includes, but is not limited to, the following 4 steps:
step 1: determining the current connection number;
in one or more test cases for testing, each test case is tested according to its own test track, that is, according to its own test attributes such as test start time, test steps, etc., so that the connection number of the terminal where the test device is located continuously changes with time. And determining the number of the connections at the moment when the test cases need to acquire the port numbers.
Step 2: judging whether the current connection quantity exceeds the connection upper limit of the test frame server, if not, executing the step 3, and if so, executing the step 4;
since the session connection is established through the test framework server, the upper connection limit of the test framework server has a direct impact on the session connection. If the current connection quantity does not exceed the connection upper limit of the test frame server, the session connection with the test frame server can be established, and if the current connection quantity exceeds the connection upper limit of the test frame server, the session connection with the test frame server cannot be established.
And 2, determining a specific acquisition method of the port number of the test case A according to the relation between the current connection number of the terminal where the test device is located and the connection upper limit of the test framework server.
And step 3: selecting the port number of an available port as the port number of the test case A;
the precondition for executing the step is that the current connection quantity does not exceed the connection upper limit of the test framework server, and at this time, the terminal where the test device is located can also establish session connection with the test framework server.
The specific implementation manner of step 3 may be: generating a port number randomly, then checking whether the port corresponding to the port number is occupied by other processes,
(1) if the port corresponding to the port number is not occupied by other processes of the terminal where the test device is located, it is indicated that the port corresponding to the port number is available, and the port number is used as the port number of the test case A.
(2) If the port corresponding to the port number is occupied by other processes of the terminal where the testing device is located, it indicates that the port corresponding to the port number is not available, a port number is regenerated, whether the port corresponding to the regenerated port number is occupied by other processes of the terminal where the testing device is located is checked,
●, if the port corresponding to the regenerated port number is not occupied by another process of the terminal where the test device is located, the regenerated port number is used as the port number of the test case a.
●, if the port corresponding to the regenerated port number is occupied by other processes of the terminal where the testing device is located, repeating the step of regenerating a port number to see whether the port corresponding to the regenerated port number is occupied by other processes of the terminal where the testing device is located until finding the port number of an available port as the port number of the test case A.
And 4, step 4: and adding 1 to the port number acquisition times of the test case A, and acquiring the port number of the test case A again after a preset time period.
For example, the current connection number is determined again, and whether the re-determined current connection number exceeds the connection upper limit of the test framework server is judged;
(1) if the determined current connection number does not exceed the connection upper limit of the test framework server, selecting the port number of one available port as the port number of the test case A;
(2) and if the determined current connection number exceeds the connection upper limit of the test framework server, repeatedly executing the steps of adding 1 to the port number acquisition times of the test case A, determining the current connection number again after a preset time period, and judging whether the determined current connection number exceeds the connection upper limit of the test framework server or not until the port number of one available port is selected as the port number of the test case A.
After the 4 steps are executed, the port number of the test case a is obtained. However, when the step of obtaining the port number of the test case a is executed, other test cases may also execute the step 301 in the corresponding process to obtain the port numbers of other processes. Therefore, a plurality of test cases may acquire the corresponding port numbers at the same time.
For example 1, the test case a obtains the port number of the test case a by executing the method provided by this embodiment through the process a, and the test case B obtains the port number of the test case B by executing the method provided by this embodiment through the process B.
As another example 2, the test case C first obtains the port number of the test case C by executing the method provided in this embodiment through the process C, but when the test case C is executed to the step 2, it is determined that the current connection number exceeds the connection upper limit of the test framework server, and then the step 4 is executed, when the step 4 is executed, the number of obtaining the port number of the test case C is added by 1, and after a preset time period, the port number of the test case C is obtained again. When the port number of the test case C is obtained again, the test case a obtains the port number of the test case a by executing the method provided by this embodiment through the process a.
For the case that a plurality of test cases acquire port numbers simultaneously, the implementation manner of acquiring the port numbers of the test cases includes, but is not limited to: and acquiring the port numbers of the plurality of test cases from high to low in sequence according to the port number acquisition times of the plurality of test cases.
The obtaining mode of the port number of each test case can be realized through the steps 1 to 4.
Taking the above example 2 as an example, if the initial values of the port number acquisition times of the test cases are all 0, since the port number acquisition times of the test case C is increased by 1 once, the port number acquisition times becomes 1, and the test case a performs the test by implementing the method provided in this embodiment for the first time, the port number acquisition times of the test case a is 0. At this time, the step of obtaining the port number of the test case C is executed first, and after the step of obtaining the port number of the test case C is obtained, or the number of obtaining the port number of the test case C is added by 1 again, and a waiting period of a preset time period is entered, the step of obtaining the port number of the test case a is executed.
302: establishing corresponding session connection for the test case A through the test framework server and the wireless equipment based on the port number of the test case A;
this step may be implemented by a handshake protocol. For example: the terminal where the test apparatus is located sends a session connection request to the test framework server based on the port number of the test case a acquired in step 301, the test framework server determines whether the wireless device is available, whether the resources and services of the wireless device are sufficient, and after passing the necessary verification of the wireless device, determines a session ID, and establishes a session connection a between the terminal where the test apparatus is located and the wireless device based on the session ID. The session connection a established here is only the session connection of the test case a, and for other test cases, communication with the wireless device cannot be performed through the session connection a.
In the prior art, all test cases communicate through a common session connection, and in the method provided by this embodiment, each test case communicates through an independent session connection. Compared with the prior art, the session connection establishing method provided by the embodiment has better flexibility, can improve the availability of the test framework server resources, and improves the stability and reliability of the test case execution.
303: communicating with the wireless device based on the session connection of the test case A to execute the test case A on the wireless device;
for example, the test terminal communicates with the wireless device based on the session connection of the test case a according to the test description of the test case a, and executes the test case a on the wireless device to test the corresponding function of the wireless device.
304: and if the test case with the execution finished exists, closing the session connection of the test case with the execution finished through the test framework server.
In the synchronization steps 301 to 304, different port numbers can be determined for different test cases, different session connections are established with the wireless device through the test framework server based on the different port numbers, and different test cases are executed through the different session connections to complete respective tests. And when the execution of any test case is finished, only the session connection of the test case which is finished is closed, and the session connections of other test cases which are being executed are not closed, so that the session connections of different test cases are isolated from each other, and the phenomenon that the resources of a test frame server cannot be released and the resource of the test frame server is exhausted and crashed due to the fact that all the test cases always share one session connection is avoided.
Fig. 4 shows data flow interaction among the terminal where the test apparatus is located, the test framework server, and the wireless device, where the bold arrows with black heart indicate data flows involved in session connection, and the bold arrows with white heart indicate data flows involved in test case execution.
Has the advantages that:
acquiring port numbers of one or more test cases; respectively establishing one or more corresponding session connections for the one or more test cases between the test framework server and the wireless equipment based on the port numbers of the one or more test cases; the session connection based on one or more test cases is communicated with the wireless equipment to execute one or more test cases on the wireless equipment, the independent session connection is established for each test case, and the one or more test cases are executed based on the corresponding session connection, so that the sessions of the test cases and the wireless equipment are isolated from each other, the high availability of the test frame server resources is improved, the problem that the test frame server resources are exhausted due to the long-time connection of the shared session, the downtime is caused is avoided, the stability and the reliability of the test case execution are improved, and the execution efficiency of the test cases is improved.
In this embodiment, a detailed description is given of a manner in which the test apparatus and the port generator jointly implement the test method, where the port generator may be located in the same terminal as the test apparatus or in different terminals.
For convenience of explanation, the present embodiment is still described by taking one test case a as an example, and for the implementation of other test cases, reference may be made to the implementation of the test case a. Of course, when the test case a is tested by the test method provided in this embodiment, some other test cases may be tested by the method provided in this embodiment at the same time, or may be tested by the method provided in this embodiment before or after the test case a is tested by the method provided in this embodiment.
Referring to fig. 5, the method flow provided by this embodiment is specifically as follows:
501: when a test case A is started, the test device sends a port number acquisition request of the test case A to a port generator;
the port number obtaining request of the test case a includes but is not limited to: a test device identification, an identification of a test case a, etc.
In addition, the port number obtaining request of the test case a includes the port number obtaining times of the test case a, and whether the port number obtaining times of the test case a is included may be determined as appropriate according to the number of times the test case a requests the port number. For example, if the port number obtaining request of the test case a is sent to the port generator for the first time, the port number obtaining request may or may not include the number of times of obtaining the port number of the test case a. If the port number obtaining request of the test case a is not sent to the port generator for the first time, the port number obtaining request must include the number of obtaining times of the port number of the test case a.
In order to describe all the execution steps of the test method provided by this embodiment, in this embodiment, a port number obtaining request of the test case a is sent to the port generator for the first time in step 501, and the port number obtaining request does not include the number of obtaining times of the port number of the test case a, and the port number obtaining request of the test case a is not sent to the port generator for the first time in step 509, and the port number obtaining request includes the number of obtaining times of the port number of the test case a.
502: after receiving a port number acquisition request sent by a testing device, a port generator determines the current connection number;
because each test case is tested according to the test track of the test case, the connection number of the terminal where the test device is located continuously changes along with the difference of time. And determining the connection number of the terminal where the testing device is located at the moment each time after receiving the port number acquisition request sent by the testing device.
Specifically, if the test apparatus and the port generator are located in the same terminal, the port generator directly obtains the current connection number of the terminal. If the testing device and the port generator are located in different terminals, the terminal where the port generator is located communicates with the terminal where the testing device is located, and the current connection number of the terminal where the testing device is located is obtained.
503: the port generator judges whether the current connection quantity exceeds the connection upper limit of the test frame server, if the current connection quantity does not exceed the connection upper limit of the test frame server, step 504 is executed, and if the current connection quantity exceeds the connection upper limit of the test frame server, step 505 is executed;
since the session connection is established through the test framework server, the upper connection limit of the test framework server has a direct impact on the session connection. If the current connection quantity does not exceed the connection upper limit of the test frame server, the session connection with the test frame server can be established, and if the current connection quantity exceeds the connection upper limit of the test frame server, the session connection with the test frame server cannot be established.
In step 503, the port generator determines a specific method of the response message corresponding to the port number obtaining request received in step 502 according to a relationship between the current connection number of the terminal where the testing device is located and the connection upper limit of the testing framework server.
504: the port generator selects a port number of an available port, and returns a response message corresponding to the port number acquisition request, wherein the response message comprises the selected port number;
the precondition for executing the step is that the current connection quantity does not exceed the connection upper limit of the test framework server, and at this time, the terminal where the test device is located can also establish session connection with the test framework server.
The specific implementation of step 504 may be: firstly, randomly generating a port number, then, judging whether the port corresponding to the port number is occupied by other processes of the terminal where the testing device is located,
(1) if the port corresponding to the port number is not occupied by other processes of the terminal where the testing device is located, it indicates that the port corresponding to the port number is available, and the port number is taken as the selected port number.
(2) If the port corresponding to the port number is occupied by other processes of the terminal where the testing device is located, it indicates that the port corresponding to the port number is not available, a port number is regenerated, whether the port corresponding to the regenerated port number is occupied by other processes of the terminal where the testing device is located is checked,
●, if the port corresponding to the regenerated port number is not occupied by another process of the terminal where the test device is located, the regenerated port number is used as the selected port number.
● if the port corresponding to the regenerated port number is occupied by other processes of the terminal where the testing device is located, repeating the step of regenerating a port number to see if the port corresponding to the regenerated port number is occupied by other processes of the terminal where the testing device is located until finding the port number of an available port as the selected port number.
505: the port generator returns a response message corresponding to the port number obtaining request, and the response message does not include the port number;
in practical applications, in order to more clearly identify that the port generator has not acquired an available port number, the unavailable port number may be indicated by special content, for example, an empty port. In this case, the response message returned may include, although not including the port number, an empty port:
for convenience of description, this embodiment will be described by taking as an example a case where, when the port generator does not acquire an available port number, the returned response message does not include the port number, but includes an empty port.
After steps 503 to 505 are performed, the port generator returns a response message corresponding to the port number obtaining request received in step 502, but the response message may include the port number or includes an empty port.
In addition, steps 502 to 505 only refer to the case where the port generator receives one port number acquisition request sent by the test apparatus, and refer to step 510 for the case where the port generator receives multiple port number acquisition requests sent by the test apparatus at the same time.
506: the test terminal receives a first response message returned by the port generator;
the response message received in step 506 is a response message corresponding to the port number obtaining request of the test case a sent in step 501, and the response message includes a port number, or the response message does not include a port number but includes an empty port.
In order to distinguish the response message corresponding to the port number obtaining request of the test case a which is sent again subsequently, the response message is referred to as a first response message.
507: the test terminal determines whether the first response message includes the port number, if the first response message includes the port number, step 508 is executed, and if the first response message does not include the port number but includes an empty port, step 509 is executed;
508: the test terminal determines the port number included in the first response message as the port number of the test case A;
after this step is performed, step 512 to step 514 are directly performed.
509: the test terminal adds 1 to the port number obtaining times of the test case A, and sends a port number obtaining request of the test case A to the port generator again after a preset time period;
for example, if the first response message returned by the port generator received by the test terminal in step 506 includes an empty port, the test terminal adds 1 to the port number acquisition count of the test case a when performing step 509, and if the initial value of the port number acquisition count is 0, the port number acquisition count at this time becomes 1, and after a preset time period, sends the port number acquisition request of the test case a to the port generator again.
510: after receiving the port number obtaining request sent by the test device for the test case A again, the port generator returns a response message corresponding to the port number obtaining request;
if the port generator only receives the port number obtaining request of the test device sending the test case a again, that is, only receives one port number obtaining request, in the step 510, the steps 503 to 505 may be repeatedly executed.
If step 510 is executed, the port generator not only receives the port number obtaining request of the test device sending the test case a again, but also receives the port number obtaining requests of other test cases sent by the test device, that is, receives a plurality of port number obtaining requests. For this case, the port number obtaining request of the test case a sent again includes the number of times of obtaining the port number. For example: the number of times of acquiring the port number of the test case a is 1. The port number obtaining requests of other test cases may or may not include the corresponding port number obtaining times. If the number of port number acquisition times is not included, the number of port number acquisition times may be considered as an initial value, for example, 0.
For the situation that a plurality of port number acquisition requests are received at the same time, the port generator can firstly select one port number acquisition request from high to low according to the number of port number acquisition times included in each port number acquisition request; and executing the steps 503 to 505 aiming at the selected port number acquisition request, and returning a response message corresponding to the selected port number acquisition request.
For example, if the port generator receives 2 port number obtaining requests at the same time, the port number obtaining requests are respectively the port number obtaining request of the test case a which is sent again, and the port number obtaining request of the test case D which is sent for the first time. The port number obtaining request of the test case a is sent for the second time, and the port number obtaining request of the test case a includes the number of obtaining the port number, and is 1. Since the port number obtaining request of the test case D is sent for the first time, if the port number obtaining request of the test case D can include the port number obtaining times and is 0, the step 503 to the step 505 are executed to respond to the port number obtaining request of the test case a, and after the corresponding message including the port number or the empty port is returned, the step 503 to the step 505 are executed to respond to the port number obtaining request of the test case D.
For another example, if the port generator receives 2 port number obtaining requests at the same time, the port number obtaining requests are respectively the port number obtaining request of the test case a that is sent again, the port number obtaining request of the test case E that is sent for the first time, and the initial values of the port number obtaining times are all 0. The port number obtaining request of the test case a is sent for the second time, and the port number obtaining request of the test case a includes the number of obtaining the port number, and is 1. The port number obtaining request of the test case E is sent for the first time, and if the port number obtaining request of the test case E does not include the port number obtaining times, the port number obtaining times of the port number obtaining request of the test case E is determined to be 0. At this time, the method executes 503 to 505 to respond to the port number obtaining request of the test case a, and then executes 503 to 505 to respond to the port number obtaining request of the test case E after returning the corresponding message including the port number or the empty port.
511: the testing device receives a second response message returned by the port generator, and determines the port number of the test case A according to the second response message;
and the second response message corresponds to the port number obtaining request of the test case A which is sent again.
Like the first response message, the second response message may include the port number or may include an empty port.
If the second response message includes the port number, the testing device executes step 508 to determine the port number included in the second response message as the port number of the test case a.
If the second response message includes an empty port, the testing device repeatedly executes steps 509 to 511, adds 1 to the number of port number acquisition times of any test case, sends a port number acquisition request of any test case to the port generator again after a preset time period, receives a second response message returned by the port generator, the second response message corresponds to the port number acquisition request of any test case sent again, and determines whether the second response message includes the port number until it is determined that the second response message includes the port number.
512: the testing device establishes corresponding session connection for the test case A through the test framework server and the wireless equipment based on the port number of the test case A;
the implementation manner of this step is the same as that of step 302, and is described in detail in step 302, which is not described herein again.
513: the testing device communicates with the wireless equipment based on the session connection of the test case A so as to execute the test case A on the wireless equipment;
the implementation manner of this step is the same as that of step 303, and details are referred to in step 303 and are not described herein again.
514: and if the test case with the execution finished exists, closing the session connection of the test case with the execution finished through the test framework server.
The implementation manner of this step is the same as that of step 304, and is described in detail in step 304, which is not described herein again.
Fig. 6 shows port allocation among the test apparatus, the port generator, and the test framework server.
Has the advantages that:
acquiring port numbers of one or more test cases from a port generator; respectively establishing one or more corresponding session connections for the one or more test cases between the test framework server and the wireless equipment based on the port numbers of the one or more test cases; the session connection based on one or more test cases is communicated with the wireless equipment to execute one or more test cases on the wireless equipment, the independent session connection is established for each test case, and the one or more test cases are executed based on the corresponding session connection, so that the sessions of the test cases and the wireless equipment are isolated from each other, the high availability of the server resources of the test framework is improved, the problem that the server resources are exhausted due to the long-time connection of the shared session, the downtime is caused is avoided, the stability and the reliability of the execution of the test cases are improved, and the execution efficiency of the test cases is improved.
Based on the same inventive concept, the present embodiment provides a testing apparatus, and since the principle of the apparatus for solving the problem is similar to that of the testing method shown in fig. 1, the implementation of the apparatus can refer to the embodiment of the method shown in fig. 1, and repeated details are omitted.
Referring to fig. 7, the apparatus includes:
an obtaining module 701, configured to obtain port numbers of one or more test cases, where the port numbers of the one or more test cases are different from each other;
an establishing module 702, configured to respectively establish one or more corresponding session connections for one or more test cases between the test framework server and the wireless device based on the port numbers of the one or more test cases acquired by the acquiring module 701;
a testing module 703 for communicating with the wireless device based on the session connection of the one or more test cases established by the establishing module 702 to execute the one or more test cases on the wireless device.
Referring to fig. 8, the obtaining module 701 includes:
a first determining unit 7011, configured to determine, for any test case in the one or more test cases, the current connection number;
a judging unit 7012, configured to judge whether the current connection number determined by the first determining unit 7011 exceeds the connection upper limit of the test framework server;
a selecting unit 7013, configured to select, when determining unit 7012 determines that the current connection number does not exceed the connection limit of the test framework server, a port number of one available port as a port number of any test case.
Referring to fig. 9, the obtaining module 701 further includes:
a first circulation unit 7014, configured to repeatedly execute the steps of determining the current connection number and determining whether the current connection number exceeds the connection upper limit of the test framework server every preset time period when the current connection number exceeds the connection upper limit of the test framework server until a port number of one available port is selected as a port number of any test case.
Referring to fig. 10, the obtaining module 701 includes:
a sending unit 7015, configured to send, to a port generator, a port number obtaining request of any test case in the one or more test cases;
a receiving unit 7016, configured to receive a response message returned by the port generator, where the response message corresponds to the port number obtaining request of any test case sent by the sending unit;
a second determining unit 7017, configured to determine whether the response message received by receiving unit 7016 includes a port number;
third determining unit 7018, configured to determine, when second determining unit 7017 determines that the response message includes the port number, the port number included in the first response message as the port number of any test case.
Referring to fig. 11, the obtaining module 701 further includes:
a second circulation unit 7019, configured to, when the response message does not include the port number, repeatedly execute, every preset time period, a step of sending a port number obtaining request of any test case to the port generator, receive the response message returned by the port generator, and determine whether the response message includes the port number until it is determined that the response message includes the port number, and determine the port number included in the response message as the port number of any test case.
Referring to fig. 12, the apparatus further comprises:
and a closing module 704, configured to close, by the test framework server, a session connection of the test case whose execution is finished when the test case whose execution is finished exists.
The beneficial effects are as follows:
acquiring port numbers of one or more test cases; respectively establishing one or more corresponding session connections for the one or more test cases between the test framework server and the wireless equipment based on the port numbers of the one or more test cases; the session connection based on one or more test cases is communicated with the wireless equipment to execute one or more test cases on the wireless equipment, the independent session connection is established for each test case, and the one or more test cases are executed based on the corresponding session connection, so that the sessions of the test cases and the wireless equipment are isolated from each other, the high availability of the server resources of the test framework is improved, the problem that the server resources are exhausted due to the long-time connection of the shared session, the downtime is caused is avoided, the stability and the reliability of the execution of the test cases are improved, and the execution efficiency of the test cases is improved.
Based on the same inventive concept, the present embodiment provides a port generator, and since the principle of the port generator to solve the problem is similar to that of the testing method shown in fig. 2, the implementation of the port generator may refer to the embodiment of the method shown in fig. 2, and repeated details are not repeated.
Referring to fig. 13, the port generator includes:
a determining module 1301, configured to determine the current connection number after receiving a port number obtaining request sent by a test apparatus;
a judging module 1302, configured to judge whether the current connection number determined by the determining module 1301 exceeds the connection upper limit of the test framework server;
a returning module 1303, configured to, when the determining module 1302 determines that the current connection number does not exceed the connection limit of the test framework server, select a port number of an available port, and return a response message corresponding to the port number obtaining request, where the response message includes the selected port number.
Optionally, the returning module 1303 is further configured to return a response message corresponding to the port number obtaining request when the current connection number exceeds the connection upper limit of the test framework server, where the response message does not include the port number.
The beneficial effects are as follows:
when each test case is started, acquiring the port number of each test case from the port generator; establishing session connection of each test case between the test framework server and the wireless equipment respectively based on the port number of each test case; the session connection based on each test case is communicated with the wireless equipment to execute each test case on the wireless equipment, each test case establishes respective session connection, and each test case is executed based on the respective session connection, so that the sessions of each test case and the wireless equipment are isolated from each other, the high availability of server resources is improved, the downtime caused by the exhaustion of the server resources due to the connection maintenance of one session for a very long time is avoided, the stability and the reliability of the execution of the test cases are improved, and the execution efficiency of the test cases is improved.
Based on the same inventive concept, referring to fig. 14, the present embodiment provides a testing system, which is configured to execute the testing method provided by the above embodiment, and the system includes:
a processor 1401 and a memory 1402, the memory 1402 storing program instructions for execution by the processor 1401.
Wherein the program instructions include:
acquiring port numbers of one or more test cases, wherein the port numbers of the one or more test cases are different from each other;
respectively establishing one or more corresponding session connections for the one or more test cases between the test framework server and the wireless equipment based on the port numbers of the one or more test cases;
the wireless device is communicated based on the session connection of the one or more test cases to execute the one or more test cases on the wireless device.
Optionally, obtaining port numbers of one or more test cases includes:
determining the current connection quantity of any one of one or more test cases;
judging whether the current connection quantity exceeds the connection upper limit of the test framework server or not;
and if the current connection number does not exceed the connection upper limit of the test framework server, selecting the port number of one available port as the port number of any test case.
Optionally, after determining whether the current connection number exceeds the connection upper limit of the test framework server, the method further includes:
if the current connection number exceeds the connection upper limit of the test framework server, the steps of determining the current connection number and judging whether the current connection number exceeds the connection upper limit of the test framework server are repeatedly executed every preset time period until the port number of one available port is selected as the port number of any test case.
Optionally, obtaining port numbers of one or more test cases includes:
for any test case in one or more test cases, sending a port number acquisition request of any test case to a port generator;
receiving a response message returned by the port generator, wherein the response message corresponds to the port number acquisition request of any test case;
determining whether a port number is included in the response message;
and if the response message comprises the port number, determining the port number contained in the response message as the port number of any test case.
Optionally, after determining whether the response message includes the port number, the method further includes:
if the response message does not include the port number, repeatedly executing the steps of sending a port number acquisition request of any test case to the port generator every other preset time period, receiving the response message returned by the port generator, determining whether the response message includes the port number or not until the response message includes the port number, and determining the port number included in the response message as the port number of any test case.
Optionally, after communicating with the wireless device based on the session connection of the one or more test cases, the method further includes:
and if the test case with the execution finished exists, closing the session connection of the test case with the execution finished through the test framework server.
The beneficial effects are as follows:
the processor executes the following program instructions stored in the processor to acquire port numbers of one or more test cases; respectively establishing one or more corresponding session connections for the one or more test cases between the test framework server and the wireless equipment based on the port numbers of the one or more test cases; the session connection based on one or more test cases is communicated with the wireless equipment to execute one or more test cases on the wireless equipment, the independent session connection is established for each test case, and the one or more test cases are executed based on the corresponding session connection, so that the sessions of the test cases and the wireless equipment are isolated from each other, the high availability of the test frame server resources is improved, the problem that the test frame server resources are exhausted due to the long-time connection of the shared session, the downtime is caused is avoided, the stability and the reliability of the test case execution are improved, and the execution efficiency of the test cases is improved.
For convenience of description, each part of the above apparatus is separately described as being functionally divided into various modules or units. Of course, the functionality of the various modules or units may be implemented in the same one or more pieces of software or hardware in practicing the invention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.

Claims (17)

1. A test system comprising a processor and a memory, the memory storing program instructions for execution by the processor, the program instructions comprising:
acquiring port numbers of one or more test cases, wherein the port numbers of the one or more test cases are different from each other;
respectively establishing one or more corresponding session connections for the one or more test cases through the test framework server and the wireless equipment based on the port numbers of the one or more test cases;
communicating with the wireless device based on the session connection of the one or more test cases to execute the one or more test cases on the wireless device.
2. A method of testing, the method comprising:
acquiring port numbers of one or more test cases, wherein the port numbers of the one or more test cases are different from each other;
respectively establishing one or more corresponding session connections for the one or more test cases through the test framework server and the wireless equipment based on the port numbers of the one or more test cases;
communicating with the wireless device based on the session connection of the one or more test cases to execute the one or more test cases on the wireless device.
3. The method of claim 2, wherein obtaining port numbers of the one or more test cases comprises:
determining the current connection quantity of any one of one or more test cases;
judging whether the current connection quantity exceeds the connection upper limit of the test framework server or not;
and if the current connection quantity does not exceed the connection upper limit of the test framework server, selecting the port number of one available port as the port number of any test case.
4. The method of claim 3, wherein after determining whether the current number of connections exceeds an upper connection limit of the test framework server, further comprising:
if the current connection number exceeds the connection upper limit of the test framework server, the steps of determining the current connection number and judging whether the current connection number exceeds the connection upper limit of the test framework server are repeatedly executed every preset time period until the port number of one available port is selected as the port number of any test case.
5. The method of claim 2, wherein obtaining port numbers of the one or more test cases comprises:
for any test case in one or more test cases, sending a port number acquisition request of the test case to a port generator;
receiving a response message returned by the port generator, wherein the response message corresponds to the port number obtaining request of any test case;
determining whether a port number is included in the response message;
and if the response message comprises the port number, determining the port number comprised in the response message as the port number of any test case.
6. The method of claim 5, wherein after determining whether the port number is included in the response message, the method further comprises:
if the response message does not include the port number, repeatedly executing the steps of sending the port number obtaining request of any test case to the port generator every other preset time period, receiving the response message returned by the port generator, and determining whether the response message includes the port number or not until the response message includes the port number, and determining the port number included in the response message as the port number of any test case.
7. The method of claim 2, wherein after communicating with the wireless device the one or more test case based session connections, further comprising:
and if the test case with the execution finished exists, closing the session connection of the test case with the execution finished through the test framework server.
8. A test apparatus, the apparatus comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring the port numbers of one or more test cases, and the port numbers of the one or more test cases are different from each other;
the establishing module is used for respectively establishing one or more corresponding session connections for the one or more test cases between the test framework server and the wireless equipment based on the port numbers of the one or more test cases acquired by the acquiring module;
the testing module is used for communicating with the wireless device based on the session connection of the one or more test cases established by the establishing module so as to execute the one or more test cases on the wireless device.
9. The apparatus of claim 8, wherein the obtaining module comprises:
the first determining unit is used for determining the current connection quantity of any one test case in one or more test cases;
a judging unit, configured to judge whether the current connection number determined by the first determining unit exceeds a connection upper limit of the test framework server;
and the selecting unit is used for selecting the port number of one available port as the port number of any test case when the judging unit judges that the current connection number does not exceed the connection limit of the test framework server.
10. The apparatus of claim 9, wherein the obtaining module further comprises:
and the first circulation unit is used for repeatedly executing the steps of determining the current connection number and judging whether the current connection number exceeds the connection upper limit of the test frame server every other preset time period when the current connection number exceeds the connection upper limit of the test frame server until the port number of one available port is selected as the port number of any test case.
11. The apparatus of claim 8, wherein the obtaining module comprises:
the device comprises a sending unit, a port generator and a processing unit, wherein the sending unit is used for sending a port number acquisition request of any test case to the port generator for any test case in one or more test cases;
a receiving unit, configured to receive a response message returned by the port generator, where the response message corresponds to the port number obtaining request of any test case sent by the sending unit;
a second determining unit configured to determine whether the response message received by the receiving unit includes a port number;
a third determining unit, configured to determine, when the second determining unit determines that the response message includes the port number, the port number included in the response message as the port number of the any test case.
12. The apparatus of claim 11, wherein the obtaining module further comprises:
a second circulation unit, configured to, when the response message does not include the port number, repeatedly execute, every preset time period, the step of sending the port number acquisition request of any test case to the port generator, receiving the response message returned by the port generator, and determining whether the response message includes the port number until it is determined that the response message includes the port number, and determine the port number included in the response message as the port number of any test case.
13. The apparatus of claim 8, further comprising:
and the closing module is used for closing the session connection of the test case with the execution finished through the test framework server when the test case with the execution finished exists.
14. A method of generating a port number, which is a port number of a test case executed in the test method of any one of claims 2 to 7, the method comprising:
after receiving a port number acquisition request sent by a testing device, determining the current connection number;
judging whether the current connection quantity exceeds the connection upper limit of the test framework server or not;
and if the current connection quantity does not exceed the connection upper limit of the test framework server, selecting a port number of an available port, and returning a response message corresponding to the port number acquisition request, wherein the response message comprises the selected port number.
15. The method of claim 14, wherein after determining whether the current number of connections exceeds an upper connection limit of the test framework server, further comprising:
and if the current connection quantity exceeds the connection upper limit of the test framework server, returning a response message corresponding to the port number acquisition request, wherein the response message does not include the port number.
16. A port number generator for generating a port number for a test case in the test method of any one of claims 2 to 7, the port number generator comprising:
the determining module is used for determining the current connection quantity after receiving the port number obtaining request sent by the testing device;
the judging module is used for judging whether the current connection number determined by the determining module exceeds the connection upper limit of the test framework server or not;
and the returning module is used for selecting the port number of one available port and returning a response message corresponding to the port number acquisition request when the judging module judges that the current connection number does not exceed the connection limit of the test framework server, wherein the response message comprises the selected port number.
17. The port generator of claim 16, wherein the returning module is further configured to return a response message corresponding to the port number obtaining request when the current number of connections exceeds the connection upper limit of the test framework server, and the response message does not include the port number.
CN201610464998.XA 2016-06-23 2016-06-23 Test method and device, port generation method, port generator and test system Active CN107015906B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610464998.XA CN107015906B (en) 2016-06-23 2016-06-23 Test method and device, port generation method, port generator and test system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610464998.XA CN107015906B (en) 2016-06-23 2016-06-23 Test method and device, port generation method, port generator and test system

Publications (2)

Publication Number Publication Date
CN107015906A CN107015906A (en) 2017-08-04
CN107015906B true CN107015906B (en) 2020-12-04

Family

ID=59439057

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610464998.XA Active CN107015906B (en) 2016-06-23 2016-06-23 Test method and device, port generation method, port generator and test system

Country Status (1)

Country Link
CN (1) CN107015906B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110674030A (en) * 2019-08-27 2020-01-10 北京金堤科技有限公司 Application testing method and device, computer readable storage medium and electronic equipment
CN112395204B (en) * 2020-12-04 2024-04-16 京东科技信息技术有限公司 Method, system, related device and medium for obtaining test coverage rate

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247293A (en) * 2008-03-11 2008-08-20 福建星网锐捷网络有限公司 Automatic test approach and system
CN102104504A (en) * 2009-12-21 2011-06-22 中兴通讯股份有限公司 Platform and method for testing northbound interface
CN103298016A (en) * 2012-02-27 2013-09-11 展讯通信(上海)有限公司 Test system for mobile terminals
CN104731702A (en) * 2013-12-23 2015-06-24 展讯通信(上海)有限公司 Test system and service side thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8755340B2 (en) * 2010-11-08 2014-06-17 Blackberry Limited Releasing wireless resources
US10042747B2 (en) * 2014-11-12 2018-08-07 International Business Machines Corporation System and method for determining requirements for testing software

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247293A (en) * 2008-03-11 2008-08-20 福建星网锐捷网络有限公司 Automatic test approach and system
CN102104504A (en) * 2009-12-21 2011-06-22 中兴通讯股份有限公司 Platform and method for testing northbound interface
CN103298016A (en) * 2012-02-27 2013-09-11 展讯通信(上海)有限公司 Test system for mobile terminals
CN104731702A (en) * 2013-12-23 2015-06-24 展讯通信(上海)有限公司 Test system and service side thereof

Also Published As

Publication number Publication date
CN107015906A (en) 2017-08-04

Similar Documents

Publication Publication Date Title
CN109376088B (en) Automatic test system and automatic test method
CN110099029A (en) A kind of auth method, terminal device and server
CN105915367B (en) online debugging method, terminal and server
CN107015906B (en) Test method and device, port generation method, port generator and test system
CN110768988A (en) Method and device for establishing SSL VPN tunnel
CN106484620B (en) Method for testing multi-system terminal equipment, control equipment and console
CN109460361A (en) Performance test methods and device, storage medium and electronic device
CN107015902B (en) Test method and test equipment
CN107508784B (en) Application login method and terminal equipment
CN108512682B (en) Method and device for determining false terminal identification
CN106576068B (en) A kind of software security verification method, equipment and system
CN112732799B (en) Method and device for querying Fabric Block Link book data
CN111131262B (en) Vulnerability scanning method and device
CN110446197B (en) Communication control method, device, equipment and storage medium of intelligent equipment
CN114640657A (en) Multi-registration center fusion method and device
CN114666255B (en) Method for testing network distribution performance of Internet of things equipment and related equipment thereof
CN115657646A (en) Test method and device of CAN controller
CN110855528A (en) Message processing method and test equipment
CN107645727B (en) Method and device for testing base station
CN106997291B (en) Control method, master node and slave node
CN111061623B (en) Method, device, middle server, storage medium and system for debugging program
CN112766486A (en) Searching method of neural network structure, terminal, server and readable storage medium
CN107103003B (en) Method for acquiring data in link, acquisition equipment, processing equipment and system
CN106210031A (en) Service execution method, device, client and server
CN113919511A (en) Federal learning method and device

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200922

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200922

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220413

Address after: Room 602, No. 618 Wai Road, Huangpu District, Shanghai

Patentee after: Ant fortune (Shanghai) Financial Information Service Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Innovative advanced technology Co.,Ltd.