Invention content
In view of the deficiencies in the prior art, the purpose of the present invention is to provide a kind of test method of software platform and
System is omitted the realization of dispatcher, significantly reduces setting for test frame without establishing connection by connection management component
Meter and the complexity realized, effectively improve the testing efficiency to software platform.
The present invention provides a kind of test method of software platform, and software platform includes at least one MUT module under test, the side
Method includes the following steps:
Test frame notifies MUT module under test to create component instance, wherein component instance is using test frame as connection management
Component;
Test frame is established with component instance and connects and tested.
Based on the above technical solution, the test frame is using its component ID as the component ID of connection management component
The establishment parameter for being passed to the MUT module under test is packaged function, and the MUT module under test calls the establishment component functions of software platform to create
The component instance.
Based on the above technical solution, the component instance is as server end or client.
Based on the above technical solution, the test frame is sent out as connection management component to the component instance
Send new client request;
After the component instance creates new client connection, sends connection establishment to the test frame and receive the response;
The test frame is applied for the registration of as client to the component instance;
After succeeding in registration, the component instance reply succeeds in registration message to the test frame.
Based on the above technical solution, the test frame disappears to the component instance issue client terminal resource reservation
Breath, wherein by the component ID words at the news release end in the component ID filling client resource reserving messages of the test frame
The component ID fields of section and connection client.
Based on the above technical solution, the connection, which creates to receive the response, carries the mark of the new client connection
Know symbol;
In the client registration message of test frame publication, the identifier being correspondingly connected at message sink end is institute
State the identifier of new client connection.
Based on the above technical solution, the component instance is as client;
The component instance adds client request message to the test frame publication as connection management component;
The test frame is as connection management component to the component instance publisher server available message;
The component instance is to the test frame issue client terminal registration message as server end;
The test frame is receiveed the response as server end reply client registers;
The test frame receives the server end available message that the component instance is responded as connection management component, leads to
Connection is accused to be successfully established.
Based on the above technical solution, in the addition client request message, the corresponding of news release end connects
The identifier connect is the U_HANDLE identifiers of the component instance;
In the server available message, the identifier being correspondingly connected at message sink end is the U_ of the component instance
HANDLE identifiers, and by the group of the component id field and server end at the component ID of test frame filling news releases end
Part id field.
Based on the above technical solution, in the client registration message of component instance publication, news release
The identifier being correspondingly connected at end is the C_HANDLE identifiers of the component instance;
In the client registers are receiveed the response, the identifier being correspondingly connected at message sink end is the component instance
C_HANDLE identifiers.
The present invention also provides a kind of test systems of the test method using above-mentioned software platform, and the system comprises tests
The MUT module under test of frame and software platform;
The test frame includes creating indicating module, transceiver module and test module, creates indicating module for notifying
MUT module under test create component instance, transceiver module be used for component instance establish connect, test module be used for component instance into
Row test;
The MUT module under test is for creating component instance.
Compared with prior art, advantages of the present invention is as follows:
(1) test frame notice MUT module under test creates component instance, and test frame is directly established with component instance and connected, nothing
It need to be established and be connected by connection management component, the realization of dispatcher is omitted, test frame requires publication according to test case
Message, can invocation component example immediately message processing function, moreover, the message that test frame requires to receive according to use-case,
Message is chosen in the task queue that test frame can directly be traversed, and significantly reduces the design of test frame and the complexity realized
Degree effectively improves the testing efficiency to software platform.
(2) test frame can be realized to being tested as the MUT module under test of client or server end to software
Comprehensive test of Service Component in platform.
Specific implementation mode
Below in conjunction with the accompanying drawings and specific embodiment the present invention is described in further detail.
The present invention provides a kind of test method of software platform, and software platform includes at least one MUT module under test, this test
Method includes the following steps:
Test frame notifies MUT module under test to create component instance, wherein component instance is using test frame as connection management
Component.
Test frame is established with component instance and connects and tested.
It is connection management component since component instance is considered as test frame when creating, component instance is handed over test frame
A series of mutually IPS message established needed for connection, provide the identifier (Handle) of each connection in component, complete test case
The negotiation of required connection with connect establish.For test frame with component instance in follow-up test, test frame can use these
Handle gives out information to component instance.For component instance, runs and run in the actual environment simultaneously in test frame
Without different.
It is directly established and is connect with component instance due to test frame, be not necessarily to connection management component, the reality of dispatcher is omitted
Existing, test frame requires the message of publication according to test case, can invocation component example immediately message processing function, and
And message is chosen in the message that test frame requires to receive according to use-case, the task queue that can directly traverse test frame, greatly
Ground reduces the design of test frame and the complexity realized, effectively improves the testing efficiency to software platform.
Shown in Figure 2, first embodiment of the invention provides a kind of test method of software platform, in this test method
In, this test method includes the following steps:
S110. test frame notice MUT module under test creates component instance, wherein component instance is using test frame as connection
Management assembly.
In one embodiment, by the component of the connection management component in the component ID filling component instances of test frame
Id field, component instance is using test frame as connection management component.Below with the routing management component urs_ in software platform
Rtm is illustrated as MUT module under test, and urs_rtm components are that the parameter being passed to when being created by component instance confirms connecting tube
The component ID of component is managed, i.e. test frame is passed the component ID of oneself as component ID (sm_pid) parameter of connection management component
The establishment parameter for entering MUT module under test is packaged function, and the establishment component functions for recalling software platform offer create component instance.
S120. test frame is established with component instance and is connected.
S130. test frame tests component instance.
Step S130 is specifically included:
S131. test frame judges whether event queue is empty, if so, terminating;If it is not, entering step S132.Specifically,
Test frame safeguards an IPS communication event queue, judges whether the IPS communication events queue is empty.If it is empty, then knot is tested
Beam.If not empty, then S132 is entered step.
S132. an event is taken out from IPS communication event queues.
S133. judge whether the event is reception type event, if reception type event, illustrate that test frame needs to locate at this time
The message that the component instance that reason and verification are tested is issued, enters step S134;If it is not, then illustrating that test frame is needed to quilt
The component instance of survey gives out information, and enters step S135.
S134. receive and verify the message of tested component instance publication, return to step S131.
S135. it gives out information to component instance, return to step S131.
Second embodiment of the invention provides a kind of test method of software platform, or with the routing management in software platform
Component urs_rtm is illustrated as MUT module under test, this test method includes the following steps:
S210. test frame notice MUT module under test creates component instance, wherein component instance is using test frame as connection
Management assembly.
S220. test frame is established with component instance and is connected, wherein component instance is as server end.
S230. test frame tests component instance.
Wherein, the step S210 in second embodiment is identical as the step S110 in first embodiment of the invention, and second is real
The step S230 applied in example is identical as the step S130 in first embodiment of the invention, second embodiment and first embodiment
Difference lies in step S220.
The specific steps of step S220 include:
S221. test frame sends new client request as connection management component to component instance.
IPS message in the application is the communication information of the User space cross-thread of involved software platform.Lead in IPS message
Often show the connection belonging to itself including following three fields, as shown in table 1:
Table 1:
Field name |
Chinese |
receiver_handle |
The identifier being correspondingly connected at message sink end |
sender handle |
The identifier being correspondingly connected at news release end |
sender_pid |
The component ID at news release end |
Message sink end needs to determine by the identifier receiver_handle being correspondingly connected at message sink end
The link control module of oneself, then determine how and handle this message.
Identifier handle is a numerical value, and value range can be 0 to 4294967295.Handle is as global rope
Draw, for identifying different data structures.Be required between client, server end and connection management component by handle come
Identify different connections.
Server end is each connection two identifier of distribution:The S_HANDLE that server end is interacted with client, clothes
The U_HANDLE at business device end and connection management component interaction.
Client is each connection two identifier of distribution:The C_HANDLE of client and server interaction, client
The U_HANDLE at end and connection management component interaction.
Connection management component can be that each connection distributes a M_HANDLE.
Specifically, test frame is to component instance issue client terminal resource reservation message, wherein test frame is by test block
The component of the component id field and connection client at the news release end in the component ID filling client resource reserving messages of frame
Id field.
Client resource reserving message is a kind of IPS message, wherein relevant field and the content of filling are as shown in table 2:
Table 2:The field that client resource reserving message includes
For test frame, sender_pid fillings are the component ID (i.e. the component ID of test frame) of oneself,
It is connection management component, institute since component instance is considered as test frame when creating for the component instance of MUT module under test
It is sent and is asked to component instance using test frame here as connection management component.
S222. it after component instance creates new client connection, sends connection establishment to test frame and receives the response.
After component instance receives client resource reserving message, it will be considered that this is normally asking in an equipment normal operation
It asks, then attempts the new new client that is connected to of establishment one and connect.It, can be to test frame if the connection creates successfully
Publication one is successfully responded, and the connection establishment that component instance is issued to test frame, which is receiveed the response, carries new client connection
Identifier.Connect specifically, containing new client in the slave_data_handle fields that connection creates in receiveing the response
The identifier connect:The S_HANDLE that server end is interacted with client.
S223. test frame receives connection establishment and receives the response.
It receives the response if being successfully received connection and creating, test frame creates a structure to safeguard this S_
HANDLE.If having received the response of failure, step S221 is returned to.
S224. test frame is applied for the registration of as client to component instance.
In the client registration message of test frame publication, the identifier being correspondingly connected at message sink end is new client
Hold the identifier of connection.
Specifically, client registration message is as shown in table 3:
Table 3:The field that client registration message includes
S225. after succeeding in registration, component instance reply succeeds in registration message to test frame.
Test frame can receive but not handle this message.
By above step, component instance, which just will be considered that, has been successfully established a new connection.Follow-up test frame needs
This is issued to component instance and connects relevant message, it is only necessary to be filled into the S_HANDLE that component instance in step 222 returns
Receiver_handle fields are used as in the IPS message of publication.
Third embodiment of the invention provides a kind of test method of software platform, or with the routing management in software platform
Component urs_rtm is illustrated as MUT module under test, this test method includes the following steps:
S310. test frame notice MUT module under test creates component instance, wherein component instance is using test frame as connection
Management assembly.
S320. test frame is established with component instance and is connected, wherein component instance is as client.
S330. test frame tests component instance.
Wherein, the step S310 in 3rd embodiment is identical as the step S110 in first embodiment of the invention, and third is real
The step S330 applied in example is identical as the step S330 in first embodiment of the invention, 3rd embodiment and first embodiment
Difference lies in step S320.
The specific steps of step S320 include:
S321. component instance adds client request message to the test frame publication as connection management component.Adding
Adding in client request message, the identifier of the corresponding connection at news release end is the U_HANDLE identifiers of component instance,
Specifically, addition client request message is as shown in table 4:
Table 4:The field that addition client request message includes
Field name |
Fill content |
Meaning |
receiver_handle |
0 |
0 |
sender_handle |
U_HANDLE |
The U_HANDLE of client |
sender_pid |
The ID of component instance |
The component ID of client |
S322. it after test frame has received addition client request message, establishes data structure preservation addition client and asks
The identifier for asking the sender_handle values of message to be connected as this, and receiveing the response for new client connection request is issued, such as
Shown in table 5:
Table 5:New client connection request receive the response including field
When test frame pretends oneself as connection management component, using the U_HANDLE of this client as test block
Frame issues the receiver_handle of IPS message.
S323. test frame as connection management component to component instance publisher server available message, server can
With in message, the identifier being correspondingly connected at message sink end is the U_HANDLE identifiers of component instance, and by test frame
Component ID filling news release end component id field and server end component id field.
Server available message is as shown in table 6:
Table 6:The field that server available message includes
For component instance, sender_pid should be the component ID of connection management component, since MUT module under test is being created
It is connection management component that test frame is considered as when building, so that fill here is actually the component ID of test frame.
S324. component instance receives server available message, and to the test frame issue client terminal as server end
Registration message.In the client registration message of component instance publication, the identifier at message sink end is the C_ of component instance
HANDLE identifiers, as shown in table 7:
Table 7:The field that client registration message includes
S325. test frame replys client registers as server end and receives the response, and completes establishment of connection.In client
During end registration is receiveed the response, the identifier being correspondingly connected at message sink end is the C_HANDLE identifiers of component instance, client
End registration is receiveed the response as shown in table 8:
Table 8:Client registers receive the response including field
S326. the server end available message that test frame is responded as connection management component receiving unit example, notice
Connection is successfully established.
After connection is successfully established, the server end available message received can be returned to test frame by component instance.Test
Frame can directly discharge this section of memory.
Test frame can be realized to being tested as the MUT module under test of client or server end to software platform
Comprehensive test of middle Service Component.
Shown in Figure 3, fourth embodiment of the invention provides a kind of test of the test method using above-mentioned software platform
System, this test system include the MUT module under test of test frame and software platform.
Test frame includes creating indicating module, transceiver module and test module, creates indicating module for notifying to be tested
Component creates component instance, and transceiver module is used to establish with component instance and connect, and test module is for surveying component instance
Examination.MUT module under test is for creating component instance.
On the basis of fourth embodiment of the invention, fifth embodiment of the invention provides a kind of test system of software platform
System, this test system includes the MUT module under test of test frame and software platform, wherein component instance is as server end and transmitting-receiving
Module establishes connection.
On the basis of fourth embodiment of the invention, sixth embodiment of the invention provides a kind of test system of software platform
System, this test system includes the MUT module under test of test frame and software platform, wherein component instance is as client and transmitting-receiving mould
Block establishes connection.
The present invention is not limited to the above-described embodiments, for those skilled in the art, is not departing from
Under the premise of the principle of the invention, several improvements and modifications can also be made, these improvements and modifications are also considered as the protection of the present invention
Within the scope of.The content not being described in detail in this specification belongs to the prior art well known to professional and technical personnel in the field.