Method of testing and device, port generation method and port maker and test system
Technical field
The application is related to technical field of measurement and test, more particularly to method of testing and device, port generation method and port generation
Device and test system.
Background technology
With the continuous extension of the business involved by product in wireless device, a movement automation for serving business is surveyed
Trial work has, and is the important guarantee of preferably lifting research and development of products efficiency and raising product quality.Product Chang Ji in a wireless device
Realize, and increasingly complicated along with WebView interaction scenarios in WebView, used test when being tested every time
Use-case quantity is more, and the execution time of each test case is longer, and this proposes higher requirement to method of testing.
In order to improve the problem, a kind of existing method is:Increase test frame between test device and wireless device
Server, the session connection set up by test frame server between test case end and wireless device completes test device
Order transmitting-receiving, data transfer between wireless device etc. communicate, and realize that all test cases are described wireless in test device
Execution in equipment.
Specifically, test device sends session connection request to test frame server, test frame server is according to nothing
The current resource situation of line equipment determines session id (Identity, mark), and sets up test device and nothing based on the session id
Disposable single session connection between line equipment.All test cases in test device are based on single session connection and wireless
Equipment is communicated, and to perform all test cases in test device on the wireless device, completes test.
In the above method, all test cases share each test case in a session connection, multiple test cases
It is required for waiting when being attached request, when one of use-case is performed, link is longer, then exclusive whole test frame takes all the time
Business device resource so that the execution efficiency of the test case based on the above method is relatively low.
The content of the invention
In order to lift the execution efficiency of test case, the embodiment of the present application proposes a kind of method of testing, test device, end
Mouth maker and test system.
In a first aspect, the embodiment of the present application provides a kind of test system, including processor and memory, the memory
The programmed instruction by the computing device is stored, described program instruction includes:
The port numbers of one or more test cases are obtained, wherein, the port numbers of one or more of test cases are mutual
Differ;
Based on the port numbers of one or more of test cases, by being between test frame server and wireless device
One or more of test cases set up corresponding one or more session connections respectively;
Session connection based on one or more of test cases is communicated with the wireless device, with the nothing
One or more of test cases are performed in line equipment.
Second aspect, the embodiment of the present application provides a kind of method of testing, and methods described includes:
The port numbers of one or more test cases are obtained, wherein, the port numbers of one or more of test cases are mutual
Differ;
Based on the port numbers of one or more of test cases, by being between test frame server and wireless device
One or more of test cases set up corresponding one or more session connections respectively;
Session connection based on one or more of test cases is communicated with the wireless device, with the nothing
One or more of test cases are performed in line equipment.
Alternatively, the port numbers for obtaining one or more test cases, including:
For any test case in one or more test cases, it is determined that currently connecting quantity;
Judge whether the current connection quantity exceedes the connection upper limit of test frame server;
If currently connection quantity selects the port of an available port not less than the connection upper limit of test frame server
Number as any test case port numbers.
Alternatively, it is described judge it is described it is current connection quantity whether exceed test frame server the connection upper limit after,
Also include:
If currently connection quantity exceedes the connection upper limit of test frame server, every preset time period, repeat
It is determined that currently connecting quantity, the step of whether current connection quantity exceedes the connection upper limit of test frame server judged,
Until port numbers of the port numbers of one available port of selection as any test case.
Alternatively, the port numbers for obtaining one or more test cases, including:
For any test case in one or more test cases, send any test to port maker and use
The port numbers of example obtain request;
Receive the response message that the port maker is returned, the response message and the port of any test case
Number obtain request correspondence;
Determine whether include port numbers in the response message;
If the response message includes port numbers, the port numbers that the response message includes are defined as described appoint
The port numbers of one test case.
Alternatively, it is described determine whether to include in the response message port numbers after, in addition to:
If not including port numbers in the response message, every preset time period, repeat and sent out to port maker
Send the port numbers of any test case to obtain request, the response message that the port maker is returned is received, it is determined that described
The step of whether including port numbers in response message, until determining that the response message includes port numbers, the response is disappeared
The port numbers that breath includes are defined as the port numbers of any test case.
Alternatively, the session connection based on one or more of test cases is communicated with the wireless device
Afterwards, in addition to:
If there is the test case for performing and terminating, used by the test that end is performed described in test frame server closing
The session connection of example.
The third aspect, the embodiment of the present application provides a kind of test device, and described device includes:
Acquisition module, the port numbers for obtaining one or more test cases, wherein, one or more of tests are used
The port numbers of example are different;
Module is set up, for the port numbers of the one or more test cases obtained based on the acquisition module, by surveying
It is that one or more of test cases set up corresponding one or more meetings respectively to try between framework server and wireless device
Words connection;
Test module, for based on it is described set up module foundation one or more test cases session connection with it is described
Wireless device is communicated, to perform one or more of test cases on the wireless device.
Alternatively, the acquisition module, including:
First determining unit, for for any test case in one or more test cases, it is determined that current connection
Quantity;
Judging unit, for judging whether the current connection quantity that first determining unit is determined exceedes test frame clothes
The connection upper limit of business device;
Selecting unit, for judging connection of the current connection quantity not less than test frame server when the judging unit
During the upper limit, the port numbers of an available port are selected as the port numbers of any test case.
Alternatively, the acquisition module, in addition to:
First circulation unit, when exceeding the connection upper limit of test frame server for currently connecting quantity, every default
Period, the current connection quantity of determination is repeated, judge whether the current connection quantity exceedes test frame server
The step of connecting the upper limit, until port numbers of the port numbers of one available port of selection as any test case.
Alternatively, the acquisition module, including:
Transmitting element, for for any test case in one or more test cases, being sent to port maker
The port numbers of any test case obtain request;
Receiving unit, for receiving the response message that the port maker is returned, the response message is sent with described
The port numbers for any test case that unit is sent obtain request correspondence;
Second determining unit, for determining whether include port numbers in the response message that the receiving unit is received;
3rd determining unit, for when second determining unit determines that response message includes port numbers, by described in
The port numbers that response message includes are defined as the port numbers of any test case.
Alternatively, the acquisition module, in addition to:
Second circulation unit, for when not including port numbers in the response message, every preset time period, repetition to be held
The port numbers that row sends any test case to port maker, which are obtained, asks, and receives the sound that the port maker is returned
Message is answered, the step of determining whether to include port numbers in the response message, until determining that the response message includes port
Number, the port numbers that the response message includes are defined as to the port numbers of any test case.
Alternatively, described device, in addition to:
Closedown module, for when there is the test case for performing end, by being held described in test frame server closing
The session connection for the test case that row terminates.
Fourth aspect, the embodiment of the present application provides a kind of port generation method, and methods described includes:
Receive after the port numbers acquisition request that test device is sent, it is determined that currently connecting quantity;
Judge whether the current connection quantity exceedes the connection upper limit of test frame server;
If currently connection quantity selects the port of an available port not less than the connection upper limit of test frame server
Number, and return obtains the corresponding response message of request with the port numbers, the response message includes the port numbers of selection.
Alternatively, it is described judge it is described it is current connection quantity whether exceed test frame server the connection upper limit after,
Also include:
If currently connection quantity exceedes the connection upper limit of test frame server, return to obtain with the port numbers and ask
Do not include port numbers in corresponding response message, the response message.
5th aspect, the embodiment of the present application provides a kind of port maker, and the port maker includes:
Determining module, the port numbers for receiving test device transmission are obtained after request, it is determined that currently connecting quantity;
Judge module, for judging whether the current connection quantity that the determining module is determined exceedes test frame server
The connection upper limit;
Module is returned to, for judging connection of the current connection quantity not less than test frame server when the judge module
During the upper limit, the port numbers of an available port are selected, and return obtains the corresponding response message of request with the port numbers, it is described
Response message includes the port numbers of selection.
Alternatively, the return module, when being additionally operable to current connection quantity and exceeding the connection upper limit of test frame server,
Return to obtain with the port numbers and do not include port numbers in the corresponding response message of request, the response message.
Have the beneficial effect that:
Obtain the port numbers of one or more test cases;Based on the port numbers of one or more test cases, by surveying
It is that one or more test cases set up corresponding one or more session companies respectively between examination framework server and wireless device
Connect;Session connection based on one or more test cases is communicated with wireless device, to perform one on the wireless device
Or multiple test cases, by setting up independent session connection for each test case, one is performed based on corresponding session connection
Individual or multiple test cases, thus the session of test case and wireless device is mutually isolated, not only increase test frame clothes
The high availability for device resource of being engaged in, also avoids the long-time connection for sharing session from test frame server resource is exhausted and then is caused
Delay machine, improve the stability and reliability of test case execution, improve the execution efficiency of test case.
Brief description of the drawings
The specific embodiment of the application is described below with reference to accompanying drawings, wherein:
Fig. 1 shows a kind of schematic flow sheet for method of testing that the embodiment of the application one is provided;
Fig. 2 shows a kind of schematic flow sheet for port generation method that another embodiment of the application is provided;
Fig. 3 shows the schematic flow sheet for another method of testing that another embodiment of the application is provided;
A kind of terminal where test device that Fig. 4 shows that another embodiment of the application provides, test frame server,
Data flow interaction schematic diagram between wireless device;
Fig. 5 shows the schematic flow sheet for another method of testing that another embodiment of the application is provided;
Fig. 6 shows a kind of test device that another embodiment of the application provides, port maker, test frame server
Between port assignment situation;
Fig. 7 shows a kind of structural representation for test device that another embodiment of the application is provided;
Fig. 8 shows a kind of structural representation for acquisition module that another embodiment of the application is provided;
Fig. 9 shows the structural representation for another acquisition module that another embodiment of the application is provided;
Figure 10 shows the structural representation for another acquisition module that another embodiment of the application is provided;
Figure 11 shows the structural representation for another acquisition module that another embodiment of the application is provided;
Figure 12 shows the structural representation for another test device that another embodiment of the application is provided;
Figure 13 shows a kind of structural representation for port maker that another embodiment of the application is provided;
Figure 14 shows a kind of structural representation for test system that another embodiment of the application is provided.
Embodiment
In order that the technical scheme and advantage of the application are more clearly understood, below in conjunction with accompanying drawing to the exemplary of the application
Embodiment is described in more detail, it is clear that described embodiment is only a part of embodiment of the application, rather than
The exhaustion of all embodiments.And in the case where not conflicting, the feature in embodiment and embodiment in this explanation can be mutual
It is combined.
In the test for being currently based on disposable single session connection, all test cases share a session connection, multiple surveys
Each test case in example on probation is required for waiting when being attached request, and when one of use-case, to perform link longer, then
All the time whole test frame server resource is monopolized so that the execution efficiency of test case is relatively low.In order to lift test case
Execution efficiency, present applicant proposes a kind of method of testing, the method for testing can obtain the port of one or more test cases
Number;Based on the port numbers of one or more test cases, by being one or many between test frame server and wireless device
Individual test case sets up corresponding one or more session connections respectively;Session connection based on one or more test cases with
Wireless device is communicated, to perform one or more test cases on the wireless device, by being set up for each test case
Independent session connection, one or more test cases are performed based on corresponding session connection, so that by test case and wirelessly
The session of equipment is mutually isolated, not only increases the high availability of test frame server resource, also avoids sharing the length of session
Time connection exhausts test frame server resource and then causes the machine of delaying, and improves the stability of test case execution and reliable
Property, improve the execution efficiency of test case.
With reference to above-mentioned implementation environment, a kind of method of testing is present embodiments provided.The side provided referring to Fig. 1, the present embodiment
Method flow is specific as follows:
101:The port numbers of one or more test cases are obtained, wherein, the port numbers of one or more test cases are mutual
Differ;
Alternatively, the port numbers of one or more test cases are obtained, including:
For any test case in one or more test cases, it is determined that currently connecting quantity;
Judge whether current connection quantity exceedes the connection upper limit of test frame server;
If currently connection quantity selects the port of an available port not less than the connection upper limit of test frame server
Number as any test case port numbers.
Alternatively, after judging current connection quantity whether more than the connection upper limit of test frame server, in addition to:
If currently connection quantity exceedes the connection upper limit of test frame server, every preset time period, repeat
It is determined that currently connecting quantity, the step of whether current connection quantity exceedes the connection upper limit of test frame server judged, until
The port numbers of an available port are selected as the port numbers of any test case.
Alternatively, the port numbers of one or more test cases are obtained, including:
For any test case in one or more test cases, any test case is sent to port maker
Port numbers obtain request;
The response message that receiving port maker is returned, response message and the port numbers of any test case obtain request pair
Should;
Determine whether include port numbers in response message;
If response message includes port numbers, the port numbers that response message includes are defined as any test case
Port numbers.
Optionally it is determined that after whether including port numbers in response message, in addition to:
If not including port numbers in response message, every preset time period, repeat to send to port maker and appoint
The port numbers of one test case obtain request, and the response message that receiving port maker is returned determines whether wrapped in response message
The step of including port numbers, until determining that response message includes port numbers, the port numbers that response message includes is defined as to appoint
The port numbers of one test case.
102:Based on the port numbers of one or more test cases, by being between test frame server and wireless device
One or more test cases set up corresponding one or more session connections respectively;
103:Session connection based on one or more test cases is communicated with wireless device, with the wireless device
Perform one or more test cases.
Alternatively, after the session connection based on one or more test cases is communicated with wireless device, in addition to:
If there is the test case for performing and terminating, the test case terminated is performed by test frame server closing
Session connection.
Beneficial effect:
Obtain the port numbers of one or more test cases;Based on the port numbers of one or more test cases, by surveying
One or more test cases set up corresponding one or more session connections respectively between examination framework server and wireless device;
Session connection based on one or more test cases is communicated with wireless device, to perform one on the wireless device or many
Individual test case, by setting up session connection alone for each test case, based on corresponding session connection perform one or
Multiple test cases, thus the session of test case and wireless device is mutually isolated, not only increase test frame server
The high availability of resource, also avoids the long-time connection for sharing session from test frame server resource is exhausted and then is caused and delays
Machine, improves the stability and reliability of test case execution, improves the execution efficiency of test case.
With reference to above-mentioned implementation environment, a kind of port generation method is present embodiments provided.Referring to Fig. 2, the present embodiment is provided
Method flow it is specific as follows:
201:Receive after the port numbers acquisition request that test device is sent, it is determined that currently connecting quantity;
202:Judge whether the current connection quantity exceedes the connection upper limit of test frame server;
203:If currently connecting the connection upper limit of the quantity not less than test frame server, one available port of selection
Port numbers, and return obtains the corresponding response message of request with the port numbers, the response message includes the port of selection
Number.
Alternatively, it is described judge it is described it is current connection quantity whether exceed test frame server the connection upper limit after,
Also include:
If currently connection quantity exceedes the connection upper limit of test frame server, return to obtain with the port numbers and ask
Do not include port numbers in corresponding response message, the response message.
Beneficial effect:
Receive after the port numbers acquisition request that test device is sent, it is determined that currently connecting quantity;Judge current connection quantity
Whether the connection upper limit of test frame server is exceeded;If in currently connection connection of the quantity not less than test frame server
Limit, then select the port numbers of an available port, and return is obtained in the corresponding response message of request, response message with port numbers
Port numbers including selection so that different sections expand and obtain the corresponding a port number of request, are easy to test device according to different
Port numbers are that different test cases sets up single session connection, lift the execution efficiency of test case.
The method of testing that the application is provided is directed to each test case, i.e., each test case can be performed when being tested
The method that the present embodiment is provided.But when the method that a test case is provided using the application is tested, may there is it
He is tested at one or more test cases using this method simultaneously, therefore, it can exist while there is multiple test cases to adopt
The situation that the method for testing provided with the application is tested occurs, if for example, each test case passes through corresponding process
The method of testing for performing the application offer is tested, then performs the test side of the application offer respectively by multiple processes simultaneously
Method, and the implementation progress of process is related to the testing progress of correspondence test case, the implementation progress of each progress can also may be used with identical
With difference.
In addition, the method for testing that the application is provided can have 2 kinds of ways of realization, one kind is to be implemented separately by test device,
One kind is is realized by test device and port maker jointly, below with 2 embodiments, every kind of implementation is carried out respectively detailed
Describe in detail bright.
The mode that method of testing is implemented separately by test device is described in detail the present embodiment.For convenience of description,
The present embodiment is only described by taking a test case A as an example, and the realization for other test cases can be found in test case A's
Implementation.When the method for testing that test case A is provided by the present embodiment is tested, other test cases of part can be with
Simultaneously using the present embodiment provide method tested, i.e. test case A with part other test cases simultaneously perform respectively
Step.When the method for testing that test case A is provided by the present embodiment is tested, other test cases of part can also be prior to
Or tested after its method for using the present embodiment to provide, i.e. test case A starts to perform the test that the present embodiment is provided
During method, other use-cases of part have completed the part steps of the method for testing of the present embodiment offer, or, test case A is completed
During the part steps for the method for testing that the present embodiment is provided, other use-cases of part start to perform the method for testing that embodiment is provided.
Referring to Fig. 3, the method for testing flow that the present embodiment is provided is specific as follows:
301:When test case A starts, test case A port numbers are obtained;
Wherein, the port numbers of each test case are different;
Obtain the specific implementation of test case A port numbers, including but not limited to following 4 steps:
Step 1:It is determined that currently connecting quantity;
In the one or more test cases tested, each test case is surveyed with the test trails of oneself
Examination, i.e. tested by testing attributes such as oneself test time started, testing procedures, therefore, terminal where test device
Connection quantity is continually changing with the difference of time.Whenever thering is test case to need to obtain port numbers, it can determine whether now
Connect quantity.
Step 2:Judge whether current connection quantity exceedes the connection upper limit of test frame server, if currently connecting quantity
Not less than the connection upper limit of test frame server, then step 3 is performed, if currently connection quantity exceedes test frame server
The upper limit is connected, then performs step 4;
Because session connection is set up by test frame server, therefore, the connection upper limit of test frame server
Have a direct impact to session connection.If currently connection quantity illustrates may be used also not less than the connection upper limit of test frame server
To set up session connection with test frame server, if currently connection quantity exceedes the connection upper limit of test frame server,
Illustrate that session connection cannot be set up with test frame server.
Step 2 can according to the connection quantity of terminal where test device currently and the connection upper limit of test frame server it
Between relation determine the specific acquisition methods of test case A port numbers.
Step 3:The port numbers of an available port are selected as test case A port numbers;
The premise for performing this step is the connection upper limit of the current connection quantity not less than test frame server, now, is surveyed
Terminal where trial assembly is put can also set up session connection with test frame server.
The specific implementation of step 3 can be:First random generation a port number, then see the corresponding port of the port numbers
Whether taken by other processes,
(1) if other processes of terminal take where the non-device being tested in the corresponding port of the port numbers, the end is illustrated
The corresponding port of slogan can use, using the port numbers as test case A port numbers.
(2) if other processes of terminal take where the corresponding port device being tested of the port numbers, the port is illustrated
Number corresponding port is unavailable, regenerates a port number, sees whether the corresponding port of the port numbers regenerated is tested
Other processes of terminal take where device,
● if other processes of terminal take where the non-device being tested in the corresponding port of port numbers regenerated, will
The port numbers regenerated as test case A port numbers.
● if other processes of terminal take where the corresponding port device being tested of port numbers regenerated, repeat
Execution regenerates a port number, see the corresponding port of the port numbers regenerated whether terminal where device being tested its
The step of his process takes, until the port numbers for finding an available port are used as test case A port numbers.
Step 4:Test case A port numbers times of acquisition are added 1, and after preset time period, test is obtained again and is used
Example A port numbers.
For example, determining current connection quantity again, judge whether the current connection quantity determined again exceedes test frame
The connection upper limit of server;
(1) if the connection upper limit of the current connection quantity not less than test frame server determined again, one is selected
The port numbers of available port as test case A port numbers;
(2) if the current connection quantity determined again exceed test frame server the connection upper limit, repeat by
Test case A port numbers times of acquisition add 1, and after preset time period, current connection quantity are determined again, is judged true again
The step of whether fixed current connection quantity exceedes the connection upper limit of test frame server, until one available port of selection
Port numbers as test case A port numbers.
Perform after above-mentioned 4 steps, test case A port numbers can be obtained.However, obtaining test case A end
When the step of slogan performs, other test cases may also perform the port that step 301 obtains other processes in correspondence process
Number.Therefore, it may appear that multiple test cases obtain the situation of corresponding end slogan simultaneously.
Such as example 1, test case A performs the port for the method acquisition test case A that the present embodiment is provided by process A
Number, while test case B performs the port numbers for the method acquisition test case B that the present embodiment is provided by process B.
For another example example 2, test case C, which first passes through process C and performs the method for the present embodiment offer, obtains test case C end
Slogan, but it judges that current connection quantity exceedes the connection upper limit and then the execution of test frame server when going to step 2
Step 4, when performing step 4, test case C port numbers times of acquisition add 1, and after preset time period, obtain survey again
Example C on probation port numbers.While test case C port numbers are obtained again, test case A performs this reality by process A
The method for applying example offer obtains test case A port numbers.
When multiple test cases obtain port numbers simultaneously, the embodiment of each test case port numbers is obtained,
Including but not limited to:By the port numbers times of acquisition of multiple test cases, the end of multiple test cases is obtained successively from high to low
Slogan.
Wherein, the acquisition modes of the port numbers of each test case can be realized by above-mentioned steps 1 to step 4.
By taking above-mentioned example 2 as an example, if the initial value of the port numbers times of acquisition of each test case is 0, because test is used
Example C port numbers times of acquisition once added 1, then were changed into 1, and test case A implements the method progress that the present embodiment is provided for the first time
Test, therefore, test case A port numbers times of acquisition are 0.Now, the step of first carrying out acquisition test case C-terminal slogan,
Test case C-terminal slogan is being got, or, test case C port numbers times of acquisition add 1 again, and enter preset time
After the waiting period of section, then the step of perform the port numbers for obtaining test case A.
302:Based on test case A port numbers, by being test case A between test frame server and wireless device
Set up corresponding session connection;
This step can be realized by Handshake Protocol.For example:Terminal is based on the survey obtained in step 301 where test device
Example A port numbers on probation send session connection request to test frame server, and whether test frame server determines wireless device
It can use, whether the resource of wireless device, service are sufficient, and after by the necessary verification of wireless device, determine session id, and
Session connection A is set up where test device based on the session id between terminal and wireless device.The session connection A set up herein
Only test case A session connection, for other test cases, it is impossible to communicated by session connection A with wireless device.
All test cases are communicated by public session connection in the prior art, the method that the present embodiment is provided
In each test case communicated by independent session connection.The foundation side for this kind of session connection that the present embodiment is provided
Formula has more preferable flexibility compared to the mode of prior art, can improve the availability of test frame server resource, carry
Rise stability and reliability that test case is performed.
303:Session connection based on test case A is communicated with wireless device, to perform test on the wireless device
Use-case A;
For example, test terminal presses test case A test description, session connection and wireless device based on test case A
Communicated, on the wireless device implementation of test cases A, to test the corresponding function of wireless device.
304:If there is the test case for performing and terminating, the test terminated is performed by test frame server closing and is used
The session connection of example.
Synchronizing step 301 to 304, can determine different port numbers, based on different ports for different test cases
Number different session connections are set up by test frame server and wireless device, pass through different session connections and perform different survey
Example on probation, completes each self-test.And after the execution of any test case terminates, it is simply turned off performing the session of the test case terminated
Connection, and the session connection for the test case that other are carrying out is not closed, and realizes that the session connection of different test cases is mutual
Isolation, it is to avoid all test cases share the test frame server resource that session connection causes all the time to be discharged,
And then the generation of the phenomenon such as the test frame server resource brought exhausts, machine of delaying.
Data flow interaction feelings where Fig. 4 shows test device between terminal, test frame server, wireless device
Condition, wherein, evil mind block arrow represents the data flow that session connection is related to, and arrow of being careless or thoughtless by nature in vain represents that test case performs the number being related to
According to stream.
Beneficial effect:
Obtain the port numbers of one or more test cases;Based on the port numbers of one or more test cases, by surveying
It is that one or more test cases set up corresponding one or more session companies respectively between examination framework server and wireless device
Connect;Session connection based on one or more test cases is communicated with wireless device, to perform one on the wireless device
Or multiple test cases, by setting up independent session connection for each test case, one is performed based on corresponding session connection
Individual or multiple test cases, thus the session of test case and wireless device is mutually isolated, not only increase test frame clothes
The high availability for device resource of being engaged in, also avoids the long-time connection for sharing session from test frame server resource is exhausted and then is caused
Delay machine, improve the stability and reliability of test case execution, improve the execution efficiency of test case.
The present embodiment to realizing that the mode of method of testing is described in detail jointly by test device and port maker, its
In, port maker can be located in same terminal with test device, can also be located in different terminals.
For convenience of description, the present embodiment is still described by taking a test case A as an example, for other test cases
Implementation can be found in test case A implementation.Certainly, the method for testing that test case A is provided by the present embodiment is entered
During row test, the method that other test cases of part can be provided concurrently using the present embodiment is tested, can also be first
In or after its use the present embodiment provide method tested.
Referring to Fig. 5, the method flow that the present embodiment is provided is specific as follows:
501:Test device is when test case A starts, and the port numbers for sending test case A to port maker are obtained please
Ask;
Wherein, test case A port numbers are obtained in request and included but is not limited to:Test device mark, test case A
Mark etc..
In addition, test case A port numbers, which obtain request, includes test case A port numbers times of acquisition, if bag
Test case A port numbers times of acquisition are included, the number of times of port numbers can be asked to take the circumstances into consideration to determine according to test case A.If for example,
The port numbers for sending test case A to port maker for the first time, which are obtained, asks, then the port numbers obtain request and can include surveying
Example A on probation port numbers times of acquisition, can not also include.If non-first time sends test case A end to port maker
Slogan obtains request, then the port numbers, which obtain request, must include test case A port numbers times of acquisition.
In order to which the whole of method of testing for describing the present embodiment offer are performed in steps, the present embodiment, with step 501 the
The port numbers for once sending test case A to port maker, which are obtained, asks, and does not include test in port numbers acquisition request
The port numbers that non-first time sends test case A to port maker in use-case A port numbers times of acquisition, step 509 are obtained
Ask, and the port numbers obtain request and include being specifically described exemplified by test case A port numbers times of acquisition.
502:Port maker is received after the port numbers acquisition request that test device is sent, it is determined that currently connecting quantity;
Because each test case is tested with the test trails of oneself, therefore, terminal where test device
Connection quantity is continually changing with the difference of time.Whenever the port numbers for receiving test device transmission are obtained after request, can
It is determined that the now connection quantity of terminal where test device.
Specifically, if test device is located in same terminal with port maker, port maker directly obtains the end
The current connection quantity at end.If test device and port maker are located in different terminals, terminal where the maker of port with
Terminal where test device is communicated, the current connection quantity of terminal where obtaining test device.
503:Port maker judges whether current connection quantity exceedes the connection upper limit of test frame server, if currently
The connection upper limit of the quantity not less than test frame server is connected, then performs step 504, if currently connection quantity exceedes test block
The connection upper limit of frame server, then perform step 505;
Because session connection is set up by test frame server, therefore, the connection upper limit of test frame server
Have a direct impact to session connection.If currently connection quantity illustrates may be used also not less than the connection upper limit of test frame server
To set up session connection with test frame server, if currently connection quantity exceedes the connection upper limit of test frame server,
Illustrate that session connection cannot be set up with test frame server.
Step 503 middle port maker can be according to the connection quantity of terminal where test device currently and test frame service
Relation between the connection upper limit of device determines that the port numbers that step 502 is received obtain the specific of the response message corresponding to request
Method.
504:Port maker selects the port numbers of an available port, and returns and the port numbers acquisition corresponding sound of request
Message is answered, and the response message includes the port numbers of selection;
The premise for performing this step is the connection upper limit of the current connection quantity not less than test frame server, now, is surveyed
Terminal where trial assembly is put can also set up session connection with test frame server.
The specific implementation of step 504 can be:First random generation a port number, then see the corresponding end of the port numbers
Whether other processes of terminal where device being tested take mouth,
(1) if other processes of terminal take where the non-device being tested in the corresponding port of the port numbers, the end is illustrated
The corresponding port of slogan can use, by the port numbers of the port numbers alternatively.
(2) if other processes of terminal take where the corresponding port device being tested of the port numbers, the port is illustrated
Number corresponding port is unavailable, regenerates a port number, sees whether the corresponding port of the port numbers regenerated is tested
Other processes of terminal take where device,
● if other processes of terminal take where the non-device being tested in the corresponding port of port numbers regenerated, will
The port numbers of the port numbers regenerated alternatively.
● if other processes of terminal take where the corresponding port device being tested of port numbers regenerated, repeat
Execution regenerates a port number, see the corresponding port of the port numbers regenerated whether terminal where device being tested its
The step of his process takes, until finding the port numbers of the port numbers of an available port alternatively.
505:Port maker returns to obtain with port numbers not to be included in request corresponding response message, and the response message
Port numbers;
In actual applications, in order to which more specific identification port maker does not get available port numbers, spy can be used
Different content representation does not get available port numbers, and available port numbers are not got for example, being shown with dead end oral thermometer.Such a situation
Under, though not including port numbers in the response message of return, dead end mouthful can be included:
Following for convenient description, when the present embodiment does not get available port numbers with port maker, return
Do not include port numbers in response message, but comprising being illustrated in case of dead end mouthful.
Perform after step 503 to step 505, port maker can return to the port numbers received with step 502
The corresponding response message of request is obtained, but port numbers are potentially included in the response message, or, including dead end mouthful.
In addition, a port number that step 502 receives test device transmission to step 505 only for port maker is obtained
Request situation is taken, request situation is obtained for multiple port numbers that port maker synchronization receives test device transmission,
It may refer to step 510.
506:Test the first response message that expected end receiver mouthful maker is returned;
The response message received in step 506 is in response to message and the test case A sent in step 501 port numbers
Request correspondence is obtained, and the response message includes port numbers, or, port numbers are not included in the response message, but including sky
Port.
In order to which response message corresponding with the acquisition request of the test case A subsequently sent again port numbers is distinguished, by this
The response message at place is referred to as the first response message.
507:Test terminal determines whether include port numbers in the first response message, if the first response message includes port
Number, then step 508 is performed, if not including port numbers in the first response message, but including dead end mouthful, then step 509 is performed;
508:The port numbers that first response message includes are defined as test case A port numbers by test terminal;
Perform after this step, directly perform step 512 to step 514.
509:Test case A port numbers times of acquisition are added 1 by test terminal, and after preset time period, again to end
The port numbers that mouth maker sends test case A obtain request;
For example, the first response message that the port maker that test terminal is received in step 506 is returned includes dead end
Mouthful, then when performing step 509, test case A port numbers times of acquisition add 1, if the initial value of port numbers times of acquisition is
0, then now port numbers times of acquisition are changed into 1, and after preset time period, send test case A's to port maker again
Port numbers obtain request.
510:Port maker, which receives test device and sends test case A port numbers again, to be obtained after request, return with
Corresponding response message;
If perform step 510, port maker, which only receives test device and sends test case A port numbers again, to be obtained
Request is taken, i.e., only receives a port number and obtains request, then can repeat step 503 to step 505.
If perform step 510, port maker not only receives the port numbers that test device sends test case A again
Request is obtained, the port numbers for also receiving other test cases of test device transmission obtain request, that is, receive multiple ports
Number obtain request.For such a situation, the test case A sent again port numbers, which are obtained, can include port numbers acquisition in request
Number of times.For example:Test case A port numbers times of acquisition 1.And the port numbers of other test cases are obtained and potentially included in request
Corresponding port numbers times of acquisition, it is also possible to do not include.If not including port numbers times of acquisition, it is considered that port numbers are obtained
Number of times is initial value, such as 0.
When obtaining request for receiving multiple port numbers simultaneously, port maker can be obtained first by each port numbers
The port numbers times of acquisition included are asked, selection a port number obtains request successively from high to low;For the port numbers of selection
Obtain request and perform step 503 to step 505, the port numbers for returning to selection obtain the corresponding response message of request.
If for example, port maker, which receives 2 port numbers, obtains request, the test case respectively sent again simultaneously
A port numbers obtain request, and the test case D sent first port numbers obtain request.Wherein, test case A port numbers
Request is obtained due to being second of transmission, then test case A port numbers, which obtain request, includes port numbers times of acquisition, and is
1.Test case D port numbers obtain request due to being to send first, if test case D port numbers obtain request and can included
Port numbers times of acquisition, and be 0, then the port numbers for first carrying out 503 to step 505 response test use-case A obtain request, are returning
After corresponding message including port numbers or dead end mouthful, then perform 503 to step 505 response test use-case D port numbers acquisition
Request.
For another example if port maker, which receives 2 port numbers, obtains request simultaneously, the test respectively sent again is used
Example A port numbers obtain request, and the test case E sent first port numbers obtain request, and port numbers times of acquisition just
Initial value is 0.Wherein, test case A port numbers obtain the port numbers asked due to being second of transmission, then test case A
Obtaining request includes port numbers times of acquisition, and is 1.Test case E port numbers obtain request due to being to send first, if
Test case E port numbers, which obtain request, does not include port numbers times of acquisition, then test case E port numbers is obtained into request
Port numbers times of acquisition are defined as 0.Now, the port numbers for first carrying out 503 to step 505 response test use-case A obtain request,
Return after the corresponding message for including port numbers or dead end mouthful, then perform 503 to step 505 response test use-case E port numbers
Obtain request.
511:The second response message that test device receiving port maker is returned, determines to test according to the second response message
Use-case A port numbers;
Wherein, test case A of second response message with sending again port numbers acquisition request is corresponding.
It is identical with the first response message, port numbers can be included in the second response message, dead end mouthful can also be included.
If the second response message includes port numbers, test device, which performs step 508, includes the second response message
Port numbers be defined as test case A port numbers.
If the second response message includes dead end mouthful, test device repeats step 509 to step 511, will be any
The port numbers times of acquisition of test case add 1, and after preset time period, send any test case to port maker again
Port numbers obtain request, receiving port maker return the second response message, the second response message and send again appoint
The port numbers of one test case obtain request correspondence, the step of determining whether to include port numbers in the second response message, until really
Fixed second response message includes port numbers.
512:Port numbers of the test device based on test case A, by being between test frame server and wireless device
Test case A sets up corresponding session connection;
The implementation of this step is identical with step 302, refers to step 302, and here is omitted.
513:Session connection of the test device based on test case A is communicated with wireless device, with the wireless device
Implementation of test cases A;
The implementation of this step is identical with step 303, refers to step 303, and here is omitted.
514:If there is the test case for performing and terminating, the test terminated is performed by test frame server closing and is used
The session connection of example.
The implementation of this step is identical with step 304, refers to step 304, and here is omitted.
Fig. 6 shows the port assignment situation between test device, port maker, test frame server.
Beneficial effect:
The port numbers of one or more test cases are obtained from port maker;End based on one or more test cases
Slogan, by be between test frame server and wireless device one or more test cases set up respectively corresponding one or
Multiple session connections;Session connection based on one or more test cases is communicated with wireless device, with wireless device
It is upper to perform one or more test cases, by setting up independent session connection for each test case, based on corresponding session
Connection performs one or more test cases, thus the session of test case and wireless device is mutually isolated, not only increase
The high availability of test frame server resource, also avoids the long-time connection for sharing session from server resource is exhausted and then is drawn
Machine of delaying is acted, the stability and reliability of test case execution is improved, improves the execution efficiency of test case.
Based on same inventive concept, a kind of test device is present embodiments provided, because the device solves the principle of problem
It is similar to a kind of method of testing shown in Fig. 1, therefore the implementation of the device may refer to the embodiment of the method shown in Fig. 1, weight
Multiple part is repeated no more.
Referring to Fig. 7, the device includes:
Acquisition module 701, the port numbers for obtaining one or more test cases, wherein, one or more tests are used
The port numbers of example are different;
Module 702 is set up, for the port numbers of the one or more test cases obtained based on acquisition module 701, is passed through
It is that one or more test cases set up corresponding one or more sessions respectively between test frame server and wireless device
Connection;
Test module 703, for the session connection based on the one or more test cases for setting up the foundation of module 702 and nothing
Line equipment is communicated, to perform one or more test cases on the wireless device.
Referring to Fig. 8, acquisition module 701, including:
First determining unit 7011, for for any test case in one or more test cases, it is determined that currently
Connect quantity;
Judging unit 7012, for judging whether the current connection quantity that the first determining unit 7011 is determined exceedes test block
The connection upper limit of frame server;
Selecting unit 7013, for judging currently to connect quantity not less than test frame server when judging unit 7012
When connecting the upper limit, the port numbers of an available port are selected as the port numbers of any test case.
Referring to Fig. 9, acquisition module 701, in addition to:
First circulation unit 7014, when exceeding the connection upper limit of test frame server for currently connecting quantity, every
Preset time period, repeats the current connection quantity of determination, judges whether current connection quantity exceedes test frame server
The step of connecting the upper limit, until port numbers of the port numbers of one available port of selection as any test case.
Referring to Figure 10, acquisition module 701, including:
Transmitting element 7015, for for any test case in one or more test cases, to port maker
The port numbers for sending any test case obtain request;
Receiving unit 7016, the response message returned for receiving port maker, response message is sent with transmitting element
Any test case port numbers obtain request correspondence;
Second determining unit 7017, for determining whether include port numbers in the response message that receiving unit 7016 is received;
3rd determining unit 7018, for when the second determining unit 7017 determines that response message includes port numbers, inciting somebody to action
The port numbers that first response message includes are defined as the port numbers of any test case.
Referring to Figure 11, acquisition module 701, in addition to:
Second circulation unit 7019, for when not including port numbers in response message, every preset time period, repetition to be held
The port numbers that row sends any test case to port maker, which are obtained, asks, the response message that receiving port maker is returned,
The step of determining whether to include port numbers in response message, until determining that response message includes port numbers, by response message
Including port numbers be defined as the port numbers of any test case.
Referring to Figure 12, the device, in addition to:
Closedown module 704, for when there is the test case for performing end, being performed by test frame server closing
The session connection of the test case of end.
Have the beneficial effect that:
Obtain the port numbers of one or more test cases;Based on the port numbers of one or more test cases, by surveying
It is that one or more test cases set up corresponding one or more session companies respectively between examination framework server and wireless device
Connect;Session connection based on one or more test cases is communicated with wireless device, to perform one on the wireless device
Or multiple test cases, by setting up independent session connection for each test case, one is performed based on corresponding session connection
Individual or multiple test cases, thus the session of test case and wireless device is mutually isolated, not only increase test frame clothes
The high availability for device resource of being engaged in, also avoids the long-time connection for sharing session from exhausting server resource and then cause the machine of delaying, carries
Stability and reliability that high test case is performed, improve the execution efficiency of test case.
Based on same inventive concept, a kind of port maker is present embodiments provided, because the port maker solves to ask
The principle of topic is similar to a kind of method of testing shown in Fig. 2, therefore the implementation of the port maker may refer to side shown in Fig. 2
The embodiment of method, repeats part and repeats no more.
Referring to Figure 13, the port maker includes:
Determining module 1301, the port numbers for receiving test device transmission are obtained after request, it is determined that currently connecting quantity;
Judge module 1302, for judging whether the current connection quantity that determining module 1301 is determined exceedes test frame clothes
The connection upper limit of business device;
Module 1303 is returned to, for judging currently to connect quantity not less than test frame server when judge module 1302
When connecting the upper limit, the port numbers of an available port are selected, and return and the port numbers acquisition corresponding response message of request, response
Message includes the port numbers of selection.
Alternatively, module 1303 is returned, when being additionally operable to current connection quantity and exceeding the connection upper limit of test frame server,
Return to obtain with port numbers and do not include port numbers in the corresponding response message of request, response message.
Have the beneficial effect that:
When each test case starts, the port numbers of each test case are obtained from port maker;Based on each test case
Port numbers, respectively by setting up the session connection of each test case between test frame server and wireless device;Surveyed based on each
The session connection of example on probation is communicated with wireless device, and to perform each test case on the wireless device, each test case is built
Respective session connection is stood, and each test case is performed based on respective session connection, so that by each test case with wirelessly setting
Standby session is mutually isolated, not only increases the high availability of server resource, also avoids the ultra-long time of a session from keeping
Connection causes server resource to exhaust caused machine of delaying, and improves the stability and reliability of test case execution, improves survey
The execution efficiency of example on probation.
Based on same inventive concept, referring to Figure 14, a kind of test system is present embodiments provided, the system is used to perform
The method of testing that embodiment is provided is stated, the system includes:
Processor 1401 and memory 1402, memory 1402 store the programmed instruction performed by processor 1401.
Wherein, programmed instruction includes:
The port numbers of one or more test cases are obtained, wherein, the mutual not phase of port numbers of one or more test cases
Together;
Based on the port numbers of one or more test cases, by being one between test frame server and wireless device
Or multiple test cases set up corresponding one or more session connections respectively;
Session connection based on one or more test cases is communicated with wireless device, to perform on the wireless device
One or more test cases.
Alternatively, the port numbers of one or more test cases are obtained, including:
For any test case in one or more test cases, it is determined that currently connecting quantity;
Judge whether current connection quantity exceedes the connection upper limit of test frame server;
If currently connection quantity selects the port of an available port not less than the connection upper limit of test frame server
Number as any test case port numbers.
Alternatively, after judging current connection quantity whether more than the connection upper limit of test frame server, in addition to:
If currently connection quantity exceedes the connection upper limit of test frame server, every preset time period, repeat
It is determined that currently connecting quantity, the step of whether current connection quantity exceedes the connection upper limit of test frame server judged, until
The port numbers of an available port are selected as the port numbers of any test case.
Alternatively, the port numbers of one or more test cases are obtained, including:
For any test case in one or more test cases, any test case is sent to port maker
Port numbers obtain request;
The response message that receiving port maker is returned, response message and the port numbers of any test case obtain request pair
Should;
Determine whether include port numbers in response message;
If response message includes port numbers, the port numbers that response message includes are defined as any test case
Port numbers.
Optionally it is determined that after whether including port numbers in response message, in addition to:
If not including port numbers in response message, every preset time period, repeat to send to port maker and appoint
The port numbers of one test case obtain request, and the response message that receiving port maker is returned determines whether wrapped in response message
The step of including port numbers, until determining that response message includes port numbers, the port numbers that response message includes is defined as to appoint
The port numbers of one test case.
Alternatively, after the session connection based on one or more test cases is communicated with wireless device, in addition to:
If there is the test case for performing and terminating, the test case terminated is performed by test frame server closing
Session connection.
Have the beneficial effect that:
Computing device is stored in the following programmed instruction of processor, obtains the port numbers of one or more test cases;
Based on the port numbers of one or more test cases, by being one or more surveys between test frame server and wireless device
Example on probation sets up corresponding one or more session connections respectively;Session connection based on one or more test cases with it is wireless
Equipment is communicated, to perform one or more test cases on the wireless device, by setting up independent for each test case
Session connection, one or more test cases are performed based on corresponding session connection, so that by test case and wireless device
Session it is mutually isolated, not only increase the high availability of test frame server resource, also avoid share session long-time
Connection exhausts test frame server resource and then causes the machine of delaying, and improves the stability and reliability of test case execution,
Improve the execution efficiency of test case.
For convenience of description, each several part of apparatus above is divided into various modules with function or unit is described respectively.Certainly,
Each module or the function of unit can be realized in same or multiple softwares or hardware when implementing the present invention.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can be using the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the present invention can be used in one or more computers for wherein including computer usable program code
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram are described.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which is produced, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.Although preferred embodiments of the present invention have been described, but in the art
Technical staff once know basic creative concept, then other change and modification can be made to these embodiments.So,
Appended claims are intended to be construed to include preferred embodiment and fall into having altered and changing for the scope of the invention.