tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Per Newgro <per.new...@gmx.ch>
Subject Howto exchange bean implementation for testing?
Date Thu, 18 Feb 2010 08:13:44 GMT
Hi *,

this is not realy a openejb question but anyway.

I have following scenario. After login a "business"-session will be 
created for userId
with language and current date in it (has nothing to do with 
http-sessions or so).
The session is created by singleton bean SessionManager which is storing 
the session
in a map. Internally the session manager sets the current date (new 
Date()).
For testing issues i would like to preset the current date. But because 
the session times
out after date change i can't manipulate it. So a setter for current 
date is impossible.

What i would like to do is to exchange the session manager 
implementation by a
test session manager implementation in which i could implement an 
appripriate behavior
for test.

So how can i guarantee that my tests are using the TestSessionManager 
and the business
client the SessionManager? Is there something like 
"IgnoreBeanXYWhileDeployForMyTest"?

Cheers
Per

Mime
View raw message