简体   繁体   English

如何使用 eclipse-plugin 打包将 Mockito 添加到 Tycho 单元测试中的测试类路径

[英]How can I add Mockito to the test classpath in Tycho's unit-tests with eclipse-plugin packaging

Recently, it has become possible to Execute unit-tests with eclipse-plugin packaging .最近,可以使用 eclipse-plugin 打包执行单元测试 And, in addition there is support for resolving JUnit Classpath Containers .此外,还支持解析 JUnit Classpath Containers

I would like to execute unit-tests with eclipse-plugin packaging, but would like to use the mockito library in addition to JUnit.我想使用 eclipse-plugin 打包执行单元测试,但除了 JUnit 之外还想使用mockito库。 I have a pomless build and would like to keep it that way.我有一个pomless 构建,并希望保持这种状态。 I do not want to add non-PDE files to the build, unless this is unavoidable.我不想将非 PDE 文件添加到构建中,除非这是不可避免的。

Question : What is the idiomatic/intended/correct way to add this dependency, or any other test-time dependencies?问题:添加此依赖项或任何其他测试时依赖项的惯用/预期/正确方法是什么?

Note: I am aware of the use of fragments for unit testing.注意:我知道使用fragments进行单元测试。 This is not what I am after.这不是我所追求的。 I actually want to use the new mechanism, if possible, or hear that this is currently impossible.如果可能的话,我实际上想使用新机制,或者听说目前这是不可能的。

For my initial purposes, and given these are intended to be Unit-tests, running non-OSGI would be ok.出于我最初的目的,并且考虑到这些旨在作为单元测试,运行非 OSGI 就可以了。 If there is a means for OSGI as well, that would be great, but I cannot imagine where the platform configuration could be stored.如果也有 OSGI 的方法,那就太好了,但我无法想象平台配置可以存储在哪里。

See this tycho discussion , short summary:请参阅此第tycho 讨论,简短摘要:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM