40

Most of our Eclipse projects have multiple source folders, for example:

  • src/main/java
  • src/test/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).

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?

4

3 に答える 3

52

単体テストの作成を支援する Eclipse プラグインであるmoreUnitを使用します。他の機能の中でも特に、テストのデフォルトのソース フォルダーを構成できます。

于 2008-09-16T17:19:40.333 に答える
6

いいえ。

プラグイン コードを変更しない限り、デフォルトのソース フォルダーは、右クリックしたクラスを含むフォルダーと常に同じです (最初にリストされたソース フォルダーとは限りません)。同意します、変更できるといいですね!

于 2008-09-16T03:27:57.103 に答える
0

これで、私の高速コード Eclipse プラグインを使用できます。このプラグインを使用すると、テスト パスをsrc/test/java1 回だけにするように構成できます。また、単体テスト機能へのジャンプもあります。http://fast-code.sourceforge.net/で入手できます。

于 2011-03-23T01:58:11.900 に答える