簡體   English   中英

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

[英]Finding the Correct Junit Version to use in pom .XML file

我正在創建一個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替代方案。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM