相关疑难解决方法(0)

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

这是我目前的测试片段:

<packaging>eclipse-test-plugin</packaging>

<dependencies>
    <dependency>
        <groupId>org.junit</groupId>
        <artifactId>com.springsource.org.junit</artifactId>
        <version>4.7.0</version>
    </dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)

使用以下插件配置:

<plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>tycho-surefire-plugin</artifactId>
    <version>${tycho.version}</version>
    <configuration>
        <dependencies>
            <dependency>
                <type>p2-installable-unit</type>
                <artifactId>org.eclipse.equinox.ds</artifactId>
            </dependency>
            <dependency>
                <type>p2-installable-unit</type>
                <artifactId>org.apache.felix.gogo.shell</artifactId>
            </dependency>
        </dependencies>
        <providerHint>junit47</providerHint>
        <argLine>-ea</argLine>
    </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

我使用POM优先方法来解决依赖关系:

<pomDependencies>consider</pomDependencies>
Run Code Online (Sandbox Code Playgroud)

上面的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创建我自己的包.

junit osgi hamcrest tycho tycho-surefire-plugin

10
推荐指数
1
解决办法
4001
查看次数

标签 统计

hamcrest ×1

junit ×1

osgi ×1

tycho ×1

tycho-surefire-plugin ×1