51Testing软件测试论坛

标题: 基于testNG框架的Java单元测试流程 [打印本页]

作者: lsekfe    时间: 2020-11-30 11:07
标题: 基于testNG框架的Java单元测试流程
 1.配置
  建立Maven Project
[attach]131020[/attach]
[attach]131021[/attach]
[attach]131022[/attach]
建立pom.xml文件
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  2.     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  3.     <modelVersion>4.0.0</modelVersion>

  4.     <groupId>com.jerry</groupId>

  5.     <artifactId>mytest</artifactId>

  6.     <version>0.0.1-SNAPSHOT</version>

  7.     <packaging>jar</packaging>

  8.     <name>mytest</name>

  9.     <url>http://maven.apache.org</url>

  10.     <properties>

  11.       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

  12.     </properties>

  13.   <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  14.     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  15.     <modelVersion>4.0.0</modelVersion>

  16.     <groupId>com.jerry</groupId>

  17.     <artifactId>mytest</artifactId>

  18.     <version>0.0.1-SNAPSHOT</version>

  19.     <packaging>jar</packaging>

  20.     <name>mytest</name>

  21.     <url>http://maven.apache.org</url>

  22.     <properties>

  23.       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

  24.     </properties>
复制代码
 安装:https://www.cnblogs.com/xusweeter/p/6559196.html,将org.testng.eclipse.updatesite.zip 拷贝到%ECLIPSE_HOME%\dropins,建立TestNG Class。






欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2