CN105743724A - Method and device for testing services - Google Patents

Method and device for testing services Download PDF

Info

Publication number
CN105743724A
CN105743724A CN201410758083.0A CN201410758083A CN105743724A CN 105743724 A CN105743724 A CN 105743724A CN 201410758083 A CN201410758083 A CN 201410758083A CN 105743724 A CN105743724 A CN 105743724A
Authority
CN
China
Prior art keywords
service
service address
test
address
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410758083.0A
Other languages
Chinese (zh)
Inventor
程默
韩小军
晏建军
贺毅刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE ICT Technologies Co Ltd
Original Assignee
ZTE ICT Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE ICT Technologies Co Ltd filed Critical ZTE ICT Technologies Co Ltd
Priority to CN201410758083.0A priority Critical patent/CN105743724A/en
Publication of CN105743724A publication Critical patent/CN105743724A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method for testing services. The method comprises following steps: performing packaging and configuration to service addresses provided by an operation system and publishing the service addresses to a SOA platform test environment; generating a simulating client side request and performing service test to the service addresses after packaging and configuration. The invention also provides a device for testing services.

Description

Service testing method and device
Technical Field
The invention relates to a service-oriented architecture (SOA) technology, in particular to a service testing method and device in a process of accessing service development to an SOA platform.
Background
Web service (Webservice) is a platform-independent, low-coupling, self-contained, programmable web-based application that can be described, published, discovered, coordinated, and configured using the open extensible markup language (XML) standard.
Currently, the test of the webservice program running on the server mainly includes: testing an endpoint address of a service provider and testing after the service is accessed to an SOA platform, wherein the testing of the endpoint address of the service provider refers to the testing of the availability and the normalization of a webservice program provided by the service provider; the test after the service is accessed to the SOA platform means that after webservice configuration provided by a provider is packaged to the SOA platform, a new Web Service Description Language (WSDL) address of the webservice is provided, and then the new webservice is tested.
At present, after an SOA platform is built, whether a web service program of a server is available or not is mainly tested manually, and secondary development, release and the like are performed on a WSDL address provided by a service system by a manual method. Therefore, the testing period is long, and the service access process of the SOA completely depends on manpower, so that the testing efficiency and accuracy are very low, and the labor cost is high; and the service testing capability of the SOA platform cannot be compatible with each service system.
Disclosure of Invention
In view of this, embodiments of the present invention are expected to provide a service testing method and apparatus, which can shorten a testing period and improve testing efficiency and accuracy.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the embodiment of the invention provides a service testing method, which comprises the following steps:
packaging and configuring a service address provided by a service system, and issuing the service address to an SOA platform test environment;
and generating a simulation client request, and carrying out service test on the encapsulated and configured service address.
In the above scheme, the method further comprises: recording a test result; wherein, the test result includes but is not limited to: instance logs, error logs, call duration.
In the above solution, before encapsulating and configuring the service address provided by the service system, the method further includes: and checking the service address provided by the service system, and judging whether the service address meets the specification.
In the above solution, the encapsulating and configuring the service address provided by the service system includes: and constructing an SOA platform server, encapsulating the service address provided by the service system through the SOA platform server, and configuring the encapsulated service address.
In the foregoing solution, the generating a simulation client request includes: establishing a simulation client according to a service address provided by a service system, and generating a simulation client request through simulation request parameters of the simulation client; the request parameter is an input parameter formulated by the webservice interface, and includes but is not limited to: calling party, calling time, service inquiry content and verification field content.
The embodiment of the invention also provides a service testing device, which comprises: packaging a configuration module and a test module; wherein,
the encapsulation configuration module is used for encapsulating and configuring the service address provided by the service system and releasing the service address to an SOA platform test environment;
and the test module is used for generating a simulation client request and carrying out service test on the encapsulated and configured service address.
In the above scheme, the device further comprises a storage module for recording the test result; wherein, the test result includes but is not limited to: instance logs, error logs, call duration.
In the above solution, the apparatus further includes a verification module, configured to verify a service address provided by the service system, and determine whether the service address meets a specification.
In the foregoing solution, the encapsulation configuration module is specifically configured to: and constructing an SOA platform server, encapsulating the service address provided by the service system through the SOA platform server, and configuring the encapsulated service address.
In the above scheme, the test module is specifically configured to: and generating a simulation client request, and carrying out service test on the encapsulated and configured service address.
The service testing method and the device provided by the embodiment of the invention firstly encapsulate and configure the service address provided by the service system and release the service address to the SOA platform testing environment; and generating a simulation client request, and carrying out service test on the packaged and configured service address. Therefore, the service provided by the service provider can be directly tested without manual participation, the test period is shortened, the test efficiency and the test accuracy are improved, and the method and the device can be suitable for different business systems.
Drawings
FIG. 1 is a schematic diagram of a service architecture topology of an SOA platform according to an embodiment of the present invention;
FIG. 2 is a flow chart of a service testing method according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a service test apparatus according to an embodiment of the present invention.
Detailed Description
In the embodiment of the invention, a service address provided by a service system is packaged and configured and is released to an SOA platform test environment; and generating a simulation client request, and carrying out service test on the packaged and configured service address.
Firstly, understanding an application scenario of the service testing method according to the embodiment of the present invention, fig. 1 is a topological schematic diagram of an SOA platform service architecture according to the embodiment of the present invention, as shown in fig. 1, the service architecture includes four layers: the first layer is a consumption layer and refers to a service consumer; the second layer is an enterprise service bus which is used for uniformly managing service interfaces and uniformly releasing information; the third layer is a service test platform used for the service provider to perform self-service test of service access; the fourth layer is the business system, i.e., the service provider.
The service architecture of the SOA platform described above functions to enable a service consumer to use services provided by a service provider, that is, the service provider issues the provided services to an enterprise business bus, and the service consumer obtains the services provided by the service provider from the enterprise business bus. In general, a service address provided by a service provider cannot be directly used by a consumer, and the service address provided by the service provider needs to be processed and then provided to the service consumer for use; in addition, errors may exist after the service address provided by the service provider is processed, so in the embodiment of the present invention, after the SOA platform is successfully established, the service system located in the fourth layer develops and provides the webservice service according to the specified specification, and provides the WSDL address of the service to the test platform of the third layer after the WSDL address of the service is issued; then constructing an SOA platform service end on a test platform of a third layer, encapsulating a service address provided by a service system through the SOA platform service end, configuring the encapsulated service address, and then issuing the service address to an SOA platform test environment;
here, the SOA platform test environment is an enterprise service bus located in a second layer; then, a simulation client is built on the test platform, and a simulation client request is generated through simulation request parameters of the simulation client; and carrying out service test on the packaged and configured service address, and recording a test result. Therefore, the service test after the service is accessed to the SOA platform can be completed without manual intervention.
The following describes the implementation of the technical solution of the present invention in further detail with reference to the accompanying drawings and specific embodiments. Fig. 2 is a schematic flow chart of a service testing method according to an embodiment of the present invention, and as shown in fig. 2, the service testing method according to the embodiment of the present invention includes the following steps:
step 201: packaging and configuring a service address provided by a service system, and issuing the service address to an SOA platform test environment;
in this step, the encapsulation refers to performing secondary development on the service address, and modifying a WSDL file, an XML Structure Definition (XSD) file, and internal node parameters of a service provided by the service system according to a Simple Object Access Protocol (SOAP) of the SOA platform; the configuration refers to deploying the packaged service address, such as to an SOA platform. The service address after encapsulation and configuration differs from the original service address in that the wsdl address, mainly the IP, differs from the port.
In this embodiment of the present invention, before encapsulating and configuring a service address provided by a service system, the method further includes: and checking the service address provided by the service system, and judging whether the service address meets the specification.
The encapsulating and configuring the service address provided by the service system comprises: and constructing an SOA platform server, encapsulating the service address provided by the service system through the SOA platform server, and configuring the encapsulated service address.
Specifically, an adapter is selected, an SOA platform service end is constructed according to an automatic service packaging assembly provided by the SOA platform, a service address provided by a service system is packaged and configured through the SOA platform service end, and then the service address is issued to a configured SOA platform enterprise service bus environment. And when the release is failed, returning a failed identifier and an abnormal message according to the content of the service specification for analyzing the failure reason.
Here, the reasons for the release failure include: the endpoint address of the provider is configured with errors, the configuration of the acquired data source is wrong, or the format of the package is inconsistent with the version specification of the SOA platform, and the like.
Step 202: generating a simulation client request, and carrying out service test on the encapsulated and configured service address;
the generating of the simulated client request comprises: establishing a simulation client according to a service address provided by a service system, and generating a simulation client request through simulation request parameters of the simulation client; the request parameter is an input parameter formulated by the webservice interface, and includes but is not limited to: calling party, calling time, service inquiry content and verification field content.
In this step, the test may be a client test similar to the soapoui; and constructing a simulation client, generating a simulation client request through the simulation request parameters of the simulation client, and carrying out service test on the encapsulated and configured service address. For example, the simulation client simulates the behavior of a service consumer, generates a set of request parameters, requests a service provided by a service provider, and receives test results.
In the embodiment of the invention, after the service test is carried out, the method also comprises the steps of recording the test result and providing the service address passing the test for the consumer to use; wherein, the test result includes but is not limited to: the instance log, the error log, the calling time and the like are used for providing instance log query, carrying out exception tracking analysis and quickly positioning service problems.
The embodiment of the invention only takes the above process as an example, and in the specific implementation process, the specific steps can be adjusted, replaced, deleted and the like according to the actual application scene. Those skilled in the art will recognize that changes and modifications may be made to the present invention without departing from the spirit and scope of the invention. For example, the steps may be interchanged as appropriate, and some processes may be performed in order to form new embodiments while still achieving the objects of the invention described herein.
An embodiment of the present invention further provides a service testing apparatus, fig. 3 is a schematic structural diagram of the service testing apparatus according to the embodiment of the present invention, and as shown in fig. 3, the apparatus includes: a package configuration module 31, a test module 32; wherein,
the encapsulation configuration module 31 is configured to encapsulate and configure a service address provided by the service system, and issue the service address to an SOA platform test environment;
in the embodiment of the present invention, the apparatus further includes a checking module 33, configured to check a service address provided by the service system, and determine whether the service address meets the specification.
The encapsulation configuration module 31 is specifically configured to: and constructing an SOA platform server, encapsulating the service address provided by the service system through the SOA platform server, and configuring the encapsulated service address.
The encapsulation refers to performing secondary development on the service address, and modifying a WSDL (wireless sensor description language) file, an XML (extensible markup language) structure definition) file and internal node parameters of the service provided by the service system according to a Simple Object Access Protocol (SOAP) of an SOA (service oriented architecture) platform; the configuration refers to deploying the packaged service address, such as to an SOA platform. The service address after encapsulation and configuration differs from the original service address in that the wsdl address, mainly the IP, differs from the port.
Specifically, the encapsulation configuration module 31 selects an adapter, constructs an SOA platform service end according to the service automatic encapsulation component provided by the SOA platform, encapsulates and configures a service address provided by the service system through the SOA platform service end, and then issues the service address to the configured SOA platform enterprise service bus environment. And when the release is failed, returning a failed identifier and an abnormal message according to the content of the service specification for analyzing the failure reason.
Reasons for publication failure include: the endpoint address of the provider is configured with errors, the configuration of the acquired data source is wrong, or the format of the package is inconsistent with the version specification of the SOA platform, and the like.
The test module 32 is configured to generate a simulation client request, and perform a service test on the encapsulated and configured service address.
In the embodiment of the present invention, the test module 32 is specifically configured to: establishing a simulation client according to a service address provided by a service system, and generating a simulation client request through simulation request parameters of the simulation client; wherein, the request parameter includes but is not limited to the input parameter formulated by the webservice interface: calling party, calling time, service inquiry content and verification field content.
In this step, the service test performed on the encapsulated and configured service address by the test module 32 may be a client test similar to the soapii; and constructing a simulation client, generating a simulation client request through the simulation request parameters of the simulation client, and carrying out service test on the encapsulated and configured service address. For example, the simulation client simulates the behavior of a service consumer, generates a set of request parameters, requests a service provided by a service provider, and receives test results.
In the embodiment of the present invention, the apparatus further includes a storage module 34, configured to record a test result after performing a service test, and provide a service address passing the test to a consumer for use; wherein, the test result includes but is not limited to: the instance log, the error log, the calling time and the like are used for providing instance log query, carrying out exception tracking analysis and quickly positioning service problems.
The implementation functions of the processing modules in the service test apparatus shown in fig. 3 can be understood with reference to the related description of the service test method. Those skilled in the art will understand that the functions of each processing unit in the service test apparatus shown in fig. 3 can be implemented by a program running on a processor, and can also be implemented by specific logic circuits, such as: can be realized by a Central Processing Unit (CPU), a Microprocessor (MPU), a Digital Signal Processor (DSP) or a Field Programmable Gate Array (FPGA); the storage unit may also be implemented by various memories, or storage media.
In the embodiments provided in the present invention, it should be understood that the disclosed method, apparatus and system can be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the modules is only one logical functional division, and other division manners may be implemented in practice, such as: multiple modules or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the communication connections between the components shown or discussed may be through interfaces, indirect couplings or communication connections of devices or modules, and may be electrical, mechanical or other.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional modules in the embodiments of the present invention may be integrated into one processing module, or each module may be separately used as one module, or two or more modules may be integrated into one module; the integrated module can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as a removable storage device, a Read-only memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated module according to the embodiment of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The service testing method, apparatus and system described in the embodiments of the present invention are only examples of the above embodiments, but not limited thereto, and those skilled in the art should understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (10)

1. A method for service testing, the method comprising:
packaging and configuring a service address provided by a service system, and issuing the service address to an SOA platform test environment;
and generating a simulation client request, and carrying out service test on the encapsulated and configured service address.
2. The method of claim 1, further comprising: recording a test result; wherein, the test result includes but is not limited to: instance logs, error logs, call duration.
3. The method of claim 1, wherein prior to encapsulating and configuring the service address provided by the business system, the method further comprises: and checking the service address provided by the service system, and judging whether the service address meets the specification.
4. The method of claim 1 or 3, wherein encapsulating and configuring the service address provided by the service system comprises: and constructing an SOA platform server, encapsulating the service address provided by the service system through the SOA platform server, and configuring the encapsulated service address.
5. The method of claim 1, wherein generating the simulated client request comprises: establishing a simulation client according to a service address provided by a service system, and generating a simulation client request through simulation request parameters of the simulation client; the request parameter is an input parameter formulated by the webservice interface, and includes but is not limited to: calling party, calling time, service inquiry content and verification field content.
6. A service testing apparatus, characterized in that the apparatus comprises: packaging a configuration module and a test module; wherein,
the encapsulation configuration module is used for encapsulating and configuring the service address provided by the service system and releasing the service address to an SOA platform test environment;
and the test module is used for generating a simulation client request and carrying out service test on the encapsulated and configured service address.
7. The apparatus of claim 6, further comprising a storage module for recording the test result; wherein, the test result includes but is not limited to: instance logs, error logs, call duration.
8. The apparatus of claim 6, further comprising a checking module, configured to check a service address provided by the service system, and determine whether the service address meets a specification.
9. The apparatus according to claim 6 or 8, wherein the encapsulation configuration module is specifically configured to: and constructing an SOA platform server, encapsulating the service address provided by the service system through the SOA platform server, and configuring the encapsulated service address.
10. The apparatus of claim 6, wherein the testing module is specifically configured to: and generating a simulation client request, and carrying out service test on the encapsulated and configured service address.
CN201410758083.0A 2014-12-10 2014-12-10 Method and device for testing services Pending CN105743724A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410758083.0A CN105743724A (en) 2014-12-10 2014-12-10 Method and device for testing services

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410758083.0A CN105743724A (en) 2014-12-10 2014-12-10 Method and device for testing services

Publications (1)

Publication Number Publication Date
CN105743724A true CN105743724A (en) 2016-07-06

Family

ID=56240340

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410758083.0A Pending CN105743724A (en) 2014-12-10 2014-12-10 Method and device for testing services

Country Status (1)

Country Link
CN (1) CN105743724A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107257290A (en) * 2017-05-15 2017-10-17 中国电力科学研究院 A kind of method of testing and system of open SOA Service-Oriented Architecture Baseds
CN109213682A (en) * 2018-09-06 2019-01-15 郑州云海信息技术有限公司 A kind of method of test client, client, server-side and readable storage medium storing program for executing
CN109669859A (en) * 2018-11-26 2019-04-23 平安科技(深圳)有限公司 Service test method, device, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1791037A (en) * 2005-12-26 2006-06-21 北京航空航天大学 Method for realizing Web service automatic test
US20060150026A1 (en) * 2001-08-13 2006-07-06 Parasoft Corporation System and method for testing of web services
CN101771725A (en) * 2010-01-04 2010-07-07 北京航空航天大学 Method and system for constructing service testing environment
US20130036156A1 (en) * 2011-08-03 2013-02-07 Mariela Todorova Automated framework for testing enterprise services consumer technologies
CN102932205A (en) * 2012-11-19 2013-02-13 深圳市亚特尔科技有限公司 Automatic test method and test platform of network server-side interface
CN103581310A (en) * 2013-10-24 2014-02-12 深圳市远行科技有限公司 Automatic generating method for web service agent

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060150026A1 (en) * 2001-08-13 2006-07-06 Parasoft Corporation System and method for testing of web services
CN1791037A (en) * 2005-12-26 2006-06-21 北京航空航天大学 Method for realizing Web service automatic test
CN101771725A (en) * 2010-01-04 2010-07-07 北京航空航天大学 Method and system for constructing service testing environment
US20130036156A1 (en) * 2011-08-03 2013-02-07 Mariela Todorova Automated framework for testing enterprise services consumer technologies
CN102932205A (en) * 2012-11-19 2013-02-13 深圳市亚特尔科技有限公司 Automatic test method and test platform of network server-side interface
CN103581310A (en) * 2013-10-24 2014-02-12 深圳市远行科技有限公司 Automatic generating method for web service agent

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107257290A (en) * 2017-05-15 2017-10-17 中国电力科学研究院 A kind of method of testing and system of open SOA Service-Oriented Architecture Baseds
CN109213682A (en) * 2018-09-06 2019-01-15 郑州云海信息技术有限公司 A kind of method of test client, client, server-side and readable storage medium storing program for executing
CN109669859A (en) * 2018-11-26 2019-04-23 平安科技(深圳)有限公司 Service test method, device, computer equipment and storage medium
CN109669859B (en) * 2018-11-26 2024-05-24 平安科技(深圳)有限公司 Service testing method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US10841336B2 (en) Selectively providing mutual transport layer security using alternative server names
US10949335B2 (en) Designer defined mocking service behavior
CN106776313B (en) Method and device for simulating service and centralized management platform
US9842045B2 (en) Failure recovery testing framework for microservice-based applications
US20200036595A1 (en) System and method for custom graph generation
CN109302522A (en) Test method, device and computer system and medium
US20170300402A1 (en) Mock server and extensions for application testing
US20170185507A1 (en) Processing special requests at dedicated application containers
WO2022016847A1 (en) Automatic test method and device applied to cloud platform
US11561889B2 (en) Orchestration for automated performance testing
US20150128103A1 (en) System and method for automating application programming interface integration
US10904128B2 (en) Testing functionality of an Internet of Things environment
TWI685800B (en) System and method for task scheduling and device management
CN108459850B (en) Method, device and system for generating test script
KR20160106156A (en) Method and apparatus for visualized operation and maintenance of network
CN113485927B (en) Test data generation method, device, equipment and storage medium
CN112615759B (en) Full link voltage measurement assembly, full link voltage measurement method and device
CN112035363A (en) Automatic interface testing method and device
CN108255708A (en) Method, apparatus, storage medium and the equipment of production file are accessed in test environment
CN116056126A (en) Simulation test method, simulation test device, computer equipment and computer readable storage medium
CN105743724A (en) Method and device for testing services
CN111752820A (en) Pressure testing method of gPC interface, computer equipment and storage medium
CN111526028B (en) Data processing method, device and equipment
WO2023124314A1 (en) Micro-service test method and system for hybrid cpu architecture device, and related apparatus
CN110825538A (en) MQ-based method for dynamically interacting data by self-defining data types

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160706

RJ01 Rejection of invention patent application after publication