- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 Eclipse 中调试我的 Maven Surefire 测试套件。我正在使用 TestNg 作为测试运行器。我可以从终端运行此命令,然后在 Eclipse 中启动“远程 Java 应用程序”进行调试:
mvn clean test -Dmaven.surefire.debug -Dclass=com.myTests.SampleTestClass
是否可以在 Eclipse 中设置调试配置,以便我可以直接从 Eclipse 进行调试,而无需在终端中运行命令?
这是我在 Pom.xml 中的 maven surefire 设置
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<systemPropertyVariables>
<my_property>${my_property}</my_property>
</systemPropertyVariables>
<properties>
<property>
<name>listener</name>
<value>com.myPackage.TestListener</value>
</property>
</properties>
</configuration>
</plugin>
</plugins>
最佳答案
正如 khmarbaise 已经提到的,抛弃 Maven 部分,只从 Eclipse 本身运行测试。
在选择包含 TestNG 测试的包后,您要使用的组合键是:Alt + Shift + D, N
要调试 JUnitTest,请将 N 替换为 T
关于保留当前功能:要将监听器附加到您的 testng 测试套件,请使用 @Listeners
-Annotation ,您可以在其中附加多个实现 ITestNGListener
的类来收听您的套件。
请注意,ITestNGListener 只是一个标记接口(interface),没有其他功能。
对于定义的 systemPropertyVariables
:您应该能够将它们附加到您的 testng 运行(和调试)配置中。
关于java - 如何在 Eclipse 中调试 maven surefire 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30141933/
最近我将 surefire 插件从 2.15 迁移到 3.0.0-M5,即使所有测试用例都通过了,我仍然看到下面的错误。我在生成的报告中没有看到任何内容,只是一个空文件。 Google 和 stack
我无法获得 maven-surefire-report-plugin 生成 surefire-report.html 当我运行时: mvn clean deploy site mvn clean si
我的 pom.xml 中没有 surefire 插件条目。但是当我使用命令运行时,我得到了 surefure 插件错误: mvn test -Dtest=TEstClass 错误: [ERROR]
我有一个简单的 JPMS 模块。当我使用 maven-surefire-plugin 2.20.1 时一切正常 - 我的测试已执行: org.apache.m
运行 Spring Boot 2.0.2.RELEASE 应用程序的 maven (3.5.2) 构建(由具有 Web 依赖项的 Web 初始化程序生成)无法执行 maven-surefire-p
我试图通过嵌入式jetty服务器和apache wink REST客户端在我的scim Restful服务器实现上运行集成测试,但未能运行测试。这是我的 EmbeddedServerBase 类 pa
所以我遇到了问题,我正在按照教程 Working with Custom Content types in Alfresco 进行操作但当我尝试安装该程序时遇到 Maven 问题。它告诉我 Maven
在我的项目中,测试位于两个目录中的 maven 包“java-tests-framework”(整个项目的子包)中: /src/main/java /src/test/java 我想使用 Surefi
所以我遇到了问题,我正在按照教程 Working with Custom Content types in Alfresco 进行操作但当我尝试安装该程序时遇到 Maven 问题。它告诉我 Maven
您好,我在一个项目中有一个模块,我正在尝试从模块目录运行该模块: mvn 集成测试-PmyProps 在pom中 admin ...
当我在 Surefire 中运行测试时,有什么区别 suitesAndClasses 和 classes 第一个示例似乎并行运行我的测试类,而第二个示例则不然。 最佳答案 请在下面找到一个简单的示例来
我怀疑这很简单,当我直接从 eclipse 执行 JUnit 测试时,surefire 报告没有生成,甚至文件夹 (target/surefire/surefire-report) 也没有生成,但是当
我已经使用 Maven 配置了 Surefire 报告 我没有收到任何错误,但我也没有得到测试执行的结果当作为 Maven 测试运行时。我已附上屏幕截图。我也有正确的 Maven 项目结构 作为 Ma
我想重新运行一个我知道会失败的测试,因为我正在尝试测试 Surefire 参数以重新运行失败的测试。我尝试用这两个命令运行 Maven,它们都没有按预期工作 -Dsurefire.rerunFaili
看起来surefire 和failsafe 插件按顺序执行测试类,而在类中定义的测试以不确定的顺序执行。 为了发现依赖于顺序的测试(我们认为是糟糕的测试),我们希望强制每次运行的顺序不同。理想情况下,
有没有办法让万无一失的干运行? 会列出哪些测试的东西 会 运行,而不运行它们。 目标是知道在特定配置下哪些测试(将)在 JBoss AS7 测试套件中运行。 最佳答案 Janinko 在 https:
在我的项目中,我有几个模块。当我使用 surefire maven 插件生成报告时,它会分别为每个模块创建报告。我想合并这些报告。有没有办法合并这个单独的报告。 Surefire 插件中的任何配置?
我如何在 maven 的默认生命周期中生成 surefire 报告。我们在 teamcity 中设置了工作,目标为 mvn clean install -Pprod 此作业运行所有 junits,我想
我正在运行 Maven 3.1.0 Surefire plugin 已经与 --quiet选项,但是它仍然将单元测试的结果打印到命令行,即使它们都通过了。 有没有办法让它只打印失败? 如果一切正常,我
我排除了插件中除我的测试套件之外的所有测试: org.apache.maven.plugins maven-surefire-plugin 2.11
我是一名优秀的程序员,十分优秀!