Hey Philippe,
I will try to motivate and explain my point of view a bit better than I did in my last post.
1)
[...] modules defined as static inner classes and I believe it's a very nice way to document what the test is doing right in the test.
I fully agree for the reasons you mentioned (conciseness, everything is in one place, self-documenting). It is definitely the way to go!
Maybe I expressed myself poorly in the last post: The only change for this to work with the 'new approach' is to add another annotation to your test class.
It also makes it more explicit which module is used, if any. (You can just look at your class definition and don't have to 'scroll over the class body' to find the module / to find out that there is none defined.)
2)
The annotation approach is a bit more flexible. You can use multiple modules, they don't have to be derived from TestModule, you can apply them on a method-level basis and you can reuse already defined modules.
I don't think that it is a good idea to allow mixing of both approaches in a single test class.
3)
This patch almost solves this problem too, I think.
First of all, I don't like the idea that test modules are inherited from base classes implicitly.
What if you do not want this behavior? What if you declare a module in your subclass? Which module should be used? The one in the subclass? Both? ...
With the annotation approach you just tell the runner which module(s) you would like to use in your subclass.
It does not even has to be a module that is defined in the base class, but it may be one that is defined there.
Again, it makes the whole situation more explicit (self-documenting) which is a Good Thing, in my opinion.
You can also use Ctrl+Click / F3 in Eclipse to go to the test module very fast, which you cannot if it is inherited implicitly (Where do you click then? ;).
As I see it (as a user) is that we get more flexibility and explicitness by adding a single line of boilerplate (annotation).
The only real problem with 'enforcing the new approach' is that we break existing test code.
But all the errors will be easy to fix (add a simple annotation), it will not fail silently and in addition we can give a nice error message.
Cheers,
Julian