问题标签 [tycho-surefire-plugin]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2244 浏览

java - 如何调试 Tycho 运行的测试用例?

使用 Tycho 构建项目时,测试用例会在使用 Equinox 启动器运行的新进程中运行-application org.eclipse.tycho.surefire.osgibooter.headlesstest

如何调试测试用例?

0 投票
1 回答
434 浏览

eclipse-plugin - SWTBOT 切换工作区

我正在使用带有 tycho-surfire 的 SWTBOT 来测试 Eclipse 应用程序。测试单独运行良好,但是当我组合它们时,我需要在每次测试后切换工作区,或者以某种方式为每个测试指定一个特定的工作区。当我尝试使用以下代码从测试内部切换工作区时:

模拟器到达 OK 按钮并按下它,工作台关闭但不再启动。要求设置属性 eclipse.vm 时出错,我做到了。错误消失但仍无法切换工作区。

是否有任何配置文件或我可以添加到 tyco-surfire 的东西来配置 SWTBot 以使其运行的每个测试都有一个特定的工作区?或者甚至在一个新的工作台上运行每个测试,而不是在同一个工作台上继续?或者是否有任何解决方案可以解决从测试内部切换工作区的问题?

0 投票
1 回答
818 浏览

eclipse-rcp - 带有 windowtester pro 的 tycho surefire 无法打开正确的窗口

我正在尝试使用 windowtester pro 建立一个 UI 测试系统。我想通过使用 Tycho 插件将这些测试链接到 maven 构建过程中。为了练习目的,我目前正在使用一个示例项目。

现在,当我构建我的项目时,一切似乎都可以正常编译,但是当测试开始时,我收到以下消息并弹出一个默认的 Eclipse 窗口。然后在该窗口上执行测试并且 -suprise- 失败。

框架论据:

-application org.eclipse.tycho.surefire.osgibooter.uitest -testproperties C:\Users\jla\workspace\com.example.addressbook.test\target \surefire.properties

-product com.example.addressbook.bundle.product

命令行参数:
-debug -consolelog -data C:\Users\jla\workspace\com.example.addressbook.test\target\work\data -dev file:/C:/Users/jla/workspace/com.example .addressbook.test/target/dev.properties -application org.eclipse.tycho.surefire.osgibooter.uitest -testproperties C:\Users\jla\workspace\com.example.addressbook.test\target \surefire.properties -product com .example.addressbook.bundle.product

org.eclipse.ui.PartInitException:未找到视图描述符:org.eclipse.ui.navigator.ProjectExplorer

org.eclipse.ui.PartInitException:未找到视图描述符:org.eclipse.ui.navigator.ProjectExplorer!STACK 1 org.eclipse.ui.PartInitException:未找到视图描述符:org.eclipse.ui.navigator.ProjectExplorer

这是我的测试项目的 Pom.xml:

0 投票
0 回答
256 浏览

junit - 如何使用自定义 URL 协议运行 Maven Tycho Surfire 的单元测试(java.net.MalformedURLException:未知协议)

我在运行需要使用声明为的自定义 URL 处理程序的 JUnit 测试时遇到了一些困难src/sun/net/www/protocol/exotic/Handler.java

Tycho 的万无一失会执行一些不同的测试,导致测试失败。例外很明显:java.net.MalformedURLException: unknown protocol

我试图找出谁对此负责。而且我发现,如果我创建一个带有一个测试类和一个自定义处理程序的简单 Maven 项目,那么自 2.4 版以来,Maven surefire 就可以正常工作。在它失败之前。所以我猜 Maven Tycho 使用的是旧的实现。

您知道如何在 Maven Tycho 运行的 JUnit 测试中启用自定义协议吗?

0 投票
2 回答
1718 浏览

eclipse - Is it possible to specify a different JVM to run Eclipse with tycho-surefire-plugin

We have a project which is built with Tycho 0.15.0. When running the tests (i.e. UI tests), maven executes

This works so far.

But now, we want to have the test instance run with a different JVM (located e.g., in c:\my_custom_jvm\jre\bin).

Is this possible to achieve? I have searched for possibilities and found the jvm option for the Maven Surefire plug-in, but this does not seem to be supported by tycho-surefire ...

For reference, here's the complete snippet of the pom.xml:

0 投票
1 回答
4503 浏览

junit - 在 Eclipse RCP Tycho 项目中使用 Mockito 和 JUnit 需要哪些依赖项

这是我当前的测试片段:

使用以下插件配置:

我使用 POM-first 方法来解决依赖关系:

上面的 JUnit 版本是我能找到的唯一一个,它被打包成一个包。

问题是我找不到允许我在片段中一起使用 JUnit 和 Mockito 的匹配项。

我的常见问题是:

  • 来自 Maven Central 的 Mockito-core 需要 Hamcrest 1.0-2.0,但 JUnit 包在 4.7.0 版本中导出 Hamcrest
  • Springsource 存储库中没有可用的 junit-dep 包
  • 当我添加另一个 Hamcrest 包时,JUnit (4.7.0) 和 Hamcrest 包 (1.3) 导出的版本之间存在版本冲突

我想避免从 JUnit、Hamcrest 和 Mockito 创建自己的包。

0 投票
1 回答
1386 浏览

unit-testing - 使用 tycho-surefire-plugin 运行单个插件测试方法

如何使用 tycho-surefire-plugin 在 Maven 中运行单个插件测试方法?

我尝试了-Dtest带有# 的选项,但它不起作用:

有什么我想念的吗?

0 投票
2 回答
540 浏览

eclipse - 在 Tycho Surefire 的测试中使用来自 Eclipse Orbit 的 slf4j

我目前正在尝试在我们基于 Eclipse 的产品中设置一个日志记录工具,使用 SLF4J 作为 Eclipse Orbit 项目的捆绑包。

我详细使用:

当我尝试使用 SLF4J 日志 API 运行测试用例时,在 Tycho 构建中我收到错误消息

Surefire 仅使用 Eclipse 产品和插件 Manifest.MF 文件的目标平台来检测依赖关系。由于 ch.qos.logback.slf4j 是一个片段,因此无法直接依赖于 Manifest。

我的假设是在测试执行期间,片段不是运行时配置的一部分。

我希望我的问题不是太愚蠢,但是如何配置环境,以便将片段添加到运行时配置中,并且 SLF4J 可以解决对 StaticLoggerBinder 的请求?

0 投票
1 回答
226 浏览

maven - 与 Maven 和 Tycho-surefire 一起在 xtext-project 上运行 Cobertura

我有一个多模块项目,其中一个测试模块可以测试其他三个模块。我已经设置了 cobertura 仪器,使用此处描述的 maven antrun-plugin 进行合并和报告:cobertura on maven multi module project但我没有使用仪器类覆盖普通类,而是将它们存储在每个仪器的仪器类文件夹中模块。在集成测试后阶段,我合并 cobertura.ser 文件并在最后执行的测试模块的 pom.xml 中生成报告。

如何配置 tycho-surefire 以使用检测类而不是普通类?否则我总是得到 0% 的覆盖率......

我没有找到一个简单的解决方案,cobertura:aggregate 目标不起作用

0 投票
0 回答
188 浏览

java - Tycho surefire JUnit 测试仅在 64 位 ubuntu 上失败

我使用 maven 和 jenkins 构建了我的 xtext eclipse 插件项目,并使用 tycho surefire 构建了 junit 测试。Jenkins 在 64 位 ubuntu 上运行并且测试失败: java.lang.IllegalStateException: Unresolved proxy http://url/from/mydsl#//element. Make sure the EPackage has been registered. 我尝试使用 StandaloneSetup 类中的覆盖注册函数来解决这个问题,如从推断的 Ecore 模型切换到 Xtext 语法中的导入模型中所述,但这没有为我工作。我尝试在 ubuntu 32 位上运行测试,它出人意料地工作而没有失败。

我希望有人能帮助我