[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN1791037A - Method for realizing Web service automatic test - Google Patents

Method for realizing Web service automatic test Download PDF

Info

Publication number
CN1791037A
CN1791037A CN 200510132532 CN200510132532A CN1791037A CN 1791037 A CN1791037 A CN 1791037A CN 200510132532 CN200510132532 CN 200510132532 CN 200510132532 A CN200510132532 A CN 200510132532A CN 1791037 A CN1791037 A CN 1791037A
Authority
CN
China
Prior art keywords
execution
web service
service
container
test
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.)
Granted
Application number
CN 200510132532
Other languages
Chinese (zh)
Other versions
CN100353714C (en
Inventor
怀进鹏
胡春明
李翔
唐鹏
刘哲
王丽凤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
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 Beihang University filed Critical Beihang University
Priority to CNB2005101325321A priority Critical patent/CN100353714C/en
Publication of CN1791037A publication Critical patent/CN1791037A/en
Application granted granted Critical
Publication of CN100353714C publication Critical patent/CN100353714C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

本发明涉及一种实现Web服务自动化测试的方法,包括:执行测试用例;建立系统资源监视模块,监视资源的读写;建立并启动代理服务器,将系统内的所有网络连接都设置为通过代理服务器来中转;JAVA虚拟机根据测试用例中的服务部署代码,来建立虚拟Web服务容器,并在该容器中部署服务;执行测试验证代码,启动一个调用Web服务的客户端,该客户端建立网络连接对服务进行调用,调用请求由代理服务器接收、并传递给虚拟Web服务容器进行处理,然后将调用的结果返回给该客户端;执行测试验证代码测试其返回值;输出测试结果。该方法只需要编写一个测试用例就可以完成Web服务的测试,少了人工进行Web服务部署的步骤,从而实现自动化。

The invention relates to a method for realizing automated testing of Web services, comprising: executing test cases; establishing a system resource monitoring module to monitor resource reading and writing; establishing and starting a proxy server, and setting all network connections in the system to pass through the proxy server to transfer; the JAVA virtual machine builds a virtual Web service container according to the service deployment code in the test case, and deploys the service in the container; executes the test verification code, starts a client that calls the Web service, and the client establishes a network connection To call the service, the call request is received by the proxy server and passed to the virtual Web service container for processing, and then the result of the call is returned to the client; the test verification code is executed to test its return value; the test result is output. This method only needs to write a test case to complete the test of the Web service, and eliminates the manual steps of deploying the Web service, thereby realizing automation.

Description

一种实现Web服务自动化测试的方法A Method for Realizing Automated Testing of Web Services

技术领域technical field

本发明涉及一种实现Web服务自动化测试的方法,特别是一种通过虚拟Web服务容器,对Web服务自动化测试的方法。The invention relates to a method for realizing automatic testing of Web services, in particular to a method for automatic testing of Web services through a virtual Web service container.

背景技术Background technique

Web服务(Web Service)是近十年里IT领域出现的新技术之一,它是构建互联网分布式系统的基本部件,并正在成为企业应用集成(EnterpriseApplication Integration,简称EAI)的有效平台。万维网联盟(World WideWeb Consortium,简称W3C)对其定义为:“Web服务是一种通过统一资源标识(Uniform Resource Identifier,简称URI)的软件应用,其接口及绑定形式可以通过可扩展标记语言(eXtensible Markup Language,简称XML)定义、描述和检索,并能通过XML消息及互联网协议完成与其他应用的直接交互”。不仅越来越多的企业之间通过Web服务进行业务往来,而且越来越多的企业内部也开始使用Web服务来构建协同工作的分布式系统。Web服务是具有一定功能的程序,对其测试是为了检验服务的功能是否达到了涉及的要求。对于Web服务,一般而言其它企业是无法获知其源代码的,只能通过服务的Web服务描述文件(Web Service Description Language,简称WSDL)生成一个客户端对服务进行测试。这就造成了Web服务软件测试技术基本上还停留在对单个Web服务的测试上,没有对整个Web服务体系的集成测试。当面对多个Web服务组成的协同工作系统时,这些测试技术仅能看到某一个服务的执行结果,而对于该服务执行过程中所调用的其它服务却一无所知。Web Service (Web Service) is one of the new technologies that have emerged in the IT field in the past ten years. It is the basic component of building Internet distributed systems and is becoming an effective platform for Enterprise Application Integration (EAI). The World Wide Web Consortium (W3C for short) defines it as: "A Web service is a software application that uses a Uniform Resource Identifier (URI for short), and its interface and binding form can be defined by Extensible Markup Language ( eXtensible Markup Language (XML for short) defines, describes and retrieves, and can complete direct interaction with other applications through XML messages and Internet protocols." Not only more and more enterprises conduct business transactions through Web services, but also more and more enterprises start to use Web services to build collaborative distributed systems. Web service is a program with certain functions, and its test is to check whether the function of the service meets the requirements involved. For Web services, generally speaking, other enterprises cannot know its source code, and can only generate a client to test the service through the Web Service Description Language (WSDL) of the service. This has caused the Web service software testing technology to basically stay on the test of a single Web service, and there is no integrated test of the entire Web service system. When faced with a collaborative work system composed of multiple Web services, these testing technologies can only see the execution result of a certain service, but they don't know anything about other services called during the execution of the service.

Altava公司的xmlspy提供对WSDL文件和简单对象访问协议(SimpleObject Access Protocol,简称SOAP,是在分散或分布式的环境中交换信息并执行远程过程调用的协议,是一个基于XML的协议)消息的测试;CapeScience公司的Nettool提供对SOAP消息的截获检查和转发功能。无论是xmlspy还是Nettool都仅仅是对单个SOAP消息的考虑,没有全面进行集成测试的概念。而实际上Web服务组合而成的Web软件越来越强调Web服务之间的协作,Web服务的调用过程可能引发消息和通讯等错误,因此如何测试Web服务间的交互关系,对Web服务软件进行总体测试很重要。Altava's xmlspy provides testing of WSDL files and Simple Object Access Protocol (SOAP, a protocol for exchanging information and executing remote procedure calls in a decentralized or distributed environment, an XML-based protocol) messages ; CapeScience's Nettool provides interception, inspection and forwarding of SOAP messages. Whether it is xmlspy or Nettool, it only considers a single SOAP message, and there is no concept of comprehensive integration testing. In fact, Web software composed of Web services is increasingly emphasizing the cooperation between Web services. The calling process of Web services may cause errors such as messages and communications. Overall testing is important.

一个由Web服务组成的分布式系统,服务会部署在不同的机器上。服务不仅供客户端来调用,同时它自己也会作为客户端,对其它一个或多个服务进行调用。由于Web服务运行在不同的机器上,给系统集成测试和调试造成了很大的难度。主要体现以下几点:A distributed system composed of web services, the services will be deployed on different machines. A service is not only for clients to call, but also serves as a client to call one or more other services. Since Web services run on different machines, it is very difficult for system integration testing and debugging. It mainly reflects the following points:

1、必须先启动Web服务容器,部署服务后进行测试。服务修改后又得重复这个步骤。这个过程很难实现自动化,当服务要部署到多个容器时,难度更大。1. The Web service container must be started first, and then tested after deploying the service. This step must be repeated after the service is modified. This process is difficult to automate, and it is even more difficult when the service is deployed to multiple containers.

2、当许多Web服务要部署时,不仅会花费大量人力,而需要很多的硬件设施,测试成本很高。2. When many web services are to be deployed, it will not only cost a lot of manpower, but also require a lot of hardware facilities, and the testing cost is very high.

3、当多个Web服务之间有相互调用关系时,这样的系统很难调试,经测试发现错误后,错误的根源会很难跟踪。3. When multiple web services have a mutual call relationship, such a system is difficult to debug. After the error is found through testing, the source of the error will be difficult to track.

4、Web服务之间交换的SOAP消息无法得到有效地记录,这样造成Web服务间的交互关系、依赖关系、调用的时间序列不易确定。4. SOAP messages exchanged between Web services cannot be effectively recorded, which makes it difficult to determine the interaction relationship, dependency relationship, and call time sequence between Web services.

发明内容Contents of the invention

本发明的目的在于针对现有技术的不足,提出一种实现Web服务自动化测试的方法,只需要编写一个测试用例就可以完成对一个Web服务或多个具有协作关系的Web服务的功能测试,少了人工部署Web服务的步骤,从而实现自动化。The purpose of the present invention is to address the deficiencies in the prior art, and propose a method for realizing automated testing of Web services, which only needs to write a test case to complete the functional testing of a Web service or a plurality of Web services with cooperative relationships. The steps of manually deploying Web services are eliminated, thereby realizing automation.

为实现上述目的,本发明提出了一种实现Web服务自动化测试的方法,其中执行以下步骤:In order to achieve the above object, the present invention proposes a method for realizing automated testing of Web services, wherein the following steps are performed:

步骤1、执行用户编写的测试用例;Step 1. Execute the test case written by the user;

步骤2、建立系统资源监视模块,监视系统资源的读写;Step 2, establish a system resource monitoring module to monitor the reading and writing of system resources;

步骤3、建立并启动代理服务器,将系统内的所有网络连接都设置为通过代理服务器来中转;Step 3, establish and start a proxy server, and set all network connections in the system to be transferred through the proxy server;

步骤4、JAVA虚拟机根据测试用例中的服务部署代码,来建立虚拟Web服务容器,并在该虚拟Web服务容器中部署服务;Step 4, the JAVA virtual machine establishes a virtual Web service container according to the service deployment code in the test case, and deploys the service in the virtual Web service container;

步骤5、执行测试用例中的测试验证代码,启动一个调用Web服务的客户端,该客户端建立网络连接对服务进行调用,调用请求由代理服务器接收、并传递给虚拟Web服务容器进行处理,然后将Web服务调用的结果返回给该客户端;Step 5, execute the test verification code in the test case, start a client that calls the Web service, the client establishes a network connection to call the service, the call request is received by the proxy server, and passed to the virtual Web service container for processing, and then Return the result of the web service call to the client;

步骤6、执行测试验证代码测试其返回值;Step 6. Execute the test verification code to test its return value;

步骤7、输出测试结果;Step 7, output test results;

步骤8、结束测试。Step 8, end the test.

该方法具有以下优点:This method has the following advantages:

1、Web服务的实现代码不需要修改就可以既运行在真实环境里,也可以运行在虚拟的测试环境里;1. The implementation code of the Web service can run in both the real environment and the virtual test environment without modification;

2、可以将真实环境和虚拟环境组合在一起进行测试,将一部分服务部署在真实环境里,另一部分服务部署在虚拟环境里;2. The real environment and the virtual environment can be combined for testing, and some services are deployed in the real environment, and the other part of the service is deployed in the virtual environment;

3、由于所有的网络连接必须通过网络监控模块,客户端和服务以及服务和服务间传输的SOAP消息都可以被记录下来,以便验证其正确性;3. Since all network connections must pass through the network monitoring module, SOAP messages transmitted between clients and services and between services can be recorded to verify their correctness;

4、可以模拟网络连接中的延时和突然中断,控制传输速率以便测试服务在非正常情况下运行时的功能正确性;4. It can simulate the delay and sudden interruption in the network connection, control the transmission rate so as to test the functional correctness of the service when it is running under abnormal conditions;

5、可以监控系统内所有Web服务的运行情况,比如某一时刻,哪些服务在运行,有多少个实例在运行,服务间调用的时间序列等等;5. It can monitor the running status of all Web services in the system, such as which services are running at a certain moment, how many instances are running, the time series of calls between services, etc.;

6、所有Web服务运行在同一进程里,可以使用传统的软件调试方法来找出引起系统出错的根源,这要比在不同的机器上进行联合调试要容易的多;6. All web services run in the same process, and traditional software debugging methods can be used to find out the root cause of system errors, which is much easier than joint debugging on different machines;

7、Web服务的集成测试只需要使用一台计算机,尽管待测系统最终还是会在真实的环境下测试,但是该方法还是能有效地找出待测系统中存在的问题,大幅度减少真实环境下的测试次数,达到降低测试成本的目的。7. The integration test of Web services only needs to use one computer. Although the system under test will eventually be tested in a real environment, this method can still effectively find out the problems existing in the system under test and greatly reduce the number of problems in the real environment. The lower number of tests can achieve the purpose of reducing the cost of testing.

下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solutions of the present invention will be described in further detail below with reference to the accompanying drawings and embodiments.

附图说明Description of drawings

图1为本发明实现Web服务自动化测试方法的流程图;Fig. 1 is the flowchart of the present invention's realization of Web service automation test method;

图2为本发明实现Web服务自动化测试方法的实施例的流程图;Fig. 2 is the flow chart of the embodiment that realizes Web service automatic testing method in the present invention;

图3为本发明实现Web服务自动化测试方法的实施例中虚拟容器的建立方法的流程图;Fig. 3 is the flow chart of the establishment method of virtual container in the embodiment of the present invention realizes Web service automatic test method;

图4为本发明实现Web服务自动化测试方法的实施例步骤中代理服务器接收和处理方法的流程图;Fig. 4 is the flow chart of proxy server receiving and processing method in the embodiment step that realizes Web service automation testing method of the present invention;

图5为本发明实现Web服务自动化测试方法的实施例中运行服务对象时需要读系统资源的流程图;Fig. 5 is the flow chart that needs to read system resource when running service object in the embodiment of the present invention realizes Web service automation testing method;

图6为本发明实现Web服务自动化测试方法的实施例中运行服务对象时需要写系统资源的流程图。FIG. 6 is a flow chart of writing system resources when running a service object in an embodiment of the method for implementing automated testing of Web services in the present invention.

具体实施方式Detailed ways

本发明提出了一种能够自动化部署、测试服务,并对服务进行有效跟踪的方法。The invention proposes a method capable of automatically deploying and testing services, and effectively tracking the services.

如图1所示,为本发明实现Web服务自动化测试方法的流程图,具体执行以下步骤:As shown in Figure 1, it is a flow chart of realizing the automated testing method of Web services for the present invention, and specifically executes the following steps:

步骤101、执行用户编写的测试用例;Step 101, execute the test case written by the user;

步骤102、建立系统资源监视模块,监视系统资源的读写;Step 102, establishing a system resource monitoring module to monitor the reading and writing of system resources;

步骤103、建立并启动代理服务器,将系统内的所有网络连接都设置为通过代理服务器来中转;Step 103, establishing and starting a proxy server, and setting all network connections in the system to be transferred through the proxy server;

步骤104、JAVA虚拟机根据测试用例中的服务部署代码,来建立虚拟Web服务容器,并在该虚拟Web服务容器中部署服务;Step 104, the JAVA virtual machine establishes a virtual Web service container according to the service deployment code in the test case, and deploys the service in the virtual Web service container;

步骤105、执行测试用例中的测试验证代码,启动一个调用Web服务的客户端,该客户端建立网络连接对服务进行调用,调用请求由代理服务器接收、并传递给虚拟Web服务容器进行处理,然后将Web服务调用的结果返回给该客户端;Step 105, execute the test verification code in the test case, start a client that calls the Web service, the client establishes a network connection to call the service, the call request is received by the proxy server, and passed to the virtual Web service container for processing, and then Return the result of the web service call to the client;

步骤106、执行测试验证代码测试其返回值;Step 106, execute the test verification code to test its return value;

步骤107、输出测试结果;Step 107, output test results;

步骤108、结束测试。Step 108, end the test.

该方法为每个虚拟容器维护一个独立的运行环境和一些资源,使得虚拟容器不互相干扰。This method maintains an independent operating environment and some resources for each virtual container, so that the virtual containers do not interfere with each other.

如图2所示,为本发明实现Web服务自动化测试方法的实施例的流程图,具体执行以下步骤:As shown in Figure 2, it is the flow chart of the embodiment that realizes Web service automatic testing method for the present invention, specifically executes the following steps:

步骤201、执行用户编写的测试用例,该测试用例是一系列为了实现测试目的的代码,具体包括:服务部署代码和测试验证代码,服务部署代码用于指定要建立哪些虚拟容器,以及在其中要部署哪些Web服务,即描述一个Web服务环境,测试验证代码用于建立一个客户端,来对测试环境中部署的服务进行调用,并对其返回值进行验证,验证结果就是整个测试用例的执行结果;Step 201, execute the test case written by the user, the test case is a series of codes for the purpose of testing, specifically including: service deployment code and test verification code, the service deployment code is used to specify which virtual containers to be established, and in which Which Web services are deployed, that is, to describe a Web service environment. The test verification code is used to establish a client to call the services deployed in the test environment and verify its return value. The verification result is the execution result of the entire test case ;

步骤202、建立系统资源监视模块,监视系统资源的读写;Step 202, establishing a system resource monitoring module to monitor the reading and writing of system resources;

步骤203、建立并启动代理服务器,设置系统内的所有网络连接都通过代理服务器来中转,测试过程中所有的TCP网络连接都会通过这个代理服务器来转发,不仅包括客户端与服务间,而且包括服务与服务间的连接;通过此模块可以有效地监控客户端与Web服务、Web服务与Web服务间的SOAP报文的传输情况以及对报文的有效性进行验证;同时在转发过程中,可以控制转发速率,以便测试Web服务在低带宽情况下的运行状况;Step 203, establish and start a proxy server, and set all network connections in the system to be transferred through the proxy server. During the test, all TCP network connections will be forwarded through the proxy server, including not only between the client and the service, but also between the service Connection with the service; this module can effectively monitor the transmission of SOAP messages between the client and Web services, and between Web services and Web services, and verify the validity of the messages; at the same time, during the forwarding process, you can control Forwarding rate, in order to test the operation of web services in low bandwidth situations;

步骤204、JAVA虚拟机根据测试用例中的服务部署代码,来建立虚拟容器,并在其中部署服务,虚拟Web服务容器,也就是虚拟容器,是整个测试系统的核心,它是Web服务的运行环境,在真实环境下,相同的Web服务会在不同的容器里运行,这些服务之间不可能相互干扰,同时Web容器也都会有一些私有的属性和资源,其它的容器是无法读取得;虚拟容器需要来模拟这些真实的情况,做到运行时容器之间互不干扰和服务之间互不干扰,真实的容器独占一个虚拟机,它拥有所有的系统资源,对这些资源的修改不会干扰到其它容器,然而虚拟容器是多个容器共占一个虚拟机,需要将这些资源分配给不同的虚拟容器,并做到对这些资源修改不会改变其它容器的资源状态;Step 204, the JAVA virtual machine creates a virtual container according to the service deployment code in the test case, and deploys the service in it. The virtual Web service container, that is, the virtual container, is the core of the entire test system, and it is the operating environment of the Web service , in a real environment, the same web service will run in different containers, and it is impossible for these services to interfere with each other. At the same time, web containers will also have some private attributes and resources, which cannot be read by other containers; virtual containers It is necessary to simulate these real situations so that the runtime containers do not interfere with each other and the services do not interfere with each other. The real container monopolizes a virtual machine, which owns all system resources, and the modification of these resources will not interfere with the Other containers, however, a virtual container is a virtual machine shared by multiple containers, these resources need to be allocated to different virtual containers, and the modification of these resources will not change the resource status of other containers;

步骤205、执行测试验证代码,启动一个调用Web服务的客户端,该客户端会建立网络连接对服务进行调用,调用请求由所述代理服务器接收、并传递给虚拟Web服务容器处理,然后将结果返回给该客户端;Step 205, execute the test verification code, start a client that calls the Web service, the client will establish a network connection to call the service, the call request is received by the proxy server, and passed to the virtual Web service container for processing, and then the result return to the client;

步骤106、Web服务调用返回后,执行测试验证代码测试其返回值;Step 106, after the Web service call returns, execute the test verification code to test its return value;

步骤207、输出测试结果;Step 207, output test results;

步骤208、结束测试;Step 208, end the test;

其中,如图3所示,为本发明实现Web服务自动化测试方法的实施例步骤204中虚拟容器的具体建立方法的流程图,包括以下步骤:Wherein, as shown in FIG. 3 , it is a flow chart of a specific method for establishing a virtual container in step 204 of the embodiment of the method for realizing the automated testing of Web services in the present invention, including the following steps:

步骤2041、建立一个虚拟容器,为其分配一个唯一的标识;Step 2041, create a virtual container and assign a unique identifier to it;

步骤2042、建立一个线程组,设置其标识为虚拟容器的标识;Step 2042, establish a thread group, and set its identification as the identification of the virtual container;

步骤2043、建立一个属于线程组的线程;Step 2043, create a thread belonging to the thread group;

步骤2044、启动线程,来运行虚拟容器,并初始化属于该虚拟容器的资源。Step 2044, start a thread to run the virtual container, and initialize resources belonging to the virtual container.

如图4所示,为本发明实现Web服务自动化测试方法的实施例步骤205中代理服务器接收和处理方法的流程图,包括以下步骤:As shown in Figure 4, it is a flow chart of the proxy server receiving and processing method in step 205 of the embodiment of the Web service automated testing method of the present invention, including the following steps:

步骤2050、代理服务器接收到调用请求;Step 2050, the proxy server receives the calling request;

步骤2051、代理服务器判断调用是否需要监视,如果是,则执行步骤2052;否则执行步骤2053;Step 2051, the proxy server judges whether the call needs to be monitored, if yes, then execute step 2052; otherwise execute step 2053;

步骤2052、系统资源监视模块开始监视网络传输;Step 2052, the system resource monitoring module starts to monitor network transmission;

步骤2053、代理服务器判断是否有需要访问的虚拟容器,如果是,则执行步骤2054;否则建立新的网络连接将调用请求转发给真实的容器,由真实的容器来处理该请求;Step 2053, the proxy server judges whether there is a virtual container that needs to be accessed, and if yes, then executes step 2054; otherwise, a new network connection is established to forward the call request to the real container, and the real container processes the request;

步骤2054、代理服务器将调用请求交给虚拟容器处理;Step 2054, the proxy server hands over the call request to the virtual container for processing;

步骤2055、虚拟容器判断是否存在调用请求的服务对象,服务对象对应一个Web服务,它用来执行Web服务,如果是,执行步骤2058;否则执行步骤2056;Step 2055, the virtual container judges whether there is a service object for invoking the request, the service object corresponds to a Web service, and it is used to execute the Web service, if yes, execute step 2058; otherwise, execute step 2056;

步骤2056、虚拟容器判断调用请求的服务是否已经部署,如果是,则执行步骤2057;否则生成错误响应,执行步骤2059;Step 2056, the virtual container judges whether the service requested by the call has been deployed, and if so, executes step 2057; otherwise generates an error response, executes step 2059;

步骤2057、虚拟容器创建服务对象;Step 2057, the virtual container creates a service object;

步骤2058、虚拟容器将调用请求交给服务对象处理,运行该服务对象,并生成响应;Step 2058, the virtual container hands the invocation request to the service object for processing, runs the service object, and generates a response;

步骤2059、代理服务器将响应返回给客户端。Step 2059, the proxy server returns a response to the client.

如图5所示,为本发明实现Web服务自动化测试方法的实施例步骤2058中,在运行服务对象的过程中,如果需要读系统资源的流程图,这里的资源在Java体系中指的是系统属性(它有一个名字和一个值)。可以在Java虚拟机里建立系统属性并为其指定值。相同名字的系统属性,虚拟机里只有一份。对于不同的真正Web服务容器,它们运行在各自独立的Java虚拟机里,它们以及在它们里面运行的服务对系统属性的读写不会造成其它容器的系统属性的改变。现在多个虚拟容器运行在同一个Java虚拟机里,通过本发明提供的方法可以让虚拟容器读写各自系统资源,做到互不干扰,具体执行以下步骤:As shown in Figure 5, in step 2058 of the embodiment of the Web service automated testing method for the present invention, in the process of running the service object, if it is necessary to read the flow chart of the system resource, the resource here refers to the system attribute in the Java system (it has a name and a value). You can create system properties and assign values to them in the Java virtual machine. There is only one copy of the system property with the same name in the virtual machine. For different real Web service containers, they run in their own independent Java virtual machines, and the reading and writing of system properties by them and the services running in them will not cause changes to the system properties of other containers. Now a plurality of virtual containers run in the same Java virtual machine, the method provided by the present invention can allow the virtual containers to read and write their own system resources, so as not to interfere with each other, specifically perform the following steps:

步骤20581、系统资源监视模块监视到资源的读取,获取当前线程的所属线程组,根据其标识查找对应的虚拟容器;Step 20581, the system resource monitoring module monitors the reading of resources, obtains the thread group to which the current thread belongs, and searches for the corresponding virtual container according to its identifier;

步骤20582、系统资源监视模块判断是否存在该虚拟容器,如果是,执行步骤20583;否则执行步骤20584;Step 20582, the system resource monitoring module judges whether the virtual container exists, if yes, execute step 20583; otherwise execute step 20584;

步骤20583、系统资源监视模块判断虚拟容器是否存在该资源,如果是,执行步骤20585;否则执行步骤20584;Step 20583, the system resource monitoring module judges whether the resource exists in the virtual container, if yes, execute step 20585; otherwise execute step 20584;

步骤20584、系统资源监视模块判断Java虚拟机是否存在该资源,如果是,执行步骤20585;否则返回空值;Step 20584, the system resource monitoring module judges whether the resource exists in the Java virtual machine, if yes, execute step 20585; otherwise, return a null value;

步骤20585、系统资源监视模块返回资源的值。Step 20585, the system resource monitoring module returns the resource value.

如图6所示,为本发明实现Web服务自动化测试方法的实施例步骤2058中,在运行服务对象的过程中,如果需要写系统资源的流程图,具体执行以下步骤:As shown in Figure 6, in step 2058 of the embodiment of the Web service automation testing method for the present invention, in the process of running the service object, if it is necessary to write a flow chart of system resources, the following steps are specifically performed:

步骤20581’、系统资源监视模块监视到资源的写入,获取当前线程的所属线程组,根据其标识查找对应的虚拟容器;Step 20581', the system resource monitoring module monitors the writing of resources, obtains the thread group to which the current thread belongs, and searches for the corresponding virtual container according to its identification;

步骤20582’、系统资源监视模块判断是否存在该虚拟容器,如果是,执行步骤20583’;否则执行步骤20584’;Step 20582', the system resource monitoring module judges whether the virtual container exists, if yes, execute step 20583'; otherwise execute step 20584';

步骤20583’、系统资源监视模块判断所述虚拟容器是否存在该资源,如果是,执行步骤20587’;否则执行步骤20585’;Step 20583', the system resource monitoring module judges whether the resource exists in the virtual container, if yes, execute step 20587'; otherwise execute step 20585';

步骤20584’、系统资源监视模块判断Java虚拟机是否存在该资源,如果是,执行步骤20587’;否则执行步骤20586’;Step 20584', the system resource monitoring module judges whether the resource exists in the Java virtual machine, if yes, execute step 20587'; otherwise execute step 20586';

步骤20585’、在虚拟容器里新建该资源,执行步骤20587’;Step 20585', create a new resource in the virtual container, and execute step 20587';

步骤20586’、在Java虚拟机里新建该资源,执行步骤20587’;Step 20586', create this resource in the Java virtual machine, and execute step 20587';

步骤20587’、写入该资源的值。Step 20587', write the value of the resource.

最后所应说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或者等同替换,而不脱离本发明技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention without limitation. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be The scheme shall be modified or equivalently replaced without departing from the spirit and scope of the technical scheme of the present invention.

Claims (6)

1, a kind of method that realizes the Web service automatic test, wherein carry out following steps:
The test case that step 1, execution user write;
Step 2, set up the system resource monitor module, the read-write of surveillance resource;
Step 3, foundation also start acting server, intrasystem all-network are connected all be set to come transfer by acting server;
Step 4, JAVA virtual machine are set up the virtual web service container according to the service arrangement code in the described test case, and in this virtual web service container deployment services;
Testing authentication code in step 5, the described test case of execution, start the client of a called Web service, this client is set up the network connection service is called, call request is received and is passed to the virtual web service container by described acting server and handles, and the result that Web service is called returns to this client then;
Step 6, described its return value of testing authentication code tester of execution;
Step 7, output test result;
Step 8, end test.
2, the method for realization Web service automatic test according to claim 1, the test case in the wherein said step 1 are a series of in order to realize the code of test purpose, specifically comprise: service arrangement code and testing authentication code.
3, the method for realization Web service automatic test according to claim 1 and 2, the process of specifically setting up of virtual container described in the step 4 wherein may further comprise the steps:
Step 41, setting up a virtual container, is that it distributes a unique sign;
Step 42, set up a sets of threads, the sign that it is designated described virtual container is set;
Step 43, set up a thread that belongs to described sets of threads;
Step 44, start described thread, move described virtual container, and initialization belongs to the resource of this virtual container.
4, the method for realization Web service automatic test according to claim 1 and 2, wherein the idiographic flow of reception of acting server described in the step 5 and processing is:
Step 50, described acting server receive described call request;
Step 51, acting server judge whether described calling needs to monitor, if then execution in step 52; Otherwise execution in step 53;
Step 52, described system resource monitor module begin the monitoring network transmission;
Step 53, acting server need to judge whether the virtual container of visit, if then execution in step 54; Otherwise set up new network connection described call request is transmitted to real container, handle this request by real container;
Step 54, described acting server are given described virtual container with described call request and are handled;
Step 55, described virtual container judge whether to exist the service object of described call request, if, execution in step 58; Otherwise execution in step 56;
Step 56, described virtual container judge whether the service of described call request is disposed, if then execution in step 57; Otherwise the generation error response, execution in step 59;
Step 57, described virtual container are created described service object;
Step 58, described virtual container are given the service object with described call request and are handled, and move this service object, and generate response;
Step 59, described acting server return to described client with described response.
5, the method for realization Web service automatic test according to claim 4, in wherein said 58, in the described service object's of operation process, read apparatus resource if desired, then carry out following steps:
Step 581, system resource monitor module monitor reading of resource, obtain the affiliated sets of threads of current thread, search the corresponding virtual container according to its sign;
Step 582, system resource monitor module judge whether to exist described virtual container, if, execution in step 583; Otherwise execution in step 584;
Step 583, system resource monitor module judge whether described virtual container exists described resource, if, execution in step 585; Otherwise execution in step 584;
Step 584, system resource monitor module judge whether described Java Virtual Machine exists described resource, if, execution in step 585; Otherwise return null value;
Step 585, system resource monitor module return the value of described resource.
6, the method for realization Web service automatic test according to claim 4, in wherein said 58, in the described service object's of operation process, one-writing system resource if desired, then carry out following steps:
Step 581 ', the system resource monitor module monitors writing of resource, obtains the affiliated sets of threads of current thread, searches the corresponding virtual container according to its sign;
Step 582 ', the system resource monitor module judges whether to exist described virtual container, if, execution in step 583 '; Otherwise execution in step 584 ';
Step 583 ', the system resource monitor module judges whether described virtual container exists described resource, if, execution in step 587 '; Otherwise execution in step 585 ';
Step 584 ', the system resource monitor module judges whether described Java Virtual Machine exists described resource, if, execution in step 587 '; Otherwise execution in step 586 ';
Step 585 ', in virtual container newly-built described resource, execution in step 587 ';
Step 586 ', in Java Virtual Machine newly-built described resource, execution in step 587 ';
Step 587 ', write the value of described resource.
CNB2005101325321A 2005-12-26 2005-12-26 Method for realizing Web service automatic test Expired - Fee Related CN100353714C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005101325321A CN100353714C (en) 2005-12-26 2005-12-26 Method for realizing Web service automatic test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005101325321A CN100353714C (en) 2005-12-26 2005-12-26 Method for realizing Web service automatic test

Publications (2)

Publication Number Publication Date
CN1791037A true CN1791037A (en) 2006-06-21
CN100353714C CN100353714C (en) 2007-12-05

Family

ID=36788561

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005101325321A Expired - Fee Related CN100353714C (en) 2005-12-26 2005-12-26 Method for realizing Web service automatic test

Country Status (1)

Country Link
CN (1) CN100353714C (en)

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101241467B (en) * 2008-03-05 2010-06-23 罗笑南 Automatized white box test system and method facing to WEB application
CN101902470A (en) * 2010-07-14 2010-12-01 南京大学 A Dynamic Detection Method of Web Security Vulnerabilities Based on Form Features
CN101551756B (en) * 2009-03-31 2012-02-15 成都市华为赛门铁克科技有限公司 The virtual method and virtual device based on operating system layer
CN101562551B (en) * 2009-05-05 2012-02-22 候万春 System and method for providing picture identification service or video identification service
CN102377733A (en) * 2010-08-12 2012-03-14 盛科网络(苏州)有限公司 Automatic testing system of application layer protocol and automatic testing method thereof
CN101695070B (en) * 2009-09-30 2012-07-04 北京航空航天大学 Method and system for service encapsulation of Java legacy system
CN103001815A (en) * 2011-09-13 2013-03-27 阿里巴巴集团控股有限公司 Method, device and system for acquiring test data
CN103309800A (en) * 2012-03-15 2013-09-18 腾讯科技(深圳)有限公司 Automatic webpage testing method and system
CN103425929A (en) * 2012-05-22 2013-12-04 百度在线网络技术(北京)有限公司 Web white box scanning method and device
CN103885873A (en) * 2012-12-20 2014-06-25 上海明想电子科技有限公司 Automated integration testing method
CN104009880A (en) * 2013-02-27 2014-08-27 阿里巴巴集团控股有限公司 Web testing method, proxy server and Web testing device
CN101719069B (en) * 2010-01-04 2014-09-03 北京航空航天大学 Method and device of Web servitization of Java system
CN104111852A (en) * 2014-07-18 2014-10-22 南京富士通南大软件技术有限公司 Web application automated testing system and testing method based on data drive
CN104699612A (en) * 2015-03-25 2015-06-10 北京嘀嘀无限科技发展有限公司 Processing method, equipment and system used in software testing
CN104852823A (en) * 2014-02-18 2015-08-19 腾讯科技(深圳)有限公司 Process monitoring method, device and system
CN104866422A (en) * 2015-05-20 2015-08-26 中国互联网络信息中心 Web Service automatic test system and method
CN105187443A (en) * 2015-09-28 2015-12-23 上海斐讯数据通信技术有限公司 System and method for testing WEB verification code
CN105743724A (en) * 2014-12-10 2016-07-06 深圳中兴网信科技有限公司 Method and device for testing services
CN107894762A (en) * 2017-11-09 2018-04-10 重庆鲁班机器人技术研究院有限公司 Practicality imitation test method, apparatus and system
CN109062798A (en) * 2018-07-26 2018-12-21 浙江数链科技有限公司 A kind of test method and device based on Dubbo frame
CN110493074A (en) * 2019-07-19 2019-11-22 珠海金山网络游戏科技有限公司 A kind of test method and system of server and client
CN112817699A (en) * 2021-02-23 2021-05-18 汇链通供应链科技(上海)有限公司 Batch deployment automation performance testing method and terminal device
CN114443311A (en) * 2022-04-07 2022-05-06 北京天维信通科技有限公司 Third-party service configuration method and device and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040064528A1 (en) * 2002-09-30 2004-04-01 Microsoft Corporation Safe interoperability among web services
CN1588857A (en) * 2004-09-28 2005-03-02 中国电子产品可靠性与环境试验研究所 Integrated circuit remote detecting system and its detecting method

Cited By (36)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101241467B (en) * 2008-03-05 2010-06-23 罗笑南 Automatized white box test system and method facing to WEB application
CN101551756B (en) * 2009-03-31 2012-02-15 成都市华为赛门铁克科技有限公司 The virtual method and virtual device based on operating system layer
CN101562551B (en) * 2009-05-05 2012-02-22 候万春 System and method for providing picture identification service or video identification service
CN101695070B (en) * 2009-09-30 2012-07-04 北京航空航天大学 Method and system for service encapsulation of Java legacy system
CN101719069B (en) * 2010-01-04 2014-09-03 北京航空航天大学 Method and device of Web servitization of Java system
CN101902470A (en) * 2010-07-14 2010-12-01 南京大学 A Dynamic Detection Method of Web Security Vulnerabilities Based on Form Features
CN101902470B (en) * 2010-07-14 2013-08-21 南京大学 Form feature-based Web security vulnerability dynamic testing method
CN102377733A (en) * 2010-08-12 2012-03-14 盛科网络(苏州)有限公司 Automatic testing system of application layer protocol and automatic testing method thereof
CN103001815A (en) * 2011-09-13 2013-03-27 阿里巴巴集团控股有限公司 Method, device and system for acquiring test data
CN103001815B (en) * 2011-09-13 2016-05-04 阿里巴巴集团控股有限公司 The acquisition methods of test data, Apparatus and system
CN103309800A (en) * 2012-03-15 2013-09-18 腾讯科技(深圳)有限公司 Automatic webpage testing method and system
CN103309800B (en) * 2012-03-15 2016-04-13 腾讯科技(深圳)有限公司 A kind of webpage automated testing method and system
CN103425929A (en) * 2012-05-22 2013-12-04 百度在线网络技术(北京)有限公司 Web white box scanning method and device
CN103425929B (en) * 2012-05-22 2016-05-25 百度在线网络技术(北京)有限公司 The white box scan method of web and device
CN103885873A (en) * 2012-12-20 2014-06-25 上海明想电子科技有限公司 Automated integration testing method
CN104009880B (en) * 2013-02-27 2018-04-17 阿里巴巴集团控股有限公司 Web test methods, proxy server and Web test devices
CN104009880A (en) * 2013-02-27 2014-08-27 阿里巴巴集团控股有限公司 Web testing method, proxy server and Web testing device
CN104852823A (en) * 2014-02-18 2015-08-19 腾讯科技(深圳)有限公司 Process monitoring method, device and system
WO2015124073A1 (en) * 2014-02-18 2015-08-27 Tencent Technology (Shenzhen) Company Limited Process monitoring method, apparatus, and system
CN104852823B (en) * 2014-02-18 2019-04-12 腾讯科技(深圳)有限公司 Monitoring method, the device and system of process
CN104111852A (en) * 2014-07-18 2014-10-22 南京富士通南大软件技术有限公司 Web application automated testing system and testing method based on data drive
CN105743724A (en) * 2014-12-10 2016-07-06 深圳中兴网信科技有限公司 Method and device for testing services
CN104699612A (en) * 2015-03-25 2015-06-10 北京嘀嘀无限科技发展有限公司 Processing method, equipment and system used in software testing
CN104699612B (en) * 2015-03-25 2019-05-31 北京嘀嘀无限科技发展有限公司 For processing method, equipment and the system in software test
CN104866422A (en) * 2015-05-20 2015-08-26 中国互联网络信息中心 Web Service automatic test system and method
CN105187443A (en) * 2015-09-28 2015-12-23 上海斐讯数据通信技术有限公司 System and method for testing WEB verification code
CN105187443B (en) * 2015-09-28 2018-03-06 上海斐讯数据通信技术有限公司 A kind of system and method for test WEB identifying codes
CN107894762B (en) * 2017-11-09 2018-08-28 重庆鲁班机器人技术研究院有限公司 Matter emulation tests system
CN107894762A (en) * 2017-11-09 2018-04-10 重庆鲁班机器人技术研究院有限公司 Practicality imitation test method, apparatus and system
CN109062798A (en) * 2018-07-26 2018-12-21 浙江数链科技有限公司 A kind of test method and device based on Dubbo frame
CN110493074A (en) * 2019-07-19 2019-11-22 珠海金山网络游戏科技有限公司 A kind of test method and system of server and client
CN110493074B (en) * 2019-07-19 2021-02-02 珠海金山网络游戏科技有限公司 Method and system for testing server and client
CN112817699A (en) * 2021-02-23 2021-05-18 汇链通供应链科技(上海)有限公司 Batch deployment automation performance testing method and terminal device
CN112817699B (en) * 2021-02-23 2023-07-18 汇链通产业供应链数字科技(厦门)有限公司 An automated performance testing method and terminal device for batch deployment
CN114443311A (en) * 2022-04-07 2022-05-06 北京天维信通科技有限公司 Third-party service configuration method and device and electronic equipment
CN114443311B (en) * 2022-04-07 2022-08-05 北京天维信通科技有限公司 Third-party service configuration method and device and electronic equipment

Also Published As

Publication number Publication date
CN100353714C (en) 2007-12-05

Similar Documents

Publication Publication Date Title
CN1791037A (en) Method for realizing Web service automatic test
US6961937B2 (en) Registry service for use in a distributed processing framework system and methods for implementing the same
CN1142491C (en) Framework system and method for testing server performance
US7114159B2 (en) Processing resource for use in a distributed processing framework system and methods for implementing the same
CN112424746B (en) In-situ triggered functions as a service within a service mesh
US7020699B2 (en) Test result analyzer in a distributed processing framework system and methods for implementing the same
US7426729B2 (en) Distributed processing framework system
US6654699B2 (en) Computer network testing system and method using client playback of edited network information
CN103024022B (en) A kind of managing and control system of virtual machine application service and method
CN1858790A (en) Method and system for managing automated resource provisioning with a workload shceduler
US20090113437A1 (en) Translating declarative models
US20030208528A1 (en) Remote execution model for distributed application launch and control
US20030120776A1 (en) System controller for use in a distributed processing framework system and methods for implementing the same
EP2622484A1 (en) Debugger launch and attach on compute clusters
CN1511283A (en) Methods and bridges for connecting servers and clients of different object types
CN1741471A (en) Method and system for analyzing network transmission events
CN114880159B (en) Data processing method, device, equipment and storage medium
CN1992635A (en) Method for Simulating SNMP Network Element and Using the Network Element to Test Network Management System
CN102902620A (en) GDB (genome database) based heterogeneous computing and debugging environment realizing system
CN112860398A (en) Data processing method, device, equipment and medium based on rule engine
CN101035093A (en) Method and system for processing message
CN1805381A (en) Multi-network element emulation test system and implementation method
US7881336B2 (en) HTB gateway for healthcare transaction base
CN1653423A (en) Exchange infrastructure systems and methods
CN1858719A (en) Method for realizing automatic test and its system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20071205

Termination date: 20121226