All you spring gurus...

I wish to test my spring application and to do this I need to mock out
certain spring beans. I do not want to create a whole new spring context to
do this, nor do I want to move away from using annotations.

So I would like to do the following:

Use the normal spring unit test mechanisms to setup my test
@RunWith(SpringJUnit4ClassRunner.class) and @ContextConfiguration

And then for each test to create the mock version of the bean it wants to
mock and then hot swap that bean in. When the test is done put the original
bean back.

It can be done, it is talked about
here<http://forum.springsource.org/archive/index.php/t-46824.html>
.

There is the org.springframework.aop.target.HotSwappableTargetSource which
allows for the hot swapping of one bean with another.

The problem is how do I configure a bean for hot swapping via annotations?
According to all the documentation I've read, I just annotate with @Aspect -
I must be missing a trick as this doesn't work.

Anyone done something similar or can help?

-- 
see my blog:
http://analysis102.blogspot.com
http://audiblethoughts.blogspot.com
http://outsideofficehours.blogspot.com

-- 
You received this message because you are subscribed to the Google Groups 
"CTJUG Tech" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/CTJUG-Tech?hl=en
For Cape Town Java User Group home page see http://www.ctjug.org.za/
For jobs see http://jobs.gamatam.com/

Reply via email to