问题描述
我有一个Android项目,它使用Maven的。最初,它好工作与Eclipse(ADT)。
I have an Android project, which uses Maven. Originally, it worked fine with Eclipse (ADT).
但后来我加了一个单元测试,避开的src
源$ C $ C到的src / main / JAVA
目录,并把我的单元测试到的src / test / java下
文件夹中。
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.
此后的Eclipse开始抱怨错了包名,并拒绝运行/调试我的单元测试。
Thereafter Eclipse started to complain about wrong package names and refuses to run/debug my unit tests.
我试图通过增加来解决这个问题的src / main / JAVA
和的src / test / java下
到Java源路径。
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?
推荐答案
我发现 MoreUnit 一>允许改变单元测试的位置。这解决了我的问题。
I found out that MoreUnit allows to change the location of the unit tests. This solved my problem.
这篇关于测试目录在Maven化Android项目配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!