Hi,

Just got an idea: Create an AbstractComponentTestCase implementation that does 
this in its setup/init() method:
- automatically ask the Component Manager for the list of dependencies for the 
component under test (can be done with a generic for example to know which 
component class is under test) and for each of them register a mock 
implementation automatically.

The advantages:
- remove lots of boilerplate testing code to register mocks of dependent 
components (all the component descriptor creation)
- ensures that top level dependencies are mocked and not deps of deps (best 
practice)
- ensures each component is tested in isolation thus focusing on testing what 
it does
- remove the need for the execution context or configuration source specific 
inits we have in current AbstractComponentTestCaset implementation
- allow to call the annotation loader to register *only* the component under 
test (and its graph of components) rather than initializing *all* components 
for each unit test! This will multiply by x100 the speed of our unit tests I 
believe.

WDYT?

Thanks
-Vincent

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to