【问题标题】:How to test specific method with maven-surefire-plugin in eclipse如何在 Eclipse 中使用 maven-surefire-plugin 测试特定方法
【发布时间】:2013-06-27 11:53:53
【问题描述】:

我知道使用“mvn -Dtest=TestCircle#mytest test”可以在控制台中做到这一点,但我想在 Eclipse 中做一些事情,比如我选择一个方法并右键单击而不是运行,就像这样。

我曾尝试使用 eclipse 变量来设置测试命令参数,但没有变量可以返回我选择的类名和方法名。

【问题讨论】:

    标签: eclipse maven testing


    【解决方案1】:

    我知道使用“mvn -Dtest=TestCircle#mytest test”可以在控制台中做到这一点 但我想在 Eclipse 中做一些事情,比如我选择一种方法并正确 点击而不是运行,就像这样。

    在eclipse中,你可以在包资源管理器中选择你想要测试的方法,然后选择右键-> Run As -> JUnit Test(见图)。

    不过,现在与 Maven 无关了。

    【讨论】:

      猜你喜欢
      • 2012-02-11
      • 2019-09-27
      • 2014-06-28
      • 1970-01-01
      • 1970-01-01
      • 2022-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多