如何在Eclipse中为新的JUnit测试默认源文件夹? [英] How to default the source folder for new JUnit tests in Eclipse?

查看:584
本文介绍了如何在Eclipse中为新的JUnit测试默认源文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的大多数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?

推荐答案

我使用 moreUnit ,一个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测试默认源文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆