Developers, Developers, Developers! Maksim Sorokin IT Blog


Tests in Tycho

In Tycho tests expected to have the following name pattern: **/Test*.java, **/* and **/* By default, the following is excluded: **/Abstract***/Abstract* and **/*$*.

If you want to change excluded and included tests, in your test fragment you have to add something like the following:


Keep in mind, that if tycho will not find any tests, it will fail! See discussion on issue tracker.


Eclipse “Favorites” and JUnit 4 Static Imports Revised

After some time of using static imports workaround for JUnit 4 and EasyMock described earlier I came to the conclusion, that editing import "favorites" is not a good idea.

The problem is that when you include a class with static methods in Eclipse "favorites", then in Content Assistant you see hundred of those static methods. This maybe somewhat inconvenient. Moreover, Content Assistant hangs a bit longer before appearing.

From now on I am directly using class name like Assert.assert.. or EasyMock.expect.. instead of using static imports.


Eclipse and JUnit 4 Static Imports

Importing static JUnit 4 annotations in Eclipse is somewhat boring. The thing is that by default Eclipse doesn't import static fields or methods.

The most optimal way is to add junit.framework.Assert to "favorite" static types. Then, assertion methods will be seen in editor.
How to:

  • Menu -> Window -> Preferences
  • Java -> Editor -> Content Assist -> Favorites
  • New Type: junit.framework.Assert

P.S.: idea taken from