gpt4 book ai didi

java - 查找要在 pom .XML 文件中使用的正确 Junit 版本

转载 作者:行者123 更新时间:2023-11-30 02:04:14 25 4
gpt4 key购买 nike

我正在创建一个 appium 框架,我想知道我可以使用什么稳定版本的 Junit?在我的 Maven 项目中找到的默认版本 (Junit 3.8.1) 非常非常旧,但是当我尝试在 Eclipse 中使用最新版本的 JUnit 时,它不喜欢它,并在我的项目中放置了一个红色的“x” .

那么我可以使用什么

 Java. 1.8
Appium desktop 1.8.1
java-client 5.0.4
selenium-java 3.11.0
TestNG 6.11

完全不使用 JUnit 会更容易吗?

<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>5.0.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.11.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
<scope>test</scope>
</dependency>


<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

最佳答案

您绝对应该考虑切换到 Junit 4.12。

尝试下载最新版本的 Eclipse(或者切换到 IntelliJ,非常棒)。

用途:

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>

否则你可以尝试像 TestNG 这样的 junit 替代品。

关于java - 查找要在 pom .XML 文件中使用的正确 Junit 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51827737/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com