|Anonymous | Login | Signup for a new account||10-26-2020 03:21 PDT|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details [ Jump to Notes ]||[ View Advanced ] [ Issue History ] [ Print ]|
|ID||Category||Severity||Reproducibility||Date Submitted||Last Update|
|0003741||[Resin]||minor||always||11-04-09 10:21||01-11-10 10:01|
|Summary||0003741: CanDI in unit tests|
(rep by Paul Campbell)
he problem with J2EE DI is that its very difficult to use any DI in unit tests because you have to run the container or something that emulates it (and as someone already mentioned, testing in the real environment is preferable to emulation).
Spring still has the drop here because you can selectively load only parts of your DI config and because it follows the library model i.e. it doesn't take away control over execution of code. Even when your only using partial configs in this way you are still testing very much against the "real thing" so behavior is very unlikely to change when you come to run your code in a web server.
So in a nutshell the practical annoyances with J2EE are more to do with the whole "container" idea than the semantics of the DI spec. Its all very well being able to inject POJOS but it isn't a great help if you cant do it in your junit tests IMO.
The com.caucho.resin.ResinContext and @RunWith(ResinJUnitRunner.class) in Resin 4.0.4 will provide this capability.
|11-04-09 10:21||ferg||New Issue|
|01-11-10 10:01||ferg||Note Added: 0004378|
|01-11-10 10:01||ferg||Status||new => closed|
|01-11-10 10:01||ferg||Resolution||open => fixed|
|01-11-10 10:01||ferg||Fixed in Version||=> 4.0.4|
| Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
28 total queries executed.|
25 unique queries executed.