使用IBM Rational工具开始单元和组件测试

在你开始前

关于本教程

本教程涵盖了通过HelloWorld示例对Java代码,Web服务,Servlet,SCA和EJB bean进行单元和组件测试(开发HelloWorld程序被认为是学习新概念的最简单方法)。 在这里,您可以使用JUnit和Jakarta Cactus测试框架执行单元和组件测试。

目标

完成本教程后,您应该了解如何执行单元和组件测试,以及如何使用IBM Rational Application Developer,IBM Rational Software Developer或IBM WebSphere Integration Developer使用Apache Ant自动化这些测试。

先决条件

要继续学习本教程,您应该具有要测试的技术的基本知识,无论它是SCA,Servlet,EJB Bean,Web服务还是Java代码。 您还应该对系统要求部分中列出的产品具有基本的技术经验。

系统要求

在本教程中,您可以使用以下任何工具来测试Java代码,Web服务,Servlet和EJB Bean:

  • Rational Software Architect V6.0
  • Rational Application Developer V6.0

要执行SCA测试以及Java,Web服务,servlet和EJB测试,您需要WebSphere Integration Developer V6.0.1或6.0.2。

运行组件测试需要IBM Rational Agent Controller,它是Rational Software Architect捆绑包中的一个附加组件。

在任何软件开发项目中,测试都是至关重要的。 它模拟了几种执行路径,以交付无缺陷且经过良好测试的产品,从而确保其健壮性和高质量给客户。 忽略软件测试(由于交货日期紧迫,计划依赖发布修复程序或其他原因),增加了修复以后出现的错误的成本。 这是因为随着软件开发周期的继续,错误修复成本急剧增加。

在软件开发周期内执行四种主要的测试类型或阶段,如图1所示:

  1. 单元测试是白盒测试,用于测试基本代码单元,包括Java类,Web服务,EJB Bean和Servlet。
  2. 组件测试会测试基本代码单元的集成,以在将某些基本功能集成到生产代码库中之前执行某些功能。
  3. 系统测试将测试整个系统,并确保将一组组件集成在一起。
  4. 验收测试测试软件产品是否满足客户的功能和非功能要求。
图1.软件测试
软件测试

注意金字塔状的结构,它强调了测试顺序的重要性。 例如,在对每个代码单元执行单元测试之后,您将执行组件测试以确保这些代码单元的集成的有效性。

JUnit是由Erich Gamma和Kent Beck编写的Java回归测试框架。 如Apache网站上所述, Cactus是一个简单的测试框架,用于对服务器端Java代码(例如servlet,EJB Bean,标记库和过滤器)进行单元测试。 扩展JUnit的Cactus旨在降低编写服务器端代码的测试成本,并且实现了容器内策略,这意味着测试在容器服务器内部执行(请参阅参考资料 ,以获取更多信息的链接)关于仙人掌)。 在本教程中,您将使用JUnit和Cactus测试框架来演示单元和组件测试。 本教程末尾的“ 下载”部分提供了本教程中说明的所有测试。

准备测试环境

本节介绍了本教程中所需的环境准备工作。

启用功能

如果您使用的是Rational Software Architect,Rational Application Developer或WebSphere Integration Developer,则需要启用Web服务开发和测试功能:

  1. 选择窗口>首选项>工作台>功能
  2. 选中右窗格中的Web Service Developer ,如图2所示。
图2.启用功能
启用功能

JUnit测试准备

使用JUnit框架进行测试的项目必须在其类路径中包含junit.jar,该路径位于<IDE_HOME> \ eclipse \ plugins \ org.junit_3.8.1 \ junit.jar中。 <IDE_HOME>是Rational Application Developer,Rational Software Developer或WebSphere Integration Developer的安装目录。 例如,如果您使用的是WebSphere Integration Developer,并且其安装目录位于C:\ Program Files \ IBM \ WebSphere \ 601,则junit.jar应该位于C:\ Program Files \ IBM \ WebSphere \ 601 \ eclipse \ plugins \ org.junit_3.8.1。 要将junit.jar添加到项目类路径:

  1. 右键单击项目,然后选择属性
  2. 从左窗格中选择“ Java构建路径 ”。
  3. 转到“ 库”选项卡,然后单击“ 添加外部JAR”
  4. 浏览至junit.jar ,如图3所示。
图3.将junit.jar添加到类路径
将junit.jar添加到类路径

仙人掌测试准备

要将Cactus框架用于动态Web项目中的服务器端单元测试,必须遵循以下步骤:

  1. 将以下.jar文件添加到WebContent \ WEB-INF \ lib:
    • Aspectjrt-1.2.1.jar
    • 仙人掌1.7.2.jar
    • commons-httpclient-2.0.2.jar
    • commons-logging-1.0.4.jar
    • junit.jar

    注意: Cactus扩展了JUnit,因此必须包含junit.jar。 (可从“ 下载”部分或从apache.org获得Cactus .jar文件。)

现在,您需要添加对于在服务器端调用测试方法至关重要的Cactus servlet(通过ServletTestRedirector servlet),并添加运行测试所必需的servlet(通过ServletTestRunner servlet)。 要添加servlet:

  1. 打开动态Web项目的web.xml文件。
  2. 单击Source选项卡,并添加以下两个servlet,如清单1所示:
    • Servlet名称ServletRedirectorServlet类org.apache.cactus.server.ServletTestRedirector
    • Servlet名称ServletTestRunnerServlet类org.apache.cactus.server.runner.ServletTestRunner
    清单1.添加仙人掌小服务程序
    <servlet>
      <servlet-name>ServletRedirector</servlet-name>
      <servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
    </servlet>
    <servlet>
      <servlet-name>ServletTestRunner</servlet-name>
      <servlet-class>org.apache.cactus.server.runner.ServletTestRunner</servlet-class>
    </servlet>
    
    <servlet-mapping>
      <servlet-name>ServletRedirector</servlet-name>
      <url-pattern>/ServletRedirector</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
      <servlet-name>ServletTestRunner</servlet-name>
      <url-pattern>/ServletTestRunner</url-pattern>
    </servlet-mapping>
  3. 要使用Ant自动化Cactus测试用例并运行Cactus Ant任务, 在WebContent \ WEB-INF \ lib下添加cactus-ant-1.7.2.jarcargo-0.5.jar 。 (这些.jar文件可在“ 下载”部分或apache.org中找到。)

单元测试

本节涵盖以下类型的单元测试:

  • 使用JUnit框架进行Java和Web服务单元测试
  • 使用Cactus框架的Servlet和EJB单元测试

Java单元测试

创建一个受测的Java类

以下步骤显示了要测试的Java类:

  1. 导入HelloWorldJava.zip (可在“ 下载”部分中获得)作为项目交换,或创建一个名为HelloWorldJava的Java项目。
  2. com.ibm.tdc包下创建一个名为HelloWorld的类。
  3. 将清单2中的代码粘贴到HelloWorld类中。
    清单2. HelloWorld Java代码
    package com.ibm.tdc;
    public class HelloWorld {
       public String getGreeting (String name)
       {
          return "Hello! "+name;
       }
    }
创建一个JUnit测试用例

测试用例是针对特定目标开发的一组测试输入,执行条件和预期结果。 要为某个Java类创建JUnit测试用例,请遵循以下步骤:

  1. 切换到Java透视图。
  2. 右键单击HelloWorld.java ,然后选择新建> JUnit测试用例
  3. 出现一个消息框,用于将junit.jar添加到构建路径,如图4所示。
    图4.添加junit.jar
    添加junit.jar
  4. 单击
  5. 单击JUnit测试用例 ,然后将出现“测试方法”对话框,其中所选的选项与将要生成的Java代码之间存在映射。 这来自New JUnit Test Case向导,如图5所示。
    图5. New JUnit Test Case向导
    新的JUnit测试用例向导
  6. 在生成的代码中,您可以编辑用于逻辑测试的测试方法,如清单3所示。
    清单3. HelloWorld单元测试
    package com.ibm.tdc;
    import junit.framework.TestCase;
    public class HelloWorldTest extends TestCase 
    {
       private HelloWorld helloWorld;
       public static void main(String[] args) 
       {
          // TestRunner is used to execute test cases
          // textui is used to run test cases in text mode 
    	  junit.textui.TestRunner.run(HelloWorldTest.class);
       }
    
       /*
        * @see TestCase#setUp(), It is executed before each test method
        */
       protected void setUp() throws Exception 
       {
          super.setUp();
          helloWorld = new HelloWorld();
       }
    
       /*
        * Tests the getGreeting method
        */
       public void testGetGreeting() 
       {
          // The assertion succeeds if the left argument equals to the right argument
          assertEquals("Hello! Rose", helloWorld.getGreeting("Rose"));
       }
    }

    在清单3中,请注意以下几点:

    • public static void main(String[] args)是可选的,但用于从命令行运行JUnit测试用例。
    • TestRunner用于执行测试用例。
    • textui用于在文本模式下运行测试用例,因此测试结果显示在控制台中。
    • setUp()TestCase类的方法之一。 它在每个测试方法之前执行,而tearDown()在每个测试方法之后执行。 setUp()tearDown()都是可选方法。 在清单3中, setUp()用于创建被测类的新实例。
    • testGetGreeting()测试getGreeting()方法。 JUnit命名约定规定测试方法必须具有前缀test且不带参数,也就是说,它应遵循此签名public void testXXX() [throws ...]因为JUnit TestRunner使用反射来自动运行测试方法。 一个测试用例中必须至少有一种测试方法,否则运行JUnit测试用例会导致失败。
    • assertEquals()用于比较测试结果和期望值。 如果预期结果与实际结果相等,则断言成功,否则,则断言失败。 JUnit提供了不同版本的断言以支持各种输出检查。 (请参阅相关信息的链接,有关断言类的更多信息。)
  7. 图6的序列图中说明了JUnit测试用例的执行。
    图6. JUnit行为
    JUnit行为
运行JUnit测试用例

您可以使用以下两种方法之一运行JUnit测试用例:

  • 右键单击HelloWorldTest ,然后选择运行> JUnit测试 。 出现绿色条,如图7所示,指示测试用例成功。 (红色条表示测试用例失败或错误。)
    图7.运行JUnit测试用例
    运行JUnit测试用例

    发生故障的原因可能是:
    • 断言语句失败。
    • 出现消息fail(String message) ,该fail(String message)用于使测试失败,并且可以放置在catch块内。
    • 在测试用例类中未定义任何测试方法。
    由于以下原因,可能会发生错误:
    • 尚未测试且未预期的异常,例如,未捕获的异常,例如NullPointerException
  • 运行JUnit测试用例的另一种方法是右键单击HelloWorldTest并选择Run> Java Application ,它将测试用例作为Java应用程序运行。 请注意,对于textui ,测试结果将显示在控制台上。
    图8.将测试用例作为Java应用程序运行
    作为Java应用程序运行测试用例
创建一个测试套件

一个测试套件用于在一个套件中收集多个测试用例。 因此,只需单击一下即可运行许多测试用例。

  1. 右键单击测试用例的软件包com.ibm.tdc ,然后选择New> Other> Java> JUnit> JUnit Test Suite
  2. 单击下一步
  3. 选择要包括在测试套件中的测试用例,如图9所示,然后单击Finish
    图9.创建新的测试套件
    创建新的测试套件

以下代码是自动生成的:

清单4. AllTests测试套件
package com.ibm.tdc;
import junit.framework.Test;
import junit.framework.TestSuite;
public class AllTests 
{
  public static void main(String[] args)
  {
     junit.textui.TestRunner.run(AllTests.suite());
  }
  public static Test suite() 
  {
     TestSuite suite = new TestSuite("Test for com.ibm.tdc");
     //$JUnit-BEGIN$
     suite.addTestSuite(HelloWorldTest.class);
     //$JUnit-END$
     return suite;
  }
}

在这种情况下, addTestSuite()用于添加测试用例类。

运行测试套件与运行JUnit测试用例完全相同。 请注意, TestRunner寻找public static Test suite()来运行测试套件。

Web服务单元测试

您可以通过从Web服务生成代理来使用JUnit测试Web服务。 针对代理运行JUnit测试用例,该代理在后台调用Web服务。 成功测试代理意味着成功测试Web服务。

创建测试中的Web服务

要创建受测试的Web服务,请将HelloWebService.zip (在“ 下载”部分中提供)导入为项目交换。 该Web服务只有一个操作getGreeting() ,它用作先前测试过的Java项目中的HelloWorld类。 清单5显示了Web服务实现。

清单5. Web服务实现
package com.yourco.www;
public class HelloPortBindingImpl implements HelloPortType
{
   public String getGreeting(java.lang.String name) throws java.rmi.RemoteException 
   {
        return "Hello! "+name;
   }
}
创建一个Web服务测试

以下步骤将引导您创建一个包含Web服务客户端类和Web服务单元测试类的Java项目:

  1. 创建一个名为HelloWebServiceTest的Java项目,以表示Web服务测试项目。
  2. 要生成Web服务客户端(即代理类),请在HelloWebServiceTest Java项目下创建一个名为wsdl的文件夹。
  3. HelloService.wsdl文件(从HelloWebService项目检索)粘贴到wsdl文件夹中。
  4. 右键单击HelloService.wsdl ,然后选择Web Services> Generate Client ,如图10所示。
    图10. Web服务单元测试
    Web服务单元测试
  5. 在“ Web服务客户端”向导中,遵循向导中的默认值,然后单击“ 完成” 。 请注意,在“客户端环境配置”对话框中,必须将Web服务运行时间指示为IBM WebSphere (请参见图11)。
    图11.客户端环境配置
    客户端环境配置
  6. 右键单击HelloPortTypeProxy.java ,然后选择“ 新建”>“ JUnit测试用例” 。 可以将其作为任何Java类进行测试(请参阅创建JUnit测试用例部分)。 请注意,HelloPortTypeProxy包含Web服务操作。
  7. getGreeting()是您测试的方法。 您可以使用清单6中所示的代码来完成测试用例类。
    清单6. Web服务单元测试
    package com.yourco.www;
    import java.rmi.RemoteException;
    import junit.framework.TestCase;
    
    public class HelloPortTypeProxyTest extends TestCase 
    {
      private HelloPortTypeProxy helloPortTypeProxy;
      public static void main(String[] args) 
      {
         junit.textui.TestRunner.run(HelloPortTypeProxyTest.class);
      }
      
      protected void setUp() throws Exception 
      {
         super.setUp();
         helloPortTypeProxy = new HelloPortTypeProxy();
      }
      
      public void testGetGreeting() throws RemoteException 
      {
    	 String greeting = null;
         greeting = helloPortTypeProxy.getGreeting("Rosa");
         assertEquals("Hello! Rosa", greeting);			
      }
    }

注意: testGetGreeting()引发RemoteException因为getGreeting()引发此异常。

运行Web服务测试

执行以下步骤之一来运行Web服务测试以及不同的失败和错误情形:

  • 请参阅“ 运行JUnit测试用例”部分以运行测试用例。 根据清单6中的testGetGreeting()代码,如果HelloWebService关闭(例如,未部署在服务器上),则JUnit框架将捕获远程异常,并生成带有该异常的完整堆栈跟踪的错误-这对于调试非常有用—如图12所示。
    图12. Web服务关闭错误
    Web服务关闭错误

    请注意,在这种情况下,该错误强调了一个无法预料的问题,该问题表明发生了未捕获的异常(远程异常)。

  • 另一种方法是捕获RemoteException ,如清单7所示。
    清单7. Web服务单元测试
    public void testGetGreeting() 
    {
       String greeting = null;
       try {
         greeting = helloPortTypeProxy.getGreeting("Rosa");
         assertEquals("Hello! Rosa", greeting);
       } catch (RemoteException e) {
         fail("Remote Exception Occurred...");
       }
    }

在清单7中,可以预见到RemoteException调用,并且使用fail()不会生成完整的堆栈跟踪,包括引发异常的方法。 但它确实会生成随附的消息。

如果HelloWebService关闭,则执行fail()并发生故障,如图13所示。

图13. Web服务关闭
Web服务中断

请注意,失败强调发生了预期的问题。

Servlet单元测试

本节探讨HelloWorld servlet单元测试。 您使用Cactus测试框架,该框架扩展了JUnit测试框架以执行容器内测试。

创建一个被测试的servlet

以下步骤将引导您创建一个简单的servlet并进行测试。

  1. 导入HelloWorld.zip (在“ 下载”部分中可用)作为项目交换。 或创建一个名为HelloWorld的动态Web项目,并创建一个名为HelloWorldServlet的servlet。
  2. 将清单8中的代码粘贴到HelloWorldServlet中,该代码如下:
    • 从请求参数获取名称。
    • 设置会话问候。
    • 将问候语写到响应中。
    清单8. HelloWorldServlet
    package com.ibm.tdc;
    import java.io.IOException;
    import java.io.PrintWriter;
    
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    public class HelloWorldServlet extends HttpServlet
    {
       public void doGet(HttpServletRequest request, HttpServletResponse response)
       throws IOException
       {
          PrintWriter pw = response.getWriter();
          response.setContentType("text/html");
          getGreeting(request);
          pw.print("<html><head/><body><h1>" + 
          request.getSession().getAttribute("greeting") + "</h1></body></html>");
       }
    
       public String getGreeting(HttpServletRequest request)
       {
          String name = request.getParameter("name");
          request.getSession().setAttribute("greeting", "Hello "+name+"!");
          return name;
       }
    }

如果您通过编写http://localhost:9080/HelloWorld/HelloWorldServlet?name=rosa在浏览器上测试了该servlet,则结果应如图14所示。

图14.运行servlet
运行servlet
创建一个servlet测试

请按照以下步骤创建HelloWorldServletTest类,该类扩展了Cactus ServletTestCase类,并允许您测试HelloWorldServlet

  1. 执行仙人掌测试准备部分中提到的步骤。
  2. 切换到Java透视图。
  3. 右键单击HelloWorldServlet.java ,然后选择新建>其他> Java> JUnit> JUnit测试用例
  4. 在“ JUnit测试用例”对话框中,选择org.apache.cactus.ServletTestCase作为超类,然后单击“ 下一步”
  5. 选择getGreeting方法,然后单击Finish ,如图15所示。
    图15.选择要测试的方法
    选择要测试的方法
  6. 使用beginGetGreeting在客户端设置请求name参数,如清单9所示。
    清单9. beginGetGreeting
    public void beginGetGreeting(WebRequest webRequest)
    {
       webRequest.addParameter("name", "Rose");
    }

    请注意,将发生以下操作:
    • beginXXX()在客户端执行,而在服务器端执行testXXX()
    • endXXX()在客户端的测试结束时执行。
    • setUp()tearDown()分别在服务器端testXXX()之前和之后testXXX()
    • WebRequest包含仙人掌测试用例的HTTP请求数据。
  7. 将清单10中所示的代码添加到testGetGreeting的主体中。
    清单10. testGetGreeting
    HelloWorldServlet helloWorldServlet=new HelloWorldServlet();
    helloWorldServlet.getGreeting(request);
    assertEquals("Hello Rose!",session.getAttribute("greeting"));

    清单10中的代码:
    • 构造一个新的HelloWorldServlet对象。
    • 调用getGreeting()并将request传递给它,该request是Cactus自动初始化的隐式对象之一。 request的类型是org.apache.cactus.server.HttpServletRequestWrapper ,它是从javax.servlet.http.HttpServletRequest继承的。 因此,可以将其传递给采用HttpServletRequest类型变量的servlet方法。
    • 检查期望值和存储在会话属性中的值是否相等。

总体代码应类似于清单11所示。

清单11. HelloWorldServletTest
package com.ibm.tdc;
import org.apache.cactus.ServletTestCase;
import org.apache.cactus.WebRequest;
public class HelloWorldServletTest extends ServletTestCase 
{	
   public void beginGetGreeting(WebRequest webRequest)
   {
      webRequest.addParameter("name", "Rose");
   }
   
   public void testGetGreeting() 
   {
      HelloWorldServlet helloWorldServlet=new HelloWorldServlet();
      helloWorldServlet.getGreeting(request);
      assertEquals("Hello Rose!",session.getAttribute("greeting"));
   }
}
运行servlet测试

以下步骤显示了如何运行HelloWorldServletTest类。

  1. 右键单击HelloWorldServletTest测试类,然后选择Run> Run
  2. 在“配置”列表中选择“ JUnit ”,然后单击“ 新建”
  3. 单击右窗格中的“ 参数”选项卡。
  4. 在VM arguments字段中将Cactus上下文URL设置为-Dcactus.contextURL=http://localhost:9080/HelloWorld ,如图16所示。请注意,HelloWorld是项目名称。 cactus.contextURL表示测试应用程序在其下运行的应用程序上下文。
    图16.仙人掌配置
    仙人掌配置
  5. 点击运行 。 测试应该通过,并且您会看到一个绿色的条, 如图7所示,它指示测试成功。

EJB单元测试

本节说明如何创建HelloWorld无状态会话EJB Bean,以及如何使用仙人掌测试框架执行单元测试。

创建被测试的EJB

请按照以下步骤创建一个HelloWorld无状态会话EJB bean:

  1. 要创建要测试的无状态会话EJB Bean, 请将HelloEJB.zip (在“ 下载”部分中提供)导入为项目交换。 或选择“ 文件”>“新建”>“项目”>“ EJB”>“ EJB项目” ,输入HelloEJB作为项目名称,然后单击“ 完成”
  2. 右键单击HelloEJB ,选择New> Other> EJB> Enterprise Bean ,然后单击Next
  3. 输入图17中所示的值,在其中选择Session bean作为EJB类型并定义bean的基本属性。 然后单击“ 下一步”
    图17.创建一个新的EJB bean
    创建一个新的EJB bean
  4. 从Session type下拉列表中,选择Stateless ,如图18所示,然后单击Finish
    图18.填写EJB详细信息
    填写EJB详细信息
  5. 将清单12中的代码粘贴到HelloBean中。
    清单12. EJB方法的实现
    public String getGreeting(String name)
    {
       System.out.println("stateless session bean ...");
       return "Hello! "+name;
    }
  6. getGreeting()方法提升到远程接口,如图19所示。
    图19.升级到远程界面
    升级到远程界面

    getGreeting()方法提升到远程接口( Hello ),将在Hello远程接口中生成清单13中所示的代码行。
    清单13.远程接口生成的代码
    public String getGreeting(String name) throws java.rmi.RemoteException;

    远程客户端调用此远程方法。
创建一个EJB测试

HelloEJB的测试在您先前在Servlet单元测试部分中创建的HelloWorld动态Web项目中进行

  1. 打开HelloWorldEAR的部署描述符。
  2. 转到Module选项卡,并将HelloEJBClient.jar添加到Project Utility Jars列表中,如图20所示。
    图20. Project Utility JARs
    项目实用程序JAR
  3. 右键单击项目HelloWorld ,然后选择属性> Java JAR Dependencies
  4. 在右侧列表中选择HelloEJBClient.jar ,然后单击OK 。 图21显示了JAR依赖项的外观。
    图21. JAR依赖项
    JAR依赖
  5. 如果尚未执行,请在HelloWorld Web项目上执行Cactus测试准备部分中提到的步骤(请参阅创建servlet测试 )。
  6. HelloEJBTest创建一个名为HelloEJBTest的JUnit测试用例,并将清单14中的代码插入HelloEJBTest中。
    清单14. HelloEJBTest
    package com.ibm.tdc;
    import java.util.Hashtable;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.rmi.PortableRemoteObject;
    import org.apache.cactus.ServletTestCase;
    
    public class HelloEJBTest extends ServletTestCase 
    {	
       public void testGetGreeting() 
         throws NamingException, RemoteException, CreateException
       {
          Hashtable env = new Hashtable();
          Object obj = null;
          Context ctx = null;
          String strUrl = "iiop://localhost:2809"; 
          env.put(Context.PROVIDER_URL, strUrl);	
    	  
          ctx = new InitialContext(env);
          obj = ctx.lookup("ejb/com/ibm/tdc/HelloHome");
          HelloHome bfmh = (HelloHome) PortableRemoteObject.narrow(obj, 
            HelloHome.class);
          Hello defaultSession = bfmh.create();;
          assertEquals("Hello! Rosa", defaultSession.getGreeting("Rosa"));
       }
    }
运行被测EJB

请参阅“ 运行servlet测试”部分以运行HelloEJBTest

组件测试

组件测试在将基本代码单元集成到生产代码库中之前测试它们的集成,以执行某些功能。 本节将引导您使用WebSphere Integration Developer,Rational Software Architect和Rational Application Developer中的组件测试功能来对Java代码和Web服务执行自动化的组件测试。 自动化的组件测试功能扩展了JUnit框架。

有一些要求:运行组件测试之前,需要安装Rational Agent Controller。 为了测试Java代码和Web服务组件,您必须首先创建一个组件测试项目(在WebSphere Integration Developer,Rational Software Architect或Rational Application Developer中),该项目代表了测试组件的容器(参见图22)。

图22.组件测试
组件测试

创建一个组件测试项目

执行以下步骤来创建组件测试项目,在其中将创建组件测试时生成的测试工件分组:

  1. 导入CompTest.zip (可在“ 下载”部分中获得)作为项目交换。 或通过选择File> New> Project> Component Test> Component Test Project创建一个组件测试项目 ,然后单击Next ,如图23所示。
    图23. Web服务组件测试
    Web服务组件测试
  2. 将组件测试项目CompTest ,然后单击“ 下一步”
  3. 通过选择HelloWebServiceHelloWorldJava项目,定义组件测试项目范围(此组件测试项目中要测试的项目),如图24所示。
    图24.测试范围
    测试范围
  4. 点击完成

Java组件测试

组件测试是在将代码的基本单元集成到生产代码库中之前对其进行测试以执行特定功能的基本代码单元的集成的能力。 假设您在Java单元测试部分中创建的HelloWorldJava项目具有另一个名为GoodMorning类。 此类具有一个方法sayGoodMorning() ,该方法采用Hello! name格式的字符串Hello! name Hello! name ,对其进行解析以检索该名称,然后返回Good Morning name 。 该类已通过单元测试,成为HelloWorld类。 现在,您想将这两个类集成在一起,以形成一个使用name并返回Good Morning name的特定场景。 这是如何做:

  1. 选择文件>新建>其他>组件测试> Java> Java组件测试 ,然后单击下一步
  2. 选择将与新Java组件测试相关联的CompTest组件测试项目。
  3. 当出现“选择要测试的组件”对话框时,选择HelloWorldGoodMorning类(要测试的类)。
  4. 输入HelloFlow作为测试名称,如图25所示,然后单击Next
    图25.被测组件
    被测组件
  5. 要基于一系列方法调用创建测试,请选择基于方案的测试 ,然后单击下一步
  6. 要开始测试,必须首先使用构造函数从类中实例化一个新对象。 那么可以在此对象上调用任何方法序列。 “定义测试方案”对话框(请参见图26)完全模拟此步骤序列,您可以执行以下操作:
    1. 要创建HelloWorld类的对象,请从“构造函数”列表中选择HelloWorld() ,然后单击“ 添加”
    2. 要添加任何方法调用序列,请从“可测试方法”列表中选择并按所需顺序添加每个方法。 在这种情况下,选择getGreeting(String) ,然后单击Add
    3. 从“构造函数”列表中选择GoodMorning() ,然后单击“ 添加”
    4. 选择sayGoodMorning(String) ,然后单击添加
    5. 点击完成
    图26.基于场景的测试
    基于场景的测试
  7. 单击“ 测试概述”选项卡,然后单击“ 行为”旁边的“ HelloFlow.java” (请参见图27)以查看并开始编辑测试代码。
    图27.测试概述
    测试概述
  8. 修改代码以实现所需的测试,然后在Java编辑器中单击测试方法testClassCluster()以显示“测试数据表”。
  9. 在表中输入数据和预期的输出,如图28所示,然后单击Save
    图28. Java组件测试
    Java组件测试
  10. 在“测试导航器”中,展开CompTest组件测试项目。
  11. 右键单击HelloFlow测试套件,然后选择Run> Component Test ,如图29所示。
    图29.运行组件测试
    运行组件测试
  12. 在“测试数据比较器”视图中观察“实际”列与“预期”列。 图30显示测试成功通过,并且实际和预期结果匹配。 (这由“实际”列中结果的绿色表示;如果实际结果和预期结果之间不匹配,则结果在“实际”列中显示为红色)。
    图30. Java测试结果
    Java测试结果

Web服务组件测试

本节通过测试HelloWebService讨论Web服务组件测试。 要在先前创建的CompTest中创建Web服务组件测试(在“ 创建组件测试项目”部分中),请执行以下操作:

  1. 选择“ 文件”>“新建”>“其他”>“组件测试”>“ Web服务”>“ Web Service组件测试” ,然后单击“ 下一步”
  2. 选择将与新的Web服务组件测试相关联的CompTest组件测试项目,然后单击Next
  3. 在“选择要测试的Web服务”对话框中,浏览到HelloService.wsdl ,然后选择要测试的端口类型,如图31所示。此对话框负责从选定的WSDL文件生成代理类。
    图31.被测试的Web服务
    正在测试的Web服务
  4. 在“选择测试模式”对话框中,选择“ 操作级Web服务测试”以为要测试的类中的每个单独操作创建一个测试。 然后单击Next (参见图32)。
    图32.选择一个测试模式
    选择测试图案
  5. 选择getGreeting(String)方法(要测试的方法),然后单击Finish ,如图33所示。
    图33.选择一个Web服务方法
    选择Web服务方法

    在Web透视图中,生成了客户端类,如图34所示。
    图34.代理类
    代理类
  6. 切换到“ 测试”透视图,并填写“ 测试数据表”
    图35. WS组件测试
    WS组件测试

    请注意,将webServiceUrlString(在In列中)设置为http:// localhost:9080 / HelloWebService / services / HelloPort,这是在<soap:address>标记内的HelloService WSDL文件中指定的值。
  7. 右键单击项目,然后选择“运行”>“测试组件”
  1. 观察“测试数据比较器”视图中的“实际值与预期值”列。 图36显示测试成功通过,并且实际结果和预期结果匹配。 (这由“实际”列中结果的绿色表示;如果实际结果和预期结果之间不匹配,则结果在“实际”列中显示为红色)。
    图36. Web服务测试结果
    Web服务测试结果

服务组件架构测试

SCA是一种新的编程模型,专门用于在面向服务的体系结构(SOA)中构建和组装业务解决方案,以及用于集成和组合服务。 (有关更多信息,请参阅“ 使用服务组件体系结构构建SOA解决方案 ” [developerWorks,2005年10月)。)

您可以使用ServletTestCase执行SCA组件测试。 此测试用例使用Cactus框架通过独立引用从外部调用SCA组件。 在本节中,您将创建一个具有SCA组件的HelloWorldModule模块,这些SCA组件已连接到独立引用。 然后,创建一个名为HelloWorldModuleTest的动态Web项目,以测试SCA组件。

创建一个SCA模块

执行以下步骤来创建和测试SCA模块:

  1. 导入HelloWorldModule.zip (在“ 下载”部分中提供)作为项目交换。 或通过单击文件>新建>项目>模块来创建模块 。 然后单击“ 下一步”
  2. 输入HelloWorldModule作为项目名称。
  3. 在“ 业务集成”透视图中,导航到并右键单击HelloWorldModule>接口
  4. 选择“ 新建”>“接口” ,并将接口命名为HelloInterface
  5. 接口编辑器打开后,添加getGreeting操作,该操作将名称作为输入,并将greeting作为输出,如图37所示。
    图37. HelloInterface
    HelloInterface
  6. 打开装配体编辑器
  7. 拖放Java SCA组件 ,将其命名为HelloJava ,并将HelloInterface添加为组件接口。
  8. 拖放Process SCA组件 ,将其命名为HelloProcess ,并向其添加HelloInterface作为组件接口和参考。
  9. HelloProcess连接HelloJava
  10. 双击HelloJava (这将实现它),并在getGreeting()操作中添加以下行: return "Hello! "+name;
  11. 实现HelloProcess ,如图38所示。
    图38. HelloProcess
    HelloProcess

    如您在图38中看到的, Invoke用于调用HelloJava ,而Snippet用于更改问候语的值。

  12. 拖放独立引用 ,并将独立引用连接HelloJavaHelloJavaProcess ,如图39所示。
    图39. HelloWorldModule
    HelloWorldModule

    图39中所示的伙伴参考名称是SCA组件的入口点。 这些名称用于在测试期间调用SCA组件。
创建SCA测试

以下步骤引导您完成创建一个动态Web项目HelloWorldModuleTest,该项目将测试HelloWorldModule:

  1. 切换到J2EE透视图,然后在Project Explorer视图中展开Enterprise Applications
  2. 右键单击HelloWorldModuleApp ,然后选择新建>动态Web项目
  3. 在“新建动态Web项目”对话框中,输入名称,例如HelloWorldModuleTest ,这是用于测试HelloWorldModuleApp的项目。
  4. 点击完成
  5. 对HelloWorldModuleTest项目执行仙人掌测试准备部分中介绍的步骤。
  6. 必须将HelloWorldModuleTest(依赖于HelloWorldModule)添加到HelloWorldModule中。 为此,请切换到“ 业务集成”透视图,选择“ HelloWorldModule” ,然后单击鼠标右键以打开“依赖关系编辑器”。
  7. 展开J2EE ,然后单击Add将HelloWorldModuleTest动态Web项目添加到SCA模块,如图40所示。
    图40.依赖性编辑器
    依赖编辑器
  8. 切换到Web透视图,转到Project Explorer视图,然后展开HelloWorldModule> Java Resources> JavaSource
  9. Create a new class named HelloWorldTest inside the package com.ibm.tdc , and paste the code from Listing 15 in it.
    Listing 15. HelloWorldTest
    package com.ibm.tdc;
    import org.apache.cactus.ServletTestCase;
    import com.ibm.websphere.sca.Service;
    import com.ibm.websphere.sca.ServiceManager;
    public class HelloWorldTest extends ServletTestCase 
    {
    public void testHelloJava() 
    {	
    Service service=(Service)ServiceManager.INSTANCE.locateService
      ("HelloInterfacePartner");
    String greeting = (String)service.invoke("getGreeting", "Rosa");
    assertEquals("Hello From First Java Component! Rosa", greeting);
    }
    
    public void testHelloProcess() 
    {	
    Service service=(Service)ServiceManager.INSTANCE.locateService
      ("HelloInterfacePartner1");
    String greeting = (String)service.invoke("getGreeting", "Rosa");
    assertEquals("Hello From Process! Rosa", greeting);
    }
    }

    The previous code tests both the HelloJava and HelloProcess SCA components using the testHelloJava() and testHelloProcess() methods, respectively. Each method uses the service manager to access the SCA component through the partner reference name, invokes the getGreeting() operation, then validates the result through assertion.

Run SCA module under test

Refer to the Run the servlet test section to run HelloWorldTest.

Test automation using Ant scripts

Ant is a Java-based tool used for build automation; in this case Ant is used to automate JUnit and Cactus test cases, and generate the test results in XML files (see Related topics for a link to more information about Ant).

JUnit Ant script

The following steps show how to use the JUnit Ant task to run the HelloWorldTest (created earlier). This lets you perform the unit test for the HelloWorld Java class, as explained in the Java unit testing section.

  1. Create an XML file named build.xml , and place it in the Java project.
  2. Paste the code from Listing 16 in the build.xml file.
    Listing 16. JUnit Ant script
    <?xml version="1.0" encoding="UTF-8"?>
    <project name="Workspace" default="junitTest">
     <target name="junitTest">
      <junit printsummary="yes" haltonfailure="no">
       <classpath>
        <pathelement location="bin" />
       </classpath>
       <formatter type="xml"/>
       <batchtest todir="C:/temp/">
        <fileset dir="C:/Workspace/HelloWorldJava">
         <include name="**/*Test*.java" />
        </fileset>
       </batchtest>
      </junit>
     </target>
    </project>

In Listing 16, note that:

  • <pathelement location="bin"/> refers to the place of the .class files (the classes under test and the test cases).
  • <junit printsummary="yes" haltonfailure="no"> runs the JUnit test cases and prints a summary.
  • <formatter type="xml"/> sets the test results format.
  • <batchtest todir="C:/temp/"> specifies the location of the generated test results reports.
  • <fileset dir="C:/Workspace/HelloWoldJava"> refers to the location of the Java project.
  • <include name="**/*Test*.java"> refers to test case with the word Test in it under any package. Note that **/*Test*.java can be replaced by com/ibm/tdc/HelloWorldTest.java .
  1. To run Ant, drag and drop the build.xml file in the Ant view.
  2. Right-click junitTest , and select Run Ant , as shown in Figure 41.
    Figure 41. Run Ant
    Run Ant
  3. Select the JRE tab, and choose Run in the same JRE as the workspace (this is the JRE in which Ant will run), as shown in Figure 42.
  4. 点击运行
    Figure 42. JRE selection
    JRE selection

The test results appear in the Console, and the test reports are generated at the location you specified earlier.

Cactus Ant script

Follow these steps to use the Cactus Ant task to run HelloWorldServletTest (created earlier) to perform the unit test for the HelloWorldServlet servlet, as covered in the Servlet unit testing section.

  1. Add cactus-ant-1.7.2.jar and cargo-0.5.jar under WebContent\WEB-INF\lib to run the Cactus Ant task. (You can download these .jar files from the Download section of this article or from apache.org.)
  2. Right-click HelloWorldEAR , select Export > EAR file , and choose C:/temp/test/HelloWorldEAR.ear as the destination.
  3. Create an XML file named build.xml , and place it in the HelloWorld dynamic Web project.
  4. Paste the code from Listing 17 in the build.xml file.
    Listing 17. Cactus Ant script
    <?xml version="1.0" encoding="UTF-8"?>
    <project name="Workspace" default="cactusTest">
     <property name="server.lib" value="C:/WebSphere/ID/602/runtimes/bi_v6/lib"/>
     <property name="project.lib" value="WebContent/WEB-INF/lib"/>
     <path id="test.classpath">
      <fileset dir="${server.lib}">
       <include name="j2ee.jar" />
      </fileset>
     <pathelement location="WebContent/WEB-INF/classes" />
     </path>
     <path id="cactus.classpath">
      <pathelement location="${project.lib}/cactus-1.7.2.jar"/>
      <pathelement location="${project.lib}/cargo-0.5.jar"/>
      <pathelement location="${project.lib}/cactus-ant-1.7.2.jar"/>
      <pathelement location="${project.lib}/commons-httpclient-2.0.2.jar"/>
      <pathelement location="${project.lib}/commons-logging-1.0.4.jar"/>
      <pathelement location="${project.lib}/aspectjrt-1.2.1.jar"/>
     </path>
     <target name="cactusTest">
      <taskdef resource="cactus.tasks" classpathref="cactus.classpath"/>
       <cactus printsummary="yes" haltonfailure="no" 
          earfile="C:/temp/test/HelloWorldEAR.ear">
        <classpath refid="test.classpath" />
        <formatter type="xml"/>
        <batchtest todir="C:/temp/">
         <fileset dir="C:/Workspace/HelloWorld/JavaSource">
          <include name="com/ibm/tdc/HelloWorldServletTest.java" />
         </fileset>
        </batchtest>
       </cactus>
     </target>
    </project>

In Listing 17, note that:

  • <property name="server.lib" value="..."/> refers to the place of the server library.
  • <path id="test.classpath"> refers to the j2ee.jar file.
  • <path id="cactus.classpath"> refers to the Cactus .jar files.
  • <taskdef resource="cactus.tasks" classpathref="cactus.classpath"/> defines the Cactus task and refers to the Cactus .jar files.
  • <cactus ... earfile="C:/temp/test/HelloWorldEAR.ear"> refers to the dynamic Web project EAR file that was exported above in step 2.
  1. Drag and drop build.xml in the Ant view, then right-click cactusTest > Run Ant .
  2. Select the JRE tab, and choose Separate JRE .
  3. Select the server on which your dynamic Web project is running. For example, if you're using WebSphere Process Server, choose WPS Server v6.0 JRE . (Note that the WebSphere Process Server test environment is available with WebSphere Integration Developer.)
  4. Set the VM arguments to -Dcactus.contextURL=http://localhost:9080/HelloWorld , as shown in Figure 43.
    Figure 43. Separate JRE
    Separate JRE
  5. You need to add junit.jar, because it's needed by the Cactus Ant task. Select the Classpath tab, and click User Entries .
  6. Click Add JARs , browse to HelloWorld\WebContent\WEB-INF\lib\junit.jar , and click OK . junit.jar is added to the User Entries list, as shown in Figure 44.
    Figure 44. Adding junit.jar to User Entries
    Adding junit.jar to User Entries
  7. 点击运行 。 The test report appears in the destination specified in the Ant script.

结论

In this tutorial, you learned how to perform unit and component testing using the JUnit and Cactus frameworks. You also walked through the automation of tests with Ant scripts using IBM Rational tools.

致谢

The author would like to thank Ahmed Abbas, Dr. Alaa Youssef, and Mahmoud Ouda for reviewing the tutorial and for their valuable suggestions.


翻译自: https://www.ibm.com/developerworks/webservices/tutorials/ws-testing/ws-testing.html

PACKAGE RSPS_Evaluation rational 1.5 1C0AB0D69C73 \ COMPONENTS="PerformanceStudioSuite:1.0:1 LTmaster:7.1:1 \ LTgui:7.1:10 LTvu:7.1:100 LTjolt:7.1:1 LTtux:7.1:1 LTsql:7.1:1 \ LThttp:7.1:1 LTsap:7.1:1 LTcorba:7.1:1 LTdcom:7.1:1" PACKAGE RSPS_Base_License rational 1.5 AAEC0768D8DA \ COMPONENTS="PerformanceStudioSuite:1.0:1 LTmaster:7.1:1 \ LTgui:7.1:1 LTvu:7.1:50 LThttp:7.1:1" PACKAGE LT_Playback_100VU rational 7.5 10B297DCA509 \ COMPONENTS="LTvu:7.1:100 LT_100VT:8.0:1" PACKAGE LT_Playback_250VU rational 7.5 46D73E06F8CA \ COMPONENTS="LTvu:7.1:250 LT_250VT:8.0:1" PACKAGE LT_Playback_500VU rational 7.5 EF451B5CFD15 \ COMPONENTS="LTvu:7.1:500 LT_500VT:8.0:1" PACKAGE LT_Playback_1000VU rational 7.5 68C15DACA3A7 \ COMPONENTS="LTvu:7.1:1000 LT_1000VT:8.0:1" PACKAGE LT_Playback_2500VU rational 7.5 41BCC971EFB0 \ COMPONENTS="LTvu:7.1:2500 LT_2500VT:8.0:1" PACKAGE LT_Playback_5000VU rational 7.5 E809693053EF \ COMPONENTS="LTvu:7.1:5000 LT_5000VT:8.0:1" PACKAGE LT_Playback_10000VU rational 7.5 79F52A91E693 \ COMPONENTS="LTvu:7.1:10000 LT_10000VT:8.0:1" PACKAGE LT_Playback_20000VU rational 7.5 0ED4D35282E1 \ COMPONENTS="LTvu:7.1:20000 LT_20000VT:8.0:1" PACKAGE LT_Playback_50000VU rational 7.5 D8A40635DE7B \ COMPONENTS="LTvu:7.1:50000 LT_50000VT:8.0:1" PACKAGE LT_Playback_100000VU rational 7.5 2624850A2BBE \ COMPONENTS="LTvu:7.1:100000 LT_100000VT:8.0:1" PACKAGE RSPS_TLA_500VU rational 1.5 7EBAF9407ED4 \ COMPONENTS="PerformanceStudioSuite:1.0:1 LTmaster:7.1:1 \ LTgui:7.1:500 LTvu:7.1:500 LTjolt:7.1:1 LTtux:7.1:1 \ LTsql:7.1:1 LThttp:7.1:1 LTsap:7.1:1 LTcorba:7.1:1 \ LTdcom:7.1:1" PACKAGE RSPS_TLA_100KVU rational 1.5 E2A84565831B \ COMPONENTS="PerformanceStudioSuite:1.0:1 LTmaster:7.1:1 \ LTgui:7.1:500 LTvu:7.1:100000 LTjolt:7.1:1 LTtux:7.1:1 \ LTsql:7.1:1 LThttp:7.1:1 LTsap:7.1:1 LTcorba:7.1:1 \ LTdcom:7.1:1" PACKAGE LT_All_VU_Protocols rational 7.5 CD8298ACC192 \ COMPONENTS=LT_All_Protocols:7.1:1 PACKAGE PerformanceStudioOEM rational 7.5 768CFCB275A5 \ COMPONENTS="PerformanceStudioSuite:1.0:1 LTmaster:7.1:1 \ LTgui:7.1:1 LTvu:7.1:1 LTjolt:7.1:1 LTtux:7.1:1 LTsql:7.1:1 \ LThttp:7.1:1 LTsap:7.1:1 LTcorba:7.1:1 LTdcom:7.1:1" PACKAGE LoadTest_Base rational 7.5 27CCA9A18283 \ COMPONENTS="LoadTestSuite:7.5:1 LTmaster:7.1:1 LTgui:7.1:1 \ LTvu:7.1:50 LThttp:7.1:1" PACKAGE TMvtpool rational 8.0 FE4376C9DEE0 \ COMPONENTS=TMvirtualtester:8.0:5 PACKAGE LT_Playback_50VU rational 7.5 24DE0865AC61 \ COMPONENTS="LTvu:7.1:50 LT_50VT:8.0:1" # Startup Key, Nodelock License INCREMENT RequisitePro rational 4.0 31-dec-2020 uncounted \ B5602EC1BDC4 \ VENDOR_STRING=3121-08477|Nodelocked||RequisitePro:4.0 \ HOSTID=ANY vendor_info="|Rational RequisitePro|" \ NOTICE="Living on the EDGE" ck=149 INCREMENT RequisiteWeb rational 4.0 31-dec-2020 uncounted \ 6D2EF8522896 \ VENDOR_STRING=3121-08481|Nodelocked||RequisiteWeb:4.0 \ HOSTID=ANY vendor_info="|Rational RequisiteWeb|" \ NOTICE="Living on the EDGE" ck=83 INCREMENT ClearCase rational 1.0 31-dec-2020 uncounted ACD091CE76D1 \ VENDOR_STRING=|Nodelocked||ClearCase:1.0 HOSTID=ANY \ vendor_info="|Rational ClearCase|" NOTICE="Living on the EDGE" \ ck=157 INCREMENT ClearCase_LT rational 1.0 31-dec-2020 uncounted \ 0026C81FCAAB VENDOR_STRING=|Nodelocked||ClearCase_LT:1.0 \ HOSTID=ANY vendor_info="|Rational ClearCase LT|" \ NOTICE="Living on the EDGE" ck=89 INCREMENT ClearQuest rational 1.0 31-dec-2020 uncounted 06E20E61AB7F \ VENDOR_STRING=|Nodelocked||ClearQuest:1.1 HOSTID=ANY \ vendor_info="|Rational ClearQuest|" NOTICE="Living on the \ EDGE" ck=184 INCREMENT ClearQuestMultiSite rational 1.0 31-dec-2020 uncounted \ 2CACEFCA10FB \ VENDOR_STRING=3121-10064|Nodelocked||ClearQuestMultiSite:1.0 \ HOSTID=ANY vendor_info="|Rational ClearQuest MultiSite|" \ NOTICE="Living on the EDGE" ck=163 INCREMENT MultiSite rational 1.0 31-dec-2020 uncounted D5403B7B5E2B \ VENDOR_STRING=3121-10573|Nodelocked||MultiSite:1.0 HOSTID=ANY \ vendor_info="|Rational ClearCase MultiSite|" NOTICE="Living on \ the EDGE" ck=168 INCREMENT ProjectConsole rational 1.0 31-dec-2020 uncounted \ A3AC356CFC56 \ VENDOR_STRING=3121-11819|Nodelocked||ProjectConsole:1.0 \ HOSTID=ANY vendor_info="|Rational ProjectConsole Web Access|" \ NOTICE="Living on the EDGE" ck=111 INCREMENT PurifyNT rational 6.0 31-dec-2020 uncounted 930F139C3C6B \ VENDOR_STRING=3121-09556|Nodelocked||PurifyNT:6.0 HOSTID=ANY \ vendor_info="|Rational Purify for Windows|" NOTICE="Living on \ the EDGE" ck=105 INCREMENT PurifyPlus rational 1.0 31-dec-2020 uncounted B5B8E83D4E07 \ VENDOR_STRING=3121-10125|Nodelocked||purifyplusNT:1.0 \ HOSTID=ANY vendor_info="|Rational PurifyPlus for Windows|" \ NOTICE="Living on the EDGE" ck=152 INCREMENT PurifyPlusRealTime rational 1.0 31-dec-2020 uncounted \ 23308FBA63D8 \ VENDOR_STRING=3121-11214|Nodelocked||PurifyPlusRealTime:1.0 \ HOSTID=ANY vendor_info="|Rational PurifyPlus RealTime|" \ NOTICE="Living on the EDGE" ck=113 INCREMENT Robot rational 7.1 31-dec-2020 uncounted 335F39A50668 \ VENDOR_STRING=3121-08493|Nodelocked||Robot:7.1 HOSTID=ANY \ vendor_info="|Rational Robot|" NOTICE="Living on the EDGE" \ ck=54 INCREMENT Robot_PS rational 7.1 31-dec-2020 uncounted CE4ACE65E1C3 \ VENDOR_STRING=3121-08997|Nodelocked||Robot_PS:7.1 HOSTID=ANY \ vendor_info="|Rational Robot for PeopleSoft|" NOTICE="Living \ on the EDGE" ck=163 INCREMENT Rose98_Unix rational 6.0 31-dec-2020 uncounted AB8582D9AE97 \ VENDOR_STRING=|Nodelocked||Rose98_Unix:6.0 HOSTID=ANY \ vendor_info="|Rational Rose for UNIX|" NOTICE="Living on the \ EDGE" ck=125 INCREMENT RoseRealTime rational 6.1 31-dec-2020 uncounted \ 04F23412100A \ VENDOR_STRING=3121-09021|Nodelocked||RoseRealTime:6.1 \ HOSTID=ANY vendor_info="|Rational Rose RealTime|" \ NOTICE="Living on the EDGE" ck=78 INCREMENT SoDA_Frame rational 3.0 31-dec-2020 uncounted C9D3CA5AB551 \ VENDOR_STRING=3121-08485|Nodelocked||SoDA_Frame:3.0.2 \ HOSTID=ANY vendor_info="|Rational SoDA with Frame|" \ NOTICE="Living on the EDGE" ck=184 INCREMENT TestManager rational 7.1 31-dec-2020 uncounted 6B71A6FD6041 \ VENDOR_STRING=3121-09734|Nodelocked||TestManager:7.1 \ HOSTID=ANY vendor_info="|Rational TestManager|" NOTICE="Living \ on the EDGE" ck=68 INCREMENT TestRealTime rational 1.0 31-dec-2020 uncounted \ 1F4C8D3F7F3D \ VENDOR_STRING=3121-10311|Nodelocked||TestRealTime:1.0 \ HOSTID=ANY vendor_info="|Rational Test RealTime|" \ NOTICE="Living on the EDGE" ck=170 INCREMENT UnifiedProcess rational 5.1 31-dec-2020 uncounted \ 882DB91ADB5D \ VENDOR_STRING=3121-08488|Nodelocked||UnifiedProcess:5.1 \ HOSTID=ANY vendor_info="|Rational Unified Process|" \ NOTICE="Living on the EDGE" ck=111 INCREMENT VisualPureCoverage rational 6.0 31-dec-2020 uncounted \ 8339A5B75E02 \ VENDOR_STRING=3121-09557|Nodelocked||VisualPureCoverage:6.0 \ HOSTID=ANY vendor_info="|Rational PureCoverage for Windows|" \ NOTICE="Living on the EDGE" ck=134 INCREMENT VisualQuantify rational 6.0 31-dec-2020 uncounted \ DBF93590A8A4 \ VENDOR_STRING=3121-09558|Nodelocked||VisualQuantify:6.0 \ HOSTID=ANY vendor_info="|Rational Quantify for Windows|" \ NOTICE="Living on the EDGE" ck=190 INCREMENT eval_xde_proplus_vsnet rational 1.5 31-dec-2020 uncounted \ E9A50CEE9B54 \ VENDOR_STRING=3121-11824|Nodelocked||eval_xde_proplus_vsnet \ HOSTID=ANY vendor_info="|Rational XDE Developer Plus for .NET \ (Evaluation)|" NOTICE="Living on the EDGE" ck=128 INCREMENT eval_xde_proplus_wsw rational 1.5 31-dec-2020 uncounted \ 2347C3CCD491 \ VENDOR_STRING=3121-11823|Nodelocked||eval_xde_proplus_wsw \ HOSTID=ANY vendor_info="|Rational XDE Developer Plus for Java \ (Evaluation)|" NOTICE="Living on the EDGE" ck=85 INCREMENT eval_xde_tester rational 1.5 31-dec-2020 uncounted \ C0E2719C395E \ VENDOR_STRING=3121-11819|Nodelocked||eval_xde_tester \ HOSTID=ANY vendor_info="|Rational XDE Tester (Evaluation)|" \ NOTICE="Living on the EDGE" ck=109 INCREMENT rose_ada_windows rational 6.0 31-dec-2020 uncounted \ CE7402D09DEF \ VENDOR_STRING=3121-08621|Nodelocked||rose_ada_windows:6.0 \ HOSTID=ANY vendor_info="|Rational Rose Professional Ada \ Edition|" NOTICE="Living on the EDGE" ck=162 INCREMENT rose_cpp_windows rational 6.0 31-dec-2020 uncounted \ 2DC6ED421FD0 \ VENDOR_STRING=3121-08391|Nodelocked||rose_cpp_windows:6.0 \ HOSTID=ANY vendor_info="|Rational Rose Professional C++ \ Edition|" NOTICE="Living on the EDGE" ck=129 INCREMENT rose_enterprise_windows rational 6.0 31-dec-2020 uncounted \ D258DFAAB9B1 \ VENDOR_STRING=3121-08407|Nodelocked||rose_enterprise_windows:6.0 \ HOSTID=ANY vendor_info="|Rational Rose Enterprise Edition|" \ NOTICE="Living on the EDGE" ck=237 INCREMENT rose_j_windows rational 6.0 31-dec-2020 uncounted \ 3F4211C37911 \ VENDOR_STRING=3121-08399|Nodelocked||rose_j_windows:6.0 \ HOSTID=ANY vendor_info="|Rational Rose Professional J \ Edition|" NOTICE="Living on the EDGE" ck=106 INCREMENT rose_modeler_windows rational 6.0 31-dec-2020 uncounted \ 122110FF486B \ VENDOR_STRING=3121-08395|Nodelocked||rose_modeler_windows:6.0 \ HOSTID=ANY vendor_info="|Rational Rose Modeler Edition|" \ NOTICE="Living on the EDGE" ck=73 INCREMENT rose_vb_windows rational 6.0 31-dec-2020 uncounted \ E04C88E10BFE \ VENDOR_STRING=3121-08403|Nodelocked||rose_vb_windows:6.0 \ HOSTID=ANY vendor_info="|Rational Rose Professional Visual \ Basic Edition|" NOTICE="Living on the EDGE" ck=187 INCREMENT rose_windows_datamodeler rational 6.0 31-dec-2020 uncounted \ E0E835F2A812 \ VENDOR_STRING=3121-09199|Nodelocked||rose_windows_datamodeler:6.0 \ HOSTID=ANY vendor_info="|Rational Rose Professional Data \ Modeler Edition|" NOTICE="Living on the EDGE" ck=93 INCREMENT soda_word rational 3.5 31-dec-2020 uncounted 5B992E6D2F03 \ VENDOR_STRING=3121-08483|Nodelocked||soda_word:3.5 HOSTID=ANY \ vendor_info="|Rational SoDA for Word|" NOTICE="Living on the \ EDGE" ck=122 INCREMENT xde_data_modeler rational 1.5 31-dec-2020 uncounted \ 7AB1AD660723 \ VENDOR_STRING=3121-09218|Nodelocked||xde_data_modeler:1.5 \ HOSTID=ANY vendor_info="|Rational XDE Data Modeler|" \ NOTICE="Living on the EDGE" ck=117 INCREMENT xde_data_modeler_net rational 1.5 31-dec-2020 uncounted \ 2185F93D37ED \ VENDOR_STRING=3121-09217|Nodelocked||xde_data_modeler_net:1.5 \ HOSTID=ANY vendor_info="|Rational XDE Data Modeler for .NET|" \ NOTICE="Living on the EDGE" ck=117 INCREMENT xde_modeler rational 1.5 31-dec-2020 uncounted 6E1D5B4DCEE5 \ VENDOR_STRING=3121-08989|Nodelocked||xde_modeler:1.5 \ HOSTID=ANY vendor_info="|Rational XDE Modeler|" NOTICE="Living \ on the EDGE" ck=136 INCREMENT xde_modelernet rational 1.5 31-dec-2020 uncounted \ 24DFA0065D37 \ VENDOR_STRING=3121-08990|Nodelocked||xde_modelernet:1.5 \ HOSTID=ANY vendor_info="|Rational XDE Modeler for .NET|" \ NOTICE="Living on the EDGE" ck=116 INCREMENT xde_projava rational 1.5 31-dec-2020 uncounted F154C18B9DDD \ VENDOR_STRING=3121-09044|Nodelocked||xde_projava:1.5 \ HOSTID=ANY vendor_info="|Rational XDE Developer for Java|" \ NOTICE="Living on the EDGE" ck=146 INCREMENT xde_pronet rational 1.5 31-dec-2020 uncounted 051B86C973ED \ VENDOR_STRING=3121-08809|Nodelocked||xde_pronet:1.5 HOSTID=ANY \ vendor_info="|Rational XDE Developer for .NET|" NOTICE="Living \ on the EDGE" ck=133 INCREMENT xde_proplusjava rational 1.5 31-dec-2020 uncounted \ EC041042E454 \ VENDOR_STRING=3121-09699|Nodelocked||xde_proplusjava:1.5 \ HOSTID=ANY vendor_info="|Rational XDE DeveloperPlus for Java|" \ NOTICE="Living on the EDGE" ck=109 INCREMENT xde_proplusnet rational 1.5 31-dec-2020 uncounted \ D091A06FA16F \ VENDOR_STRING=3121-08491|Nodelocked||xde_proplusnet:1.5 \ HOSTID=ANY vendor_info="|Rational XDE DeveloperPlus for .NET|" \ NOTICE="Living on the EDGE" ck=133 INCREMENT xde_tester rational 1.5 31-dec-2020 uncounted A3FA61CA2114 \ VENDOR_STRING=3121-09041|Nodelocked||xde_tester:1.5 HOSTID=ANY \ vendor_info="|Rational XDE Tester|" NOTICE="Living on the \ EDGE" ck=132
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值