tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Testing Services with access to Entities
Date Tue, 25 Mar 2008 15:57:45 GMT

I have want to test some internal used beans which access entity beans.
The problem is now, that the unit test wants to test a service which
return an entity. This entity has a colelction member, something like

Class A {

Private List<B> bs;

public List<B> getBs() {
	return bs;

The collection bs is lazy initialized and should be. So, if I want to
access the bs from the returned entity instance A, I get a
LazyInitializationException. How can I test internal used services? Is
there a godd way to do this? Until now I have only tested Beans which
return transfer objects, but know this would be necessary.


View raw message