The content of the invention
In view of this, a kind of method that this specification one or more embodiment provides request analog response to client
And device, equipment.
To achieve the above object, the technical scheme that this specification one or more embodiment provides is as follows:
In one aspect, there is provided a kind of request analog response to client method, including:
After analog end and client establish connection, the analog end receives the destination request letter from the client
Breath, the analog end have corresponding solicited message and response message and provide user circle for editing the response message
Face;
The analog end obtains and the destination request information according to the corresponding solicited message and response message of storage
Corresponding response message;
The analog end sends the response message obtained to the client.
In another aspect, there is provided a kind of request analog response to client method, including:
If client is established with analog end and is connected, the client sends destination request information to the analog end,
The analog end has corresponding solicited message and response message and provides the user interface for editing the response message;
If the client does not set up with the analog end and is connected, the user end to server sends the target please
Seek information;
The client receives response message corresponding with the destination request information;
If the response message received derives from the server, the client sends institute to the analog end
State destination request information and response message corresponding with the destination request information.
In another aspect, there is provided a kind of request analog response to client device, applied to simulation end equipment,
Described device includes:
Receiving unit, after analog end and client establish connection, the destination request information from the client is received,
The analog end has corresponding solicited message and response message and provides the user interface for editing the response message;
Response message obtaining unit, according to the corresponding solicited message and response message of storage, obtain and the target
Response message corresponding to solicited message;
Response message transmitting element, the response message obtained is sent to the client.
In another aspect, there is provided a kind of request analog response to client device, applied to client device,
Described device includes:
First transmitting element, when client establishes with analog end to be connected, destination request letter is sent to the analog end
Breath, the analog end have corresponding solicited message and response message and provide user circle for editing the response message
Face;
Second transmitting element, when the client is not set up with the analog end to be connected, the mesh is sent to server
Mark solicited message;
Response message receiving unit, receive response message corresponding with the destination request information;
3rd transmitting element, if the response message received derives from the server, sent out to the analog end
Send the destination request information and response message corresponding with the destination request information.
In yet another aspect, there is provided a kind of simulation end equipment, including:
Processor;
For storing the memory of processor-executable instruction;
The processor is configured as:
After analog end and client establish connection, the analog end receives the destination request letter from the client
Breath, the analog end have corresponding solicited message and response message and provide user circle for editing the response message
Face;
The analog end obtains and the destination request information according to the corresponding solicited message and response message of storage
Corresponding response message;
The analog end sends the response message obtained to the client.
In yet another aspect, there is provided a kind of client device, including:
Processor;
For storing the memory of processor-executable instruction;
The processor is configured as:
If client is established with analog end and is connected, the client sends destination request information to the analog end,
The analog end has corresponding solicited message and response message and provides the user interface for editing the response message;
If the client does not set up with the analog end and is connected, the user end to server sends the target please
Seek information;
The client receives response message corresponding with the destination request information;
If the response message received derives from the server, the client sends institute to the analog end
State destination request information and response message corresponding with the destination request information.
It is visible by above technical scheme, based on being used for for having corresponding solicited message and response message and providing
The analog end (being used for the application program simulated) of the page of the response message is edited, realizes the analog end and required test
Connection between client (App), and response message corresponding with each solicited message is simulated using the analog end, it is then back to
To the client, so that software test is more prone to.Also, user can also be according to demand in the analog end to each
Class response message enters edlin, and testing efficiency is higher.
Embodiment
In the related art, the test of the client (Client) of types of applications software usually requires to be based on client kimonos
Data between business end (Server) communicate to realize, typical testing requirement is:Client sends out a request to service end,
Service end returns to a response corresponding with the request to client again after receiving request.Due to the restriction of various factors,
Cause the testing efficiency of current App test jobs not high or even be difficult to carry out.In order to improve App testing efficiency, it is proposed that
A kind of scheme for being used for the request analog response to client.
Fig. 1 shows a kind of exemplary scene graph, in this scenario, including:Client (App) client is installed
Equipment, the simulation end equipment for being provided with analog end application program (being used for the response message for simulating request), and can be with client
The server (serve end program corresponding with App is provided with the server) to be communicated.Wherein, client device/simulation
End equipment may include but be not limited to all kinds of PCs (PC), mobile phone etc..Above-mentioned analog end application program can possess to be compiled for user
The content of response message is collected, monitors and asks and simulate the work(such as corresponding response message and displaying request and response data
Energy.Corresponding module can be integrated with the client, such as dynamic base (Dynamic Link Library, DLL), the module
It can be used to establish between client and analog end and connect and communicate.Certainly, the data communication party between client and analog end
Formula includes but is not limited to:Socket, USB, ICP/IP protocol, Bluetooth protocol etc..
Fig. 2 shows a kind of flow of the method for request analog response to client that an exemplary embodiment provides
Figure.As shown in Fig. 2 in one embodiment, this method is realized by client, analog end and server collaboration, this method includes
Following steps:
In a step 101, client end response generates destination request information in the operation of user.
Wherein, the user can be App development/testing personnel, it is described operation for user made in client and
For triggering some specific solicited message.Generally, different operation can set out different requests.
Due to generally being communicated between current App and service end by the way of RPC calling, the destination request information
Can be the solicited message for remote procedure call, response message corresponding with the destination request information can be long-range mistake
Journey calls the data that RPC is obtained.Certainly, solicited message can also be other types, such as:Inquire about request of database etc..
In a step 102, client judges whether itself and analog end have established connection (realizing that data communicate).As
Connection is established, then into step 103, otherwise into step 109.
Wherein, the analog end can be used for storing corresponding solicited message and response message and provide described for editing
The page of response message, the page can be also used for showing that solicited message and response message (such as are opened up by the form of list
Show).
As shown in figure 3, for a kind of schematic diagram of the analog end user interface shown in simulation end equipment, the analog end is used
Family interface 10 can comprise at least:For show solicited message list first area 11 and for show it is corresponding with solicited message
The second area 12 of response message content.Wherein, at least one solicited message that can be simulated is may include in solicited message list,
Also, whether user can need the open function (such as choosing) being modeled with the request in sets itself list, and each request can be right
Ying Yuyi type (such as RPC)., then can be in list when user needs to enter edlin to response message corresponding to some request
In select needed for editor request, hereafter, user can with second area 12 input corresponding to response message content, compile
It can be clicked on " preservation " after the completion of volume.Certainly, according to the actual requirements, can also be set in the analog end user interface 10 including other
Function is put, is included but is not limited to:It is set as delay duration of request analog response information etc..
In step 103, client sends destination request information to analog end.
In step 105, analog end receives the destination request information of client.
In step 106, analog end is according to the corresponding solicited message and response message prestored, it is determined whether
In the presence of the corresponding response message of the destination request information with receiving.If in the presence of (showing that analog end has been provided with simulating
The ability of response message corresponding with the destination request information), then into step 107, otherwise (show that analog end does not possess mould also
Draw up the ability of response message corresponding with the destination request information) enter step 108.
As described above, solicited message and with response message can by App developer in analog end from edlin, editing
It can be stored in after completion in analog end, in order to which the follow-up request to client carries out analog response information.In reality
In development process, new function may be continuously emerged in App, and (New function can generally be called by going out a new RPC
Process is realized), and if developer does not write respond with new RPC call requests corresponding in analog end in time
Information, then it possibly can not realize the simulation process of this response.
In step 107, analog end sends the response message corresponding with the destination request information obtained to client,
To allow client according to the response message received, execution handles logic accordingly, and (developer can be according to processing knot
Fruit judges to test whether to pass through).
In step 108, analog end to client transmission indicating that response message does not simulate successful information.In the step
Enter step 109 after rapid 108.
In step 109, user end to server sends the destination request information.
In step 110, server receives the destination request information from the client.
In step 111, server returns to response message corresponding with the destination request information to the client.
In step 112, client sends institute after the response message from server is received to the analog end
State destination request information and response message corresponding with the destination request information.
In step 113, analog end receive the destination request information from client and with the destination request information
Corresponding response message simultaneously stores.
Wherein, the information that step 113 stores comes from client, and the information is that client obtains at server
, because analog end does not have response message corresponding with this destination request information originally, so as to not possess simulation
Function.Therefore, client can just transfer to send destination request information to server, it is complete to obtain corresponding response message
Into test.After the response message that server returns is obtained, for the ease of can subsequently utilize analog end please to this target
Information is asked to be monitored and simulated to corresponding response message, it is necessary to by client actively by acquisition and the target
Response message passes to analog end and stored corresponding to solicited message.On the other hand, by being stored in constantly improve analog end
Response message species, user can also be easy to be checked in analog end, and be easy to user to similar response message
Entering edlin, (i.e. user, which can be based on existing a certain response message work slightly modification, can obtain another type of sound
Answer information).
Fig. 4 shows the method flow performed by analog end that an exemplary embodiment provides, with reference to the implementation of figure 2 above
Example, in the angle of analog end, this method may include steps of:
In step 202, when analog end and client, which are established, to be connected, analog end receives the target from the client
Solicited message.Wherein, the analog end is used to store corresponding solicited message and response message and provided described for editing
The page of response message.
In step 204, analog end obtains and the target according to the corresponding solicited message and response message of storage
Response message corresponding to solicited message.
In step 206, analog end sends the response message obtained to the client.
Fig. 5 shows the method flow by client executing that an exemplary embodiment provides, with reference to the implementation of figure 2 above
Example, in the angle of client, this method may include steps of:
In step 302, when client and analog end, which are established, to be connected, the client sends target to the analog end
Solicited message.Wherein, the analog end is used to store corresponding solicited message and response message and provided described for editing
The page of response message.
In step 304, when the client is not set up with the analog end to be connected, the user end to server hair
Send the destination request information.
Within step 306, the client receives response message corresponding with the destination request information.
In step 308, if the response message received derives from the server, the client is to described
Analog end sends the destination request information and response message corresponding with the destination request information.
In one embodiment, this method may also include:
Setting duration after client sends from destination request information to analog end is (such as:0.03 second) in do not receive from institute
The response message of analog end is stated, the client sends the destination request information to the server.
Wherein, client sends a solicited message to analog end and (informs that analog end needs to obtain and the solicited message pair
The response message answered) after, analog end can be waited to return to response message.But the present embodiment is in order to avoid because of waiting time mistake
Grow and bring the stuck sensation of client to user, it is necessary to set a setting duration, to ensure waiting time no more than this
Set duration.After waiting time the setting duration is exceeded, then client can stop waiting, and be sent out by user end to server
Send the destination request information.
In one embodiment, methods described may also include:
Received after client sends solicited message to analog end from the analog end indicating response message not
Successful information (showing that analog end does not possess the ability for simulating response message corresponding to this destination request information also) is simulated,
The client sends the destination request information to the server.
It is visible by above technical scheme, based on being used for for having corresponding solicited message and response message and providing
The analog end (being used for the application program simulated) of the page of the response message is edited, realizes the analog end and required test
Connection between client (App), and response message corresponding with each solicited message is simulated using the analog end, it is then back to
To the client, so that software test is more prone to.Also, user can also be according to demand in the analog end to each
Class response message enters edlin, and testing efficiency is higher.In addition, user can also in analog end real time inspection Mock situation,
It is easy to analyze Mock processes.By this method, test link is called for App RPC, can be without relying on client
Communication between end and server, but realized by means of analog end, because response message can be more favorable for taking human as editor
Improve the coverage rate of test.
It is corresponding with the above method, a kind of device for being used for the request analog response to client is also provided herein,
The device can be realized by software.
Fig. 6 shows a kind of module for applying the analogue means in simulation end equipment that an exemplary embodiment provides
Figure, as shown in fig. 6, in one embodiment, the device 400 can be applied to simulate end equipment, and the device 400 includes receiving unit
410th, response message obtaining unit 420 and response message transmitting element 430, wherein:
Receiving unit 410 is configured as:When the analog end and client, which are established, to be connected, reception comes from the client
Destination request information, wherein, the analog end is used to store corresponding solicited message and response message and provided for compiling
Collect the page of the response message.
Response message obtaining unit 420 is configured as:According to corresponding solicited message and response message, obtain with it is described
Response message corresponding to destination request information.
Response message transmitting element 430 is configured as:The response message obtained is sent to the client.
In one embodiment, described device 400 may also include information memory cell, and described information memory cell is configured
For:
When the client obtains response message corresponding with destination request information from server, reception comes from the visitor
The destination request information at family end and response message corresponding with the destination request information simultaneously store.
In one embodiment, described device 400 may also include notification unit, and the notification unit is configured as:
When the analog end is according to the corresponding solicited message and response message of storage, do not obtain and the destination request
Corresponding to information during response message, the analog end is sent to the client to indicate that response message does not simulate successful letter
Breath, so that the user end to server sends the destination request information.
Fig. 7 shows a kind of module of the analogue means of application of exemplary embodiment offer on a client device
Figure, as shown in fig. 7, in one embodiment, the device 500 can be applied to client device, the device 500 includes:First sends
Unit 510, the second transmitting element 520, the transmitting element 540 of response message receiving unit 530 and the 3rd, wherein:
First transmitting element 510 is configured as:When the client and analog end, which are established, to be connected, sent out to the analog end
Destination request information is sent, wherein, the analog end is used to store corresponding solicited message and response message and provided for compiling
Collect the page of the response message.
Second transmitting element 520 is configured as:When the client is not set up with the analog end to be connected, to server
Send the destination request information.
Response message receiving unit 530 is configured as:Receive response message corresponding with the destination request information.
3rd transmitting element 540 is configured as:When the response message derives from the server, to the analog end
Send the destination request information and response message corresponding with the destination request information.
In one embodiment, second transmitting element 520 is also configured to:
Do not received from the analog end in setting duration after the destination request information is sent to the analog end
Response message, send the destination request information to the server.
In one embodiment, second transmitting element 520 is also configured to:
Received after the destination request information is sent to the analog end from the analog end indicating to respond
Information does not simulate successful information, and the destination request information is sent to the server.
As shown in figure 8, this specification one or more embodiment provides a kind of client device or simulation end equipment (such as
Computer or mobile phone etc.), the client device or simulation end equipment can include processor, internal bus, network interface, memory
(including internal memory and nonvolatile memory), the hardware being also possible that certainly required for other business.During processor can be
Central Processing Unit (CPU), processing unit, process circuit, processor, application specific integrated circuit (ASIC), microprocessor or executable
One or more of other processing logics of instruction example.Processor read from nonvolatile memory corresponding to program to
In internal memory and then run.Certainly, in addition to software realization mode, this specification one or more embodiment is not precluded from other
Implementation, such as mode of logical device or software and hardware combining etc., that is to say, that the executive agent of following handling process
It is not limited to each logic unit or hardware or logical device.
In one embodiment, for simulating end equipment, its processor can be configured as:
When analog end and client, which are established, to be connected, the analog end receives the destination request letter from the client
Breath, the analog end have corresponding solicited message and response message and provide user circle for editing the response message
Face;
The analog end obtains and the destination request information according to the corresponding solicited message and response message of storage
Corresponding response message;
The analog end sends the response message obtained to the client.
In one embodiment, for client device, its processor can be configured as:
If client is established with analog end and is connected, the client sends destination request information to the analog end,
The analog end has corresponding solicited message and response message and provides the user interface for editing the response message;
If the client does not set up with the analog end and is connected, the user end to server sends the target please
Seek information;
The client receives response message corresponding with the destination request information;
If the response message received derives from the server, the client sends institute to the analog end
State destination request information and response message corresponding with the destination request information.
Each embodiment in this specification is described by the way of progressive, identical between each embodiment/similar
Part is mutually referring to what each embodiment stressed is the difference with other embodiment.Especially for simulation
For end equipment/client device embodiment, device embodiment, because it is substantially similar to embodiment of the method, so description
Fairly simple, the relevent part can refer to the partial explaination of embodiments of method.
System, device, module or the unit that above-described embodiment illustrates, it can specifically be realized by computer chip or entity,
Or realized by the product with certain function.One kind typically realizes that equipment is computer, and the concrete form of computer can
To be personal computer, laptop computer, cell phone, camera phone, smart phone, personal digital assistant, media play
In device, navigation equipment, E-mail receiver/send equipment, game console, tablet PC, wearable device or these equipment
The combination of any several equipment.
For convenience of description, it is divided into various units during description apparatus above with function to describe respectively.Certainly, this is being implemented
The function of each unit can be realized in same or multiple softwares and/or hardware during specification one or more embodiment.
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 use 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 use the computer for wherein including computer usable program code in one or more
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 describe.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 processors 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 produces, 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 counted
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as 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.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net
Network interface and internal memory.
Internal memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only storage (ROM) or flash memory (flashRAM).Internal memory is showing for computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM
(SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only deposit
Reservoir (ROM), Electrically Erasable Read Only Memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc
Read-only storage (CD-ROM), digital versatile disc (DVD) or other optical storages, magnetic cassette tape, tape magnetic rigid disk are deposited
Storage or other magnetic storage apparatus or any other non-transmission medium, the information that can be accessed by a computing device available for storage.
Defined according to herein, computer-readable medium does not include temporary computer readable media (transitorymedia), such as modulates
Data-signal and carrier wave.
It should also be noted that, term " comprising ", "comprising" or its any other variant are intended to nonexcludability
Comprising so that process, method, commodity or equipment including a series of elements not only include those key elements, but also wrapping
Include the other element being not expressly set out, or also include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that wanted including described
Other identical element also be present in the process of element, method, commodity or equipment.
It will be understood by those skilled in the art that the embodiment of this specification one or more embodiment can be provided as method, be
System or computer program product.Therefore, this specification one or more embodiment can use complete hardware embodiment, complete software
The form of embodiment in terms of embodiment or combination software and hardware.Moreover, this specification one or more embodiment can use
The computer-usable storage medium for wherein including computer usable program code in one or more (includes but is not limited to disk
Memory, CD-ROM, optical memory etc.) on the form of computer program product implemented.
This specification one or more embodiment can computer executable instructions it is general on
Described in hereafter, such as program module.Usually, program module includes performing particular task or realizes particular abstract data type
Routine, program, object, component, data structure etc..Can also put into practice in a distributed computing environment this specification one or
Multiple embodiments, in these DCEs, by being performed by communication network and connected remote processing devices
Task.In a distributed computing environment, the local and remote computer that program module can be located at including storage device is deposited
In storage media.
The embodiment of this specification one or more embodiment is the foregoing is only, is not limited to this specification
One or more embodiments.To those skilled in the art, this specification one or more embodiment can have it is various more
Change and change.It is all this specification one or more embodiment spirit and principle within made any modification, equivalent substitution,
Improve etc., it should be included within the right of this specification one or more embodiment.