日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

maven+testng+eclipse

發布時間:2024/9/5 编程问答 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 maven+testng+eclipse 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.安裝maven

2.安裝testng

3.配置maven的dependency,和build

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>testnggroup</groupId><artifactId>testngartifact</artifactId><version>0.0.1-SNAPSHOT</version><packaging>jar</packaging><name>testngartifact</name><url>http://maven.apache.org</url><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencies><!-- https://mvnrepository.com/artifact/org.testng/testng --><dependency><groupId>org.testng</groupId><artifactId>testng</artifactId><version>6.14.3</version><scope>test</scope></dependency></dependencies><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.1</version><configuration><source>1.7</source><target>1.7</target><compilerArgs><arg>-Xlint:unchecked</arg><arg>-Xlint:deprecation </arg><!--<arg>endorseddirs=${endorsed.dir}</arg>--></compilerArgs></configuration></plugin><!--添加插件 關聯testNg.xml --><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><version>2.5</version><configuration><testFailureIgnore>true</testFailureIgnore><suiteXmlFiles><file>res/testNG.xml</file></suiteXmlFiles><!--<workingDirectory>target/</workingDirectory>--></configuration></plugin></plugins></build> </project>

  

4.創建res文件夾,創建testNG.xml

<?xml version="1.0" encoding="utf-8" ?> <suite name="testproj" parallel="false"><test name="testDemo1"><classes><class name="SimpleTest.java"></class></classes></test> </suite>

 

5.在eclipse中打開命令行,輸入:mvn -f pom.xml clean test -DxmlFileName=testNG.xml

?

轉載于:https://www.cnblogs.com/zhizhiyin/p/9002262.html

總結

以上是生活随笔為你收集整理的maven+testng+eclipse的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。