问题描述
我们的大多数Eclipse项目都有多个源文件夹,例如:
Most of our Eclipse projects have multiple source folders, for example:
- src / main / java
- src / test / java
当您右键单击一个类并选择New JUnit Test时,默认的源文件夹对于新的测试是src / main / java(可能是项目属性中列出的第一个源文件夹)。
When you right-click on a class and choose New JUnit Test, the default source folder for the new test is "src/main/java" (presumably the first source folder listed in the project properties).
有没有办法更改默认的源文件夹对于新的JUnit测试,所以当我执行上述操作时,默认情况下会创建src / test / java文件夹的新测试?
Is there any way to change the default source folder for new JUnit tests, so that when I do the above action, the new test will be created in say the "src/test/java" folder by default?
推荐答案
我使用,一个Eclipse插件来协助编写单元测试。除了其他功能之外,还可以配置测试的默认源文件夹。
I use moreUnit, an Eclipse plugin to assist writing unit tests. Among other features, it lets you configure the default source folder of tests.
这篇关于如何在Eclipse中为新的JUnit测试默认源文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!