在一个mavenized的Android项目中配置测试目录 [英] Configuration of test directories in a mavenized Android project
问题描述
但是,我添加了一个单元测试,并将源代码从 src
到 src / main / java
目录,并将我的单元测试放入 src / test / java
文件夹中。 / p>
之后,Eclipse开始抱怨错误的包名称,拒绝运行/调试我的单元测试。
通过向Java源路径添加 src / main / java
和 src / test / java
来解决问题。 p>
但这没有帮助,我还是无法运行单元测试。
我该如何解决?
我发现 MoreUnit 允许更改单元测试的位置。这解决了我的问题。
I have an Android project, which uses Maven. Originally, it worked fine with Eclipse (ADT).
But then I added a unit test and moved the source code from src
to src/main/java
directory and put my unit tests into src/test/java
folder.
Thereafter Eclipse started to complain about wrong package names and refuses to run/debug my unit tests.
I tried to fix the problem by adding src/main/java
and src/test/java
to Java source path.
But this didn't help, I still can't run unit tests.
How can I fix this?
I found out that MoreUnit allows to change the location of the unit tests. This solved my problem.
这篇关于在一个mavenized的Android项目中配置测试目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!