Mantis Bugtracker
  

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
Reporter ferg View Status public  
Assigned To
Priority normal Resolution fixed  
Status closed   Product Version 4.0.2
Summary 0003741: CanDI in unit tests
Description (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.
Additional Information
Attached Files

- Relationships

- Notes
(0004378)
ferg
01-11-10 10:01

server/1e9- support/0410

The com.caucho.resin.ResinContext and @RunWith(ResinJUnitRunner.class) in Resin 4.0.4 will provide this capability.
 

- Issue History
Date Modified Username Field Change
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.
Powered by Mantis Bugtracker